get https://sandbox.kyan.sh/account_state/
Retrieve the complete financial state for all margin accounts associated with an Ethereum address. This endpoint is essential for monitoring account health, risk management, and trading decisions.
No signature required - Only API key authentication is needed.
What This Endpoint Returns
For each margin account (one per trading pair), you'll receive:
Account Health Metrics:
equity: Total account value (collateral + unrealized P&L)im: Initial margin - minimum equity required to open new positionsmm: Maintenance margin - minimum equity required to avoid liquidationunrealised_pnl: Profit/loss on open positions at current mark prices
Position Details:
- All open positions with sizes, entry prices, and fees
- Current mark prices and Greeks for options
- Instrument-specific P&L calculations
Risk Indicators:
matrix_risk: Portfolio risk matrix componentdelta_risk: Delta risk componentroll_risk: Roll risk componentportfolio_greeks: Portfolio-level Greeks (delta, gamma, vega, theta, rho)
Additional Fields:
timestamp: Unix timestamp when state was calculatedmargin_account: Unique margin account IDpair: Trading pair for this margin account
Use Cases
- Risk Monitoring: Check if accounts are approaching liquidation
- Portfolio Management: View all positions and their current values
- Trading Decisions: Monitor risk metrics and margin requirements
- P&L Tracking: Monitor realized and unrealized profits/losses
Important Notes
- Accounts are isolated by trading pair (e.g., separate ETH_USDC and BTC_USDC accounts)
- All monetary values are in USDC with 6 decimal precision
- Mark prices are updated in real-time from the orderbook
- Greeks are calculated using the Black-Scholes model for options
