Account State

account_state Channel

Track account state changes including margin requirements, PnL, equity, and portfolio Greeks.

Subscribe

ParameterRequiredDescription
accountYesEOA or Smart account address (42 characters with 0x prefix)
pairNoTrading pair (e.g., "BTC_USDC"). If omitted, returns updates for all pairs.
{
  "channel": "account_state",
  "query": {
    "account": "0x1234567890abcdef1234567890abcdef12345678",
    "pair": "BTC_USDC"
  }
}

Event: account_state

{
  "kind": "event",
  "type": "account_state",
  "timestamp_ms": 1677721600000,
  "data": {
    "timestamp": 1677721600000,
    "margin_account": 12345,
    "pair": "BTC_USDC",
    "im": 5000.0,
    "mm": 2500.0,
    "matrix_risk": 1200.0,
    "delta_risk": 800.0,
    "roll_risk": 300.0,
    "unrealised_pnl": 1500.0,
    "equity": 15000.0,
    "portfolio_greeks": {
      "delta": 0.45,
      "gamma": 0.0012,
      "vega": 125.3,
      "theta": -45.5,
      "rho": 85.2
    },
    "liquidation": false
  },
  "subscription": {
    "channel": "account_state",
    "query": {
      "account": "0x1234567890abcdef1234567890abcdef12345678"
    }
  }
}
FieldTypeDescription
timestampnumberEvent timestamp in milliseconds
margin_accountnumberMargin account identifier
pairstringTrading pair (e.g., "BTC_USDC", "ETH_USDC")
imnumberInitial margin requirement
mmnumberMaintenance margin requirement
matrix_risknumberMatrix-based risk value
delta_risknumberDelta risk exposure
roll_risknumberRoll risk value
unrealised_pnlnumberUnrealized profit/loss
equitynumberTotal account equity
portfolio_greeksobjectAggregate Greeks (delta, gamma, vega, theta, rho)
liquidationbooleanWhether the account is in liquidation state

For real-time position data with mark prices and per-position Greeks, subscribe to the position channel.

Related channels

ChannelWhy
PositionPer-position breakdown of what drives account state — individual mark prices, sizes, and Greeks that aggregate into the portfolio view here.
TradeFills change margin, equity, and PnL. Watch trade events to understand what triggered an account state update.
OrderbookOrder lifecycle events. Resting orders consume margin (im). Cancellations free it.
Index PriceDrives mark-to-market. Index price changes shift unrealised_pnl and equity.
IV (SVI)Vol surface changes affect options mark prices, which flow into portfolio_greeks and matrix_risk.
Account LiquidationWhen liquidation: true appears in account state, the liquidation channel provides details on the process.