Dolomite Margin - Events
Dolomite's Core smart contracts emit events that make tracking system changes easy.
These events are all emitted by instances of DolomiteMargin on each network Dolomite is deployed. See smart contract addresses to discover the address of DolomiteMargin on each network.
Account Operation Events
These events are logged right after they occur within each Action of an Operation
BalanceUpdate
Struct
BalanceUpdate
StructDescription:
The BalanceUpdate
struct represents an update to an account's balance, including changes to both token amounts and principal amounts.
Struct Members:
deltaWei
(Types.Wei
): The change in token balance (Wei) for the account. Can be positive or negative.newPar
(Types.Par
): The new principal value for the account. Can be positive or negative.
Struct Signature:
LogOperation
Event
LogOperation
EventDescription:
This event is emitted at the start of an operation.
Event Signature:
sender
(address
): The address of the caller of DolomiteMargin who performed the operation.
LogDeposit
Event
LogDeposit
EventDescription:
This event is emitted when tokens are deposited into an account via a Deposit
Action.
Event Signature:
accountOwner
(address
): The owner of the account where the deposit occurred.accountNumber
(uint256
): The account number where the deposit occurred.market
(uint256
): The market identifier where the deposit occurred.update
(BalanceUpdate
): The balance update for the account as a result of the deposit.from
(address
): The address from which the deposit was made.
LogWithdraw
Event
LogWithdraw
EventDescription:
This event is emitted when tokens are withdrawn from an account via a Withdraw
Action.
Event Signature:
accountOwner
(address
): The owner of the account from which the withdrawal occurred.accountNumber
(uint256
): The account number from which the withdrawal occurred.market
(uint256
): The market identifier from which the withdrawal occurred.update
(BalanceUpdate
): The balance update for the account as a result of the withdrawal.to
(address
): The address to which the withdrawal was sent.
LogTransfer
Event
LogTransfer
EventDescription:
This event is emitted when a transfer of tokens occurs between two accounts via a Transfer
Action. Note this does not materialize an ERC20 transfer event since only virtual liquidity is transferred.
Event Signature:
accountOneOwner
(address
): The owner of the first account involved in the transfer.accountOneNumber
(uint256
): The account number of the first account involved in the transfer.accountTwoOwner
(address
): The owner of the second account involved in the transfer.accountTwoNumber
(uint256
): The account number of the second account involved in the transfer.market
(uint256
): The market identifier where the transfer occurred.updateOne
(BalanceUpdate
): The balance update for the first account as a result of the transfer.updateTwo
(BalanceUpdate
): The balance update for the second account as a result of the transfer.
LogBuy
Event
LogBuy
EventDescription:
This event is emitted when a Buy
Action occurs, representing a trade where one account purchases tokens via an exchange wrapper contract. Mechnically, this Action is similar to Uniswap's swapTokensForExactTokens
.
Event Signature:
accountOwner
(address
): The owner of the account that performed the buy operation.accountNumber
(uint256
): The account number that performed the buy operation.takerMarket
(uint256
): The market identifier for the taker's (buyer's) side of the trade (theinputMarket
).makerMarket
(uint256
): The market identifier for the maker's (seller's) side of the trade (theoutputMarket
).takerUpdate
(BalanceUpdate
): The balance update for the taker's account as a result of the buy.makerUpdate
(BalanceUpdate
): The balance update for the maker's account as a result of the buy.exchangeWrapper
(address
): The address of the exchange wrapper contract involved in the buy action.
LogSell
Event
LogSell
EventDescription:
This event is emitted when a Sell
Action occurs, representing a trade where one account sells tokens via an exchange wrapper contract. Mechanically, this Action is similar to Uniswap's swapExactTokensForTokens
.
Event Signature:
accountOwner
(address
): The owner of the account that performed the sell operation.accountNumber
(uint256
): The account number that performed the sell operation.takerMarket
(uint256
): The market identifier for the taker's (seller's) side of the trade (theinputMarket
).makerMarket
(uint256
): The market identifier for the maker's (buyer's) side of the trade (theoutputMarket
).takerUpdate
(BalanceUpdate
): The balance update for the taker's account as a result of the sell.makerUpdate
(BalanceUpdate
): The balance update for the maker's account as a result of the sell.exchangeWrapper
(address
): The address of the exchange wrapper contract involved in the sell action.
LogTrade
Event
LogTrade
EventDescription:
This event is emitted when a Trade
Action occurs between a taker and a maker account using an auto-trader contract.
Event Signature:
takerAccountOwner
(address
): The owner of the taker account involved in the trade.takerAccountNumber
(uint256
): The account number of the taker account involved in the trade.makerAccountOwner
(address
): The owner of the maker account involved in the trade. ThemakerAccountOwner
is the address that approved the trade for the auto-trader contract.makerAccountNumber
(uint256
): The account number of the maker account involved in the trade.inputMarket
(uint256
): The market identifier for the input tokens of the trade.outputMarket
(uint256
): The market identifier for the output tokens of the trade.takerInputUpdate
(BalanceUpdate
): The balance update for the taker's input tokens as a result of the trade.takerOutputUpdate
(BalanceUpdate
): The balance update for the taker's output tokens as a result of the trade.makerInputUpdate
(BalanceUpdate
): The balance update for the maker's input tokens as a result of the trade.makerOutputUpdate
(BalanceUpdate
): The balance update for the maker's output tokens as a result of the trade.autoTrader
(address
): The address of the auto-trader contract used for the trade.
LogCall
Event
LogCall
EventDescription:
This event is emitted when a Call
Action occurs.
Event Signature:
accountOwner
(address
): The owner of the account that initiated the call.accountNumber
(uint256
): The account number of the account owner that initiated the call.callee
(address
): The address of the contract that was called.
LogLiquidate
Event
LogLiquidate
EventDescription:
This event is emitted when a Liquidate
Action occurs, representing the process of one account liquidating another account's under-collateralized position.
Event Signature:
solidAccountOwner
(address
): The owner of the account performing the liquidation.solidAccountNumber
(uint256
): The account number of the account performing the liquidation.liquidAccountOwner
(address
): The owner of the account being liquidated.liquidAccountNumber
(uint256
): The account number of the account being liquidated.heldMarket
(uint256
): The market identifier for the held (collateral) tokens.owedMarket
(uint256
): The market identifier for the owed (borrowed) tokens.solidHeldUpdate
(BalanceUpdate
): The balance update for the held tokens of the account performing the liquidation.solidOwedUpdate
(BalanceUpdate
): The balance update for the owed tokens of the account performing the liquidation.liquidHeldUpdate
(BalanceUpdate
): The balance update for the held tokens of the account being liquidated.liquidOwedUpdate
(BalanceUpdate
): The balance update for the owed tokens of the account being liquidated.
LogVaporize
Event
LogVaporize
EventDescription:
This event is emitted when a Vaporize
Action occurs, representing the process of a solid account using the admin's excess tokens to cover a vapor account's bad debt. A position's debt is considered to be bad if there is no held value (balance == 0
) but there is still debt held in the position.
Event Signature:
solidAccountOwner
(address
): The owner of the solid account from which the vaporization occurred.solidAccountNumber
(uint256
): The account number of the solid account from which the vaporization occurred.vaporAccountOwner
(address
): The owner of the vapor account that has bad debtvaporAccountNumber
(uint256
): The account number of the vapor account has bad debtheldMarket
(uint256
): The market identifier for the held (collateral) tokens.owedMarket
(uint256
): The market identifier for the owed (borrowed) tokens.solidHeldUpdate
(BalanceUpdate
): The balance update for the held tokens of the solid account.solidOwedUpdate
(BalanceUpdate
): The balance update for the owed tokens of the solid account.vaporOwedUpdate
(BalanceUpdate
): The balance update for the owed tokens of the vaporized account.
LogOperatorSet
Event
LogOperatorSet
EventDescription:
This event is emitted when an account adds or removes another contract (or account) as an operator for itself.
Event Signature:
owner
(address
): The owner of the account for which the operator status was updated.operator
(address
): The address of the operator whose status was updated.trusted
(bool
): The new status of the operator.true
indicates the operator is trusted, whilefalse
indicates the operator is untrusted.
Market Events
LogIndexUpdate
Event
LogIndexUpdate
EventDescription:
This event is emitted when an interest index is updated for a specific market, indicating a change in the accrued borrow and supply values, as well as possibly a change in the borrow and supply rates. The interest index is updated, at-most, once per block. This event is emitted at the start of an Operation, before the Actions are processed.
Event Signature:
market
(uint256
): The identifier of the market for which the interest index was updated.
LogOraclePrice
Event
LogOraclePrice
EventDescription:
This event is emitted when an oracle price is retrieved for a specific market at the start of an Operation, before the Actions are processed. It specifies to data indexers and block explorers what the USD value of a market was during an Operation.
Event Signature:
market
(uint256
): The identifier of the market for which the oracle price was updated.price
(Monetary.Price
): The oracle price for the market during an Operation. Prices have36 - token.decimals
decimals, meaning a value of1000000000000000000000000000000
corresponds with $1.00 for USDC (USDC has 6 decimals of precision).
Last updated