Skip to main content
Receive real-time updates on your account balance.
  • Topic: account_balance
  • Stream: Private (wss://api.ekiden.fi/ws/private)

Authenticate

Use authentication flow described in the Connect page.

Subscribe

{ "op": "subscribe", "args": ["account_balance"], "req_id": "204001" }
Ack:
{ "op": "subscribed", "args": ["account_balance"], "req_id": "204001" }

Events

Messages arrive with op: "event", topic: "account_balance", and data is an array of AccountBalance objects. Example:
{
	"op": "event",
	"topic": "account_balance",
	"server_ts_ms": 1731541800000,
	"data": [
		{
			"sub_account_address": "0xsubacct...",
			"account_type": "Trading",
			"equity": "1000000",
			"vault_balance": "1000000",
			"margin_balance": "950000",
			"available_balance": "925000",
			"accrued_interest": "0",
			"total_order_im": "25000",
			"total_position_im": "50000",
			"total_position_mm": "30000",
			"unrealised_pnl": "1000",
			"unrealized_funding": "-5",
			"realised_pnl_cum": "12345"
		}
	]
}
Field notes:
  • All numeric values are strings to preserve precision.
  • equity is account equity in USDC before collateral value ratio adjustments.
  • margin_balance / available_balance reflect amounts available for margin after collateral value ratio adjustments.

Fields

FieldTypeNotes
sub_account_addressstringSub-account address
account_typestringAccount type (e.g. Funding, Trading)
equitystringEquity (USDC)
vault_balancestringVault balance (USDC)
margin_balancestringMargin balance (USDC)
available_balancestringAvailable balance for new positions (USDC)
accrued_intereststringAccrued interest
total_order_imstringPre-occupied margin for orders (USDC)
total_position_imstringSum of initial margin across positions
total_position_mmstringSum of maintenance margin across positions
unrealised_pnlstringUnrealised PnL
unrealized_fundingstringAggregated unrealized funding (USDC)
realised_pnl_cumstringCumulative realised PnL
See schema details in AsyncAPI: AccountBalance.