User account is the primary account structure for a Drift trading account. It contains all spot and perp positions, active orders, and user-specific settings.
Account Structure
The wallet address that owns and controls this user account
Optional delegate address that can execute trades on behalf of the user
Human-readable name for the sub-account (32-byte array)
Array of up to 8 spot market positions
Array of up to 8 perpetual market positions
Array of up to 32 active orders
Timestamp of the last time perp LP shares were added
Cumulative lifetime deposits into this account
Cumulative lifetime withdrawals from this account
Cumulative social loss absorbed by this account
Total settled perpetual PnL
Cumulative fees paid on spot trades
Cumulative funding payments (positive = received, negative = paid)
Amount of margin freed through liquidations
Slot number when the account was last active
The next order ID to be assigned
Maximum custom margin ratio for this account
The next liquidation ID to be assigned
Sub-account identifier (allows multiple accounts per authority)
Current account status (active, liquidating, etc.)
Whether margin trading is enabled for this account
Whether the account is currently idle (no open positions or orders)
Number of currently open orders
Quick flag indicating if there are any open orders
Number of currently open auctions
Quick flag indicating if there are any open auctions
The margin mode for this account (Cross or Isolated)
Associated liquidity pool ID
Timestamp of the last fuel bonus update