Reference

Open interest

Current snapshot and historical time series of open interest per protocol.

Current open interest

GET
Current open interest per GMTrade market: total, long, and short notional from the latest snapshot.
Headers
x-api-keystringrequired
API key sent in the request header; never accepted as a query parameter.
Query parameters
market_variantstring
Filter to a protocol-native market variant.
Response
200
{ data: Snapshot[] }
Snapshot
market_variantProtocol-native market variant identifier; null when unavailable.
marketMarket symbol (e.g. SOL-PERP).
timeTimestamp of the snapshot.
long_usdLong open interest (USD notional).
short_usdShort open interest (USD notional).
total_usdTotal open interest (USD notional).
Request
cURL
curl --request GET \
  --url https://api.perpdb.xyz/v1/gmtrade/open-interest \
  --header 'x-api-key: ak_...'
Example
{
  "data": [
    {
      "market": "AAPL-PERP",
      "market_variant": "AAPL/USD[USDC]",
      "time": "2026-08-15T23:35:49.694Z",
      "long_usd": 60.5675166,
      "short_usd": 60.61823235,
      "total_usd": 121.18574895
    },
    {
      "market": "AAVE-PERP",
      "market_variant": "AAVE/USD[WSOL-USDC]",
      "time": "2026-08-15T23:35:49.694Z",
      "long_usd": 107311.39996617615,
      "short_usd": 118648.65095459098,
      "total_usd": 225960.05092076713
    }
  ]
}

Open interest history

GET
Open-interest time series per GMTrade market, with long/short split.
History depth
Starter · 30dPro · 90dPremium · Full
Headers
x-api-keystringrequired
API key sent in the request header; never accepted as a query parameter.
Query parameters
marketstring
Filter to a market. Results may aggregate protocol-native variants that share the market symbol.
interval5m | 15m | 1h | 4h | 1d
Aggregation bucket size.
fromstring
Inclusive window start as an RFC 3339 timestamp; defaults per endpoint.
tostring
Exclusive window end as an RFC 3339 timestamp; defaults to the current time.
Response
200
{ interval, from, to, data: Bucket[] }
Bucket
timeStart of the aggregation bucket.
long_usdLong open interest at the end of the bucket (USD notional).
short_usdShort open interest at the end of the bucket (USD notional).
total_usdTotal open interest at the end of the bucket (USD notional).
Request
cURL
curl --request GET \
  --url https://api.perpdb.xyz/v1/gmtrade/open-interest/history?market=SOL-PERP&interval=1h \
  --header 'x-api-key: ak_...'
Example
{
  "interval": "1h",
  "from": "2026-08-01T23:38:58.788Z",
  "to": "2026-08-15T23:38:58.788Z",
  "data": [
    {
      "time": "2026-08-01T23:00:00.000Z",
      "long_usd": 33568416.10226195,
      "short_usd": 36042602.32114684,
      "total_usd": 69611018.42340879
    },
    {
      "time": "2026-08-02T00:00:00.000Z",
      "long_usd": 33574843.741315156,
      "short_usd": 36015549.41924346,
      "total_usd": 69590393.1605586
    }
  ]
}