Skip to main content
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.
newConfigurator
address
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.
creditAccount
address
Address of the newly created credit account
onBehalfOf
address
Address the account was opened for
caller
address
Address that initiated the account opening
referralCode
uint256
Referral code used

CloseCreditAccount

event CloseCreditAccount(
    address indexed creditAccount,
    address indexed borrower
)
Emitted when an account is closed.
creditAccount
address
Address of the closed credit account
borrower
address
Address of the account owner

LiquidateCreditAccount

event LiquidateCreditAccount(
    address indexed creditAccount,
    address indexed liquidator,
    address to,
    uint256 remainingFunds
)
Emitted when an account is liquidated.
creditAccount
address
Address of the liquidated credit account
liquidator
address
Address of the liquidator
to
address
Address receiving remaining funds
remainingFunds
uint256
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.
creditAccount
address
Address of the partially liquidated credit account
token
address
Collateral token that was seized
liquidator
address
Address of the liquidator
repaidDebt
uint256
Amount of debt repaid
seizedCollateral
uint256
Amount of collateral seized
fee
uint256
Fee paid to liquidator

AddCollateral

event AddCollateral(
    address indexed creditAccount,
    address indexed token,
    uint256 amount
)
Emitted when collateral is added to an account.
creditAccount
address
Address of the credit account
token
address
Token address
amount
uint256
Amount added

WithdrawCollateral

event WithdrawCollateral(
    address indexed creditAccount,
    address indexed token,
    uint256 amount,
    address to
)
Emitted when collateral is withdrawn from an account.
creditAccount
address
Address of the credit account
token
address
Token address
amount
uint256
Amount withdrawn
to
address
Recipient address

StartMultiCall

event StartMultiCall(
    address indexed creditAccount,
    address indexed caller
)
Emitted when a multicall is started.
creditAccount
address
Address of the credit account
caller
address
Address initiating the multicall

WithdrawPhantomToken

event WithdrawPhantomToken(
    address indexed creditAccount,
    address indexed token,
    uint256 amount
)
Emitted when a phantom token is withdrawn by account.
creditAccount
address
Address of the credit account
token
address
Phantom token address
amount
uint256
Amount withdrawn

Execute

event Execute(
    address indexed creditAccount,
    address indexed targetContract
)
Emitted when a call from account to an external contract is made during a multicall.
creditAccount
address
Address of the credit account
targetContract
address
Target contract address

FinishMultiCall

event 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.
onBehalfOf
address
Address receiving the shares
referralCode
uint256
Referral code used
amount
uint256
Amount deposited

Borrow

event Borrow(
    address indexed creditManager,
    address indexed creditAccount,
    uint256 amount
)
Emitted when a credit account borrows funds from the pool.
creditManager
address
Credit manager address
creditAccount
address
Credit account address
amount
uint256
Amount borrowed

Repay

event Repay(
    address indexed creditManager,
    uint256 borrowedAmount,
    uint256 profit,
    uint256 loss
)
Emitted when a credit account’s debt is repaid to the pool.
creditManager
address
Credit manager address
borrowedAmount
uint256
Amount of principal repaid
profit
uint256
Profit from the account
loss
uint256
Loss from the account

IncurUncoveredLoss

event IncurUncoveredLoss(
    address indexed creditManager,
    uint256 loss
)
Emitted when incurred loss cannot be fully covered by burning treasury’s shares.
creditManager
address
Credit manager address
loss
uint256
Uncovered loss amount

SetInterestRateModel

event SetInterestRateModel(address indexed newInterestRateModel)
Emitted when a new interest rate model contract is set.
newInterestRateModel
address
New interest rate model address

SetPoolQuotaKeeper

event SetPoolQuotaKeeper(address indexed newPoolQuotaKeeper)
Emitted when a new pool quota keeper contract is set.
newPoolQuotaKeeper
address
New pool quota keeper address

SetTotalDebtLimit

event SetTotalDebtLimit(uint256 limit)
Emitted when a new total debt limit is set.
limit
uint256
New total debt limit

AddCreditManager

