Skip to main content

get_risk_grid

Function get_risk_grid 

Source
pub async fn get_risk_grid(
    __arg0: State<AppState>,
    __arg1: Query<RiskGridQuery>,
) -> Response
Expand description

Get extended risk grid for a wallet.

Returns detailed margin breakdown and scenario P&L for risk analysis. This is similar to Deribit’s risk grid endpoint.

The response includes:

  • equity: Executed PM equity = cash + executed option UPNL + executed perp UPNL
  • position_initial_margin: IM from executed positions only
  • position_maintenance_margin: MM threshold for liquidation
  • open_orders_initial_margin: Additional IM from open orders
  • scenarios: P&L under each SPAN scenario