Skip to main content
GET
/
v1
/
orderbook
/
fetch_orderbook_stats
Fetch orderbook stats
curl --request GET \
  --url https://github.com/openpx-trade/openpx/v1/orderbook/fetch_orderbook_stats
{
  "ask_depth": 123,
  "asset_id": "<string>",
  "bid_depth": 123,
  "openpx_ts": "2023-11-07T05:31:56Z",
  "best_ask": 123,
  "best_bid": 123,
  "exchange_ts": "2023-11-07T05:31:56Z",
  "imbalance": 123,
  "mid": 123,
  "spread_bps": 123,
  "weighted_mid": 123
}
Snapshot stats: top-of-book, mid, spread (bps), size-weighted mid, top-10 imbalance, and total depth.

Query Parameters

asset_id
string
required

Response

Success.

Top-of-book snapshot stats for one asset.

ask_depth
number<double>
required

Total resting ask size in contracts (e.g. 1000.0).

asset_id
string
required

Orderable asset id (e.g. "KXBTCD-25APR1517").

bid_depth
number<double>
required

Total resting bid size in contracts (e.g. 1000.0).

openpx_ts
string<date-time>
required

Wall-clock time OpenPX served the response (UTC).

best_ask
number<double> | null

Best ask as YES probability (e.g. 0.63).

best_bid
number<double> | null

Best bid as YES probability (e.g. 0.61).

exchange_ts
string<date-time> | null

Upstream snapshot time in UTC; null when not provided.

imbalance
number<double> | null

Top-10 imbalance in [-1, 1] (positive = bid-heavy) (e.g. 0.12).

mid
number<double> | null

Mid price as YES probability (e.g. 0.62).

spread_bps
number<double> | null

Spread in basis points relative to mid (e.g. 400.0).

weighted_mid
number<double> | null

Size-weighted mid using the top-10 levels (e.g. 0.62).