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
- API key sent in the request header; never accepted as a query parameter.
x-api-keystringrequiredQuery parameters
- Filter to a protocol-native market variant.
market_variantstringResponse
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-10-25T01:25:14.107Z",
"long_usd": 60.5675166,
"short_usd": 60.61823235,
"total_usd": 121.18574895
},
{
"market": "AAVE-PERP",
"market_variant": "AAVE/USD[WSOL-USDC]",
"time": "2026-10-25T01:25:14.107Z",
"long_usd": 7679.444828496336,
"short_usd": 56.3210403406424,
"total_usd": 7735.765868836978
}
]
}Open interest history
GET
Open-interest time series per GMTrade market, with long/short split.
History depth
Starter · 30dPro · 90dPremium · Full
Headers
- API key sent in the request header; never accepted as a query parameter.
x-api-keystringrequiredQuery parameters
- Filter to a market. Results may aggregate protocol-native variants that share the market symbol.
- Aggregation bucket size.
- Inclusive window start as an RFC 3339 timestamp; defaults per endpoint.
- Exclusive window end as an RFC 3339 timestamp; defaults to the current time.
marketstringinterval5m | 15m | 1h | 4h | 1dfromstringtostringResponse
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-10-11T01:27:28.400Z",
"to": "2026-10-25T01:27:28.400Z",
"data": [
{
"time": "2026-10-11T01:00:00.000Z",
"long_usd": 104093127.6475564,
"short_usd": 100534988.23999952,
"total_usd": 204628115.88755587
},
{
"time": "2026-10-11T02:00:00.000Z",
"long_usd": 104087496.51341288,
"short_usd": 100535565.3704334,
"total_usd": 204623061.8838462
}
]
}