Gearbox Protocol emits various events to track important state changes and operations.
Credit Manager Events
SetCreditConfigurator
event SetCreditConfigurator(address indexed newConfigurator)
Emitted when a new credit configurator is set.
Address of the new credit configurator
Credit Facade Events
OpenCreditAccount
event OpenCreditAccount(
address indexed creditAccount,
address indexed onBehalfOf,
address indexed caller,
uint256 referralCode
)
Emitted when a new credit account is opened.
Address of the newly created credit account
Address the account was opened for
Address that initiated the account opening
CloseCreditAccount
event CloseCreditAccount(
address indexed creditAccount,
address indexed borrower
)
Emitted when an account is closed.
Address of the closed credit account
Address of the account owner
LiquidateCreditAccount
event LiquidateCreditAccount(
address indexed creditAccount,
address indexed liquidator,
address to,
uint256 remainingFunds
)
Emitted when an account is liquidated.
Address of the liquidated credit account
Address of the liquidator
Address receiving remaining funds
Amount of remaining funds after liquidation
PartiallyLiquidateCreditAccount
event PartiallyLiquidateCreditAccount(
address indexed creditAccount,
address indexed token,
address indexed liquidator,
uint256 repaidDebt,
uint256 seizedCollateral,
uint256 fee
)
Emitted when an account is partially liquidated.
Address of the partially liquidated credit account
Collateral token that was seized
Address of the liquidator
Amount of collateral seized
AddCollateral
event AddCollateral(
address indexed creditAccount,
address indexed token,
uint256 amount
)
Emitted when collateral is added to an account.
Address of the credit account
WithdrawCollateral
event WithdrawCollateral(
address indexed creditAccount,
address indexed token,
uint256 amount,
address to
)
Emitted when collateral is withdrawn from an account.
Address of the credit account
StartMultiCall
event StartMultiCall(
address indexed creditAccount,
address indexed caller
)
Emitted when a multicall is started.
Address of the credit account
Address initiating the multicall
WithdrawPhantomToken
event WithdrawPhantomToken(
address indexed creditAccount,
address indexed token,
uint256 amount
)
Emitted when a phantom token is withdrawn by account.
Address of the credit account
Execute
event Execute(
address indexed creditAccount,
address indexed targetContract
)
Emitted when a call from account to an external contract is made during a multicall.
Address of the credit account
FinishMultiCall
Emitted when a multicall is finished.
Pool Events
Refer
event Refer(
address indexed onBehalfOf,
uint256 indexed referralCode,
uint256 amount
)
Emitted when depositing liquidity with a referral code.
Address receiving the shares
Borrow
event Borrow(
address indexed creditManager,
address indexed creditAccount,
uint256 amount
)
Emitted when a credit account borrows funds from the pool.
Repay
event Repay(
address indexed creditManager,
uint256 borrowedAmount,
uint256 profit,
uint256 loss
)
Emitted when a credit account’s debt is repaid to the pool.
Amount of principal repaid
IncurUncoveredLoss
event IncurUncoveredLoss(
address indexed creditManager,
uint256 loss
)
Emitted when incurred loss cannot be fully covered by burning treasury’s shares.
SetInterestRateModel
event SetInterestRateModel(address indexed newInterestRateModel)
Emitted when a new interest rate model contract is set.
New interest rate model address
SetPoolQuotaKeeper
event SetPoolQuotaKeeper(address indexed newPoolQuotaKeeper)
Emitted when a new pool quota keeper contract is set.
New pool quota keeper address
SetTotalDebtLimit
event SetTotalDebtLimit(uint256 limit)
Emitted when a new total debt limit is set.
AddCreditManager
event AddCreditManager(address indexed creditManager)
Emitted when a new credit manager is connected to the pool.
SetCreditManagerDebtLimit
event SetCreditManagerDebtLimit(
address indexed creditManager,
uint256 newLimit
)
Emitted when a new debt limit is set for a credit manager.
SetWithdrawFee
event SetWithdrawFee(uint256 fee)
Emitted when a new withdrawal fee is set.
New withdrawal fee in basis points
Price Oracle Events
SetPriceFeed
event SetPriceFeed(
address indexed token,
address indexed priceFeed,
uint32 stalenessPeriod,
bool skipCheck
)
Emitted when a new price feed is set for a token.
Staleness period in seconds
Whether to skip staleness checks
SetReservePriceFeed
event SetReservePriceFeed(
address indexed token,
address indexed priceFeed,
uint32 stalenessPeriod,
bool skipCheck
)
Emitted when a new reserve price feed is set for a token.
Reserve price feed address
Staleness period in seconds
Whether to skip staleness checks
Credit Configurator Events
AddCollateralToken
event AddCollateralToken(address indexed token)
Emitted when a token is made recognizable as collateral.
SetTokenLiquidationThreshold
event SetTokenLiquidationThreshold(
address indexed token,
uint16 liquidationThreshold
)
Emitted when a new collateral token liquidation threshold is set.
New liquidation threshold in basis points
ScheduleTokenLiquidationThresholdRamp
event ScheduleTokenLiquidationThresholdRamp(
address indexed token,
uint16 liquidationThresholdInitial,
uint16 liquidationThresholdFinal,
uint40 timestampRampStart,
uint40 timestampRampEnd
)
Emitted when a collateral token liquidation threshold ramping is scheduled.
liquidationThresholdInitial
Initial liquidation threshold
liquidationThresholdFinal
Final liquidation threshold
ForbidToken
event ForbidToken(address indexed token)
Emitted when a collateral token is forbidden.
AllowToken
event AllowToken(address indexed token)
Emitted when a previously forbidden collateral token is allowed.
AllowAdapter
event AllowAdapter(
address indexed targetContract,
address indexed adapter
)
Emitted when a new adapter and its target contract are allowed.
ForbidAdapter
event ForbidAdapter(
address indexed targetContract,
address indexed adapter
)
Emitted when an adapter and its target contract are forbidden.
UpdateFees
event UpdateFees(
uint16 feeLiquidation,
uint16 liquidationPremium,
uint16 feeLiquidationExpired,
uint16 liquidationPremiumExpired
)
Emitted when new fee parameters are set.
Liquidation fee in basis points
Liquidation premium in basis points
Expired liquidation fee in basis points
liquidationPremiumExpired
Expired liquidation premium in basis points
SetPriceOracle
event SetPriceOracle(address indexed priceOracle)
Emitted when a new price oracle is set.
SetCreditFacade
event SetCreditFacade(address indexed creditFacade)
Emitted when a new facade is connected.
New credit facade address
CreditConfiguratorUpgraded
event CreditConfiguratorUpgraded(address indexed creditConfigurator)
Emitted when the configurator contract is upgraded.
New credit configurator address
SetBorrowingLimits
event SetBorrowingLimits(
uint256 minDebt,
uint256 maxDebt
)
Emitted when new debt principal limits are set.
SetMaxDebtPerBlockMultiplier
event SetMaxDebtPerBlockMultiplier(uint8 maxDebtPerBlockMultiplier)
Emitted when a new max debt per block multiplier is set.
maxDebtPerBlockMultiplier
New multiplier value
SetLossPolicy
event SetLossPolicy(address indexed lossPolicy)
Emitted when a new loss policy is set.
SetExpirationDate
event SetExpirationDate(uint40 expirationDate)
Emitted when a new expiration timestamp is set.