Event Subscription
Events can be monitored using theEventSubscriber:
User Events
NewUserRecord
Emitted when a new user account is created.
ts- Unix timestampuser_authority- The authority (owner) of the user accountuser- The user account addresssub_account_id- Sub-account ID (0-65535)name- User-assigned name for the accountreferrer- Referrer’s authority address
Deposit/Withdrawal Events
DepositRecord
Emitted for deposits and withdrawals.
direction-DepositorWithdrawamount- Amount deposited/withdrawn (native token precision)market_index- Spot market indexexplanation- Reason for the deposit/withdrawal
Order Events
OrderRecord
Emitted when an order is placed.
OrderActionRecord
Emitted when an order action occurs (fill, cancel, etc.).
action- Type of action (Fill, Cancel, etc.)taker- User taking the ordermaker- User making liquiditytaker_fee- Fee paid by takermaker_fee- Fee paid by maker (can be negative = rebate)
Funding Events
FundingPaymentRecord
Emitted when a user pays or receives funding.
funding_payment- Amount paid (negative) or received (positive)base_asset_amount- Position size
FundingRateRecord
Emitted when funding rate is updated for a market.
Liquidation Events
LiquidationRecord
Emitted when a user is liquidated.
liquidation_type- Type of liquidationuser- User being liquidatedliquidator- User performing liquidationbankrupt- Whether user was bankruptedmargin_freed- Amount of margin freed
Settlement Events
SettlePnlRecord
Emitted when PnL is settled.
LP Events
LPRecord
Emitted for LP actions (add/remove liquidity).
action-AddLiquidityorRemoveLiquidityn_shares- Number of LP sharespnl- PnL from LP position