event AddCreditManager(address indexed creditManager)
Emitted when a new credit manager is connected to the pool.
creditManager
address
Credit manager address

SetCreditManagerDebtLimit

event SetCreditManagerDebtLimit(
    address indexed creditManager,
    uint256 newLimit
)
Emitted when a new debt limit is set for a credit manager.
creditManager
address
Credit manager address
newLimit
uint256
New debt limit

SetWithdrawFee

event SetWithdrawFee(uint256 fee)
Emitted when a new withdrawal fee is set.
fee
uint256
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.
token
address
Token address
priceFeed
address
Price feed address
stalenessPeriod
uint32
Staleness period in seconds
skipCheck
bool
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.
token
address
Token address
priceFeed
address
Reserve price feed address
stalenessPeriod
uint32
Staleness period in seconds
skipCheck
bool
Whether to skip staleness checks

Credit Configurator Events

AddCollateralToken

event AddCollateralToken(address indexed token)
Emitted when a token is made recognizable as collateral.
token
address
Token address

SetTokenLiquidationThreshold

event SetTokenLiquidationThreshold(
    address indexed token,
    uint16 liquidationThreshold
)
Emitted when a new collateral token liquidation threshold is set.
token
address
Token address
liquidationThreshold
uint16
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.
token
address
Token address
liquidationThresholdInitial
uint16
Initial liquidation threshold
liquidationThresholdFinal
uint16
Final liquidation threshold
timestampRampStart
uint40
Ramp start timestamp
timestampRampEnd
uint40
Ramp end timestamp

ForbidToken

event ForbidToken(address indexed token)
Emitted when a collateral token is forbidden.
token
address
Token address

AllowToken

event AllowToken(address indexed token)
Emitted when a previously forbidden collateral token is allowed.
token
address
Token address

AllowAdapter

event AllowAdapter(
    address indexed targetContract,
    address indexed adapter
)
Emitted when a new adapter and its target contract are allowed.
targetContract
address
Target contract address
adapter
address
Adapter address

ForbidAdapter

event ForbidAdapter(
    address indexed targetContract,
    address indexed adapter
)
Emitted when an adapter and its target contract are forbidden.
targetContract
address
Target contract address
adapter
address
Adapter address

UpdateFees

event UpdateFees(
    uint16 feeLiquidation,
    uint16 liquidationPremium,
    uint16 feeLiquidationExpired,
    uint16 liquidationPremiumExpired
)
Emitted when new fee parameters are set.
feeLiquidation
uint16
Liquidation fee in basis points
liquidationPremium
uint16
Liquidation premium in basis points
feeLiquidationExpired
uint16
Expired liquidation fee in basis points
liquidationPremiumExpired
uint16
Expired liquidation premium in basis points

SetPriceOracle

event SetPriceOracle(address indexed priceOracle)
Emitted when a new price oracle is set.
priceOracle
address
New price oracle address

SetCreditFacade

event SetCreditFacade(address indexed creditFacade)
Emitted when a new facade is connected.
creditFacade
address
New credit facade address

CreditConfiguratorUpgraded

event CreditConfiguratorUpgraded(address indexed creditConfigurator)
Emitted when the configurator contract is upgraded.
creditConfigurator
address
New credit configurator address

SetBorrowingLimits

event SetBorrowingLimits(
    uint256 minDebt,
    uint256 maxDebt
)
Emitted when new debt principal limits are set.
minDebt
uint256
Minimum debt
maxDebt
uint256
Maximum debt

SetMaxDebtPerBlockMultiplier

event SetMaxDebtPerBlockMultiplier(uint8 maxDebtPerBlockMultiplier)
Emitted when a new max debt per block multiplier is set.
maxDebtPerBlockMultiplier
uint8
New multiplier value

SetLossPolicy

event SetLossPolicy(address indexed lossPolicy)
Emitted when a new loss policy is set.
lossPolicy
address
New loss policy address

SetExpirationDate

event SetExpirationDate(uint40 expirationDate)
Emitted when a new expiration timestamp is set.
expirationDate
uint40
New expiration timestamp

Build docs developers (and LLMs) love