Open interest and funding rate
1Open interest and funding rate
Minute bars of open interest in USD, coins or the exchange native unit; funding rate per minute and the funding events; long/short ratio in 5‑minute buckets; mark and index by seconds and minutes.
Only perpetual contracts: market = perp. Exchanges: binance, bybit, okx, bitget, gate, mexc, bingx, kucoin, hyperliquid, aster, kraken, coinbase. The long/short and mark and index endpoints use their own sets of exchanges — those are listed in the corresponding sections.
Open interest
/v1/oiMinute bars of open interest: open, high, low and close of the minute. Rate-limit group — oi.
| Параметр | Что |
|---|---|
instrument |
required, perps only |
from |
start, ms. Default — 24 hours before to |
to |
end, ms, exclusive |
unit |
usd (default), coins or native — as the exchange: coins, contracts or dollars |
cursor |
cursor from next_cursor |
curl -s "https://market-api.lootx.trade/v1/oi?instrument=bybit:perp:ETHUSDT&unit=usd&from=1793750400000&to=1793750520000" \
-H "Authorization: Bearer $LOOTX_API_KEY"{
"instrument": "bybit:perp:ETHUSDT",
"tf": "1m",
"columns": ["ts", "open", "high", "low", "close"],
"rows": [
[1793750400000, 1843204551.12, 1843990120.4, 1842871003.57, 1843511876.03],
[1793750460000, 1843511876.03, 1844102233.9, 1843300418.65, 1843877021.18]
],
"next_cursor": null
}ts — start of the minute. A page covers up to a week of minutes; use the cursor for longer ranges.
Funding rate
/v1/fundingThe funding rate as each exchange reported it each minute, with the next funding timestamp where the exchange provides it (for Hyperliquid, MEXC, Kraken and Coinbase next_funding_ts is null). Rate-limit group — funding.
| Параметр | Что |
|---|---|
instrument |
required |
from, to, cursor |
window and cursor |
{
"instrument": "binance:perp:BTCUSDT",
"tf": "1m",
"columns": ["ts", "rate", "next_funding_ts", "interval_hours"],
"rows": [[1793750400000, 0.0001, 1793779200000, 8]],
"next_cursor": null
}rate— the fraction for the exchange payout period:0.0001= 0.01% for 8 hours;interval_hours— payout interval as reported by the source.
Funding events
/v1/funding/eventsTimestamps when funding was applied: which rate was used and the mark price at application. Same rate-limit group funding.
| Параметр | Что |
|---|---|
instrument |
required, perps only |
from |
start, ms. Default — 30 days before to |
to |
end, ms, exclusive |
cursor |
cursor from next_cursor |
curl -s "https://market-api.lootx.trade/v1/funding/events?instrument=binance:perp:BTCUSDT" \
-H "Authorization: Bearer $LOOTX_API_KEY"{
"instrument": "binance:perp:BTCUSDT",
"columns": ["t", "rate", "mark_price"],
"rows": [
[1793721600000, 0.00009249, null],
[1793721600006, 0.00009208, 104012.4],
[1793750400000, 0.000072, 104250.5]
],
"next_cursor": null
}mark_price is populated only by Binance; for other exchanges it is null. (Binance may also include a null in the duplicate applied row — see above.) To compute your own payments multiply the rate by the position notional at the funding moment: amounts are not rounded to the price tick by us, and you should not round them either.
Long/Short ratio
/v1/ls-ratioLong vs short shares and taker volume in 5‑minute buckets as published by the exchange. Rate-limit group — ls_ratio.
| Параметр | Что |
|---|---|
instrument |
required, perps only. Rows exist for binance (global_account, top_account, top_position, taker_volume), bybit (global_account) and okx (the same four plus global_account_ccy); for other open interest exchanges the response is empty |
kind |
series kind: global_account, top_account, top_position, taker_volume, global_account_ccy. Default — all. Any other value returns 400 bad_request with param: "kind" |
from |
start, ms, by ts. Default — 24 hours before to |
to |
end, ms, exclusive |
cursor |
cursor from next_cursor |
Values from different venues do not sum: instruments= with two or more instruments returns 400 bad_request; request each venue with its own instrument.
curl -s "https://market-api.lootx.trade/v1/ls-ratio?instrument=binance:perp:BTCUSDT&from=1793278200000&to=1793278500000" \
-H "Authorization: Bearer $LOOTX_API_KEY"{
"instrument": "binance:perp:BTCUSDT",
"tf": "5m",
"columns": ["ts", "as_of", "kind", "long_ratio", "short_ratio", "long_short_ratio", "buy_vol", "sell_vol", "unit"],
"rows": [
[1793278200000, 1793278200000, "global_account", 0.6849, 0.3151, 2.1736, null, null, null],
[1793278200000, 1793278500000, "taker_volume", null, null, 1.1138, "82.8880", "74.4160", "base"],
[1793278200000, 1793278200000, "top_account", 0.6982, 0.3018, 2.3135, null, null, null],
[1793278200000, 1793278200000, "top_position", 0.6774, 0.3226, 2.0995, null, null, null]
],
"next_cursor": null
}| Column | What |
|---|---|
ts |
the exchange bucket (bucket_ts), ms. Rows are ordered by ts, and within the same ts by kind |
as_of |
the moment the value refers to, ms. For Binance global_account, top_account, top_position and for Bybit global_account this equals ts: the snapshot at that timestamp. For Binance taker_volume and for all OKX kinds it is ts + 5 minutes: the value for the interval [ts, ts + 5 min). For other pairs it is ts. Align rows from different exchanges and kinds by as_of |
long_ratio, short_ratio |
fractions of longs and shorts, unitless: 0.6849 = 68.49% |
long_short_ratio |
ratio of longs to shorts; for taker_volume it is taker buys / taker sells |
buy_vol, sell_vol |
taker buy and sell volume for the bucket — string, exact decimal from the exchange, in the unit. Present only for taker_volume |
unit |
unit for buy_vol and sell_vol: base — coins. Null for other kinds |
If the exchange does not publish a field it is null: OKX, for example, may only supply long_short_ratio without the separate shares. Exchanges may append to the last bucket after it ends: re-read the last ~10 minutes. Windows longer than a week are truncated by the gateway and next_cursor is returned; a page contains up to 10,000 rows, and rows for a single ts are kept together on one page.
/v1/ls-ratio/latestThe latest row for each kind — or the latest row of the specified kind — within 35 days. Same rate-limit group ls_ratio, same columns, next_cursor is null.
| Параметр | Что |
|---|---|
instrument |
required, perps only |
kind |
kind as in /v1/ls-ratio. Default — all |
{
"instrument": "binance:perp:BTCUSDT",
"tf": "5m",
"columns": ["ts", "as_of", "kind", "long_ratio", "short_ratio", "long_short_ratio", "buy_vol", "sell_vol", "unit"],
"rows": [
[1793279100000, 1793279100000, "global_account", 0.684, 0.316, 2.1646, null, null, null],
[1793278800000, 1793279100000, "taker_volume", null, null, 2.9092, "786.2880", "270.2730", "base"],
[1793279100000, 1793279100000, "top_account", 0.6978, 0.3022, 2.3091, null, null, null],
[1793279100000, 1793279100000, "top_position", 0.6779, 0.3221, 2.1047, null, null, null]
],
"next_cursor": null
}Each kind has its own latest row and their ts values may differ, as taker_volume in the example. If there is no row within 35 days the endpoint returns 404 not_found; if a series went silent earlier, fetch it with /v1/ls-ratio and a time window.
Mark and index
/v1/markMark price (mark) and index price (index) for a perp by seconds or minutes. The rate-limit group depends on the step: tf=1m — mark, tf=1s — mark_1s.
| Параметр | Что |
|---|---|
instrument |
required, perps only: binance, bybit, okx, bitget, gate, hyperliquid, mexc, kraken, lighter, aster. Other venues return 400 unsupported_instrument |
tf |
1s — seconds, stored 7 days; 1m — minutes, no retention. Default 1m. Any other step returns 400 bad_request with param: "tf": aggregate coarser than a minute yourself |
from |
start, ms, by ts. Default — 24 hours before to, for 1s default is 1 hour |
to |
end, ms, exclusive. Default — now; if to is in the future the gateway shifts it to “now” |
cursor |
cursor from next_cursor |
curl -s "https://market-api.lootx.trade/v1/mark?instrument=binance:perp:BTCUSDT&tf=1m&from=1794531600000&to=1794531720000" \
-H "Authorization: Bearer $LOOTX_API_KEY"{
"instrument": "binance:perp:BTCUSDT",
"tf": "1m",
"columns": ["ts", "mark_open", "mark_high", "mark_low", "mark_close", "index_close", "premium", "secs"],
"rows": [
[1794531600000, "71111.39908546", "71137.9", "71045.18452774", "71045.18452774", "71084.41304348", -0.0005518581931035318, 60],
[1794531660000, "71044.18909295", "71044.18909295", "70970.4", "71007.3", "71051.90695652", -0.0006278080129122655, 60]
],
"next_cursor": null
}| Column | What |
|---|---|
ts |
start of the second or minute, ms |
mark (1s); mark_open, mark_high, mark_low, mark_close (1m) |
mark price in quote currency — string, exact decimal from the exchange |
index (1s), index_close (1m) |
index price, string like mark. null if the exchange does not provide it. For Hyperliquid this is the oracle price (oraclePx) |
premium |
mark / index − 1 (for 1m computed on the minute close): unitless fraction. null if no index |
secs |
only for 1m: how many seconds within the minute had a value, 1…60 |
Prices arrive as strings to preserve precision: keep them as strings or a decimal type, not float, and do not round to the price tick.
- Seconds with no row carry the previous value: the exchange sends only changes. Propagate the last known value.
- The in‑progress minute is not returned by
1m— render it from seconds. - Seconds older than 7 days are not stored: a
tf=1swindow entirely outside storage returns400 bad_requestwithparam: "from"; a partially outside window will havefrompulled forward to the storage boundary. - Pages. A
1swindow longer than an hour or a1mwindow longer than a week is truncated by the gateway andnext_cursoris returned; a page contains up to 10,000 rows. At the live edge (timestamps newer than ~2 minutes ago) there is no cursor: start the next request from the last received row.
Prices from multiple venues do not compose: instruments= with two or more instruments returns 400 bad_request.
/v1/mark/latestThe latest second of mark and index within 7 days: a single row with tf=1s columns. Rate-limit group — mark.
| Параметр | Что |
|---|---|
instrument |
required, a perp on one of the exchanges listed in /v1/mark |
{
"instrument": "binance:perp:BTCUSDT",
"tf": "1s",
"columns": ["ts", "mark", "index", "premium"],
"rows": [[1794534182000, "70906.31457271", "70933.00695652", -0.00037630413477835085]],
"next_cursor": null
}If there is no second within 7 days the endpoint returns 404 not_found. The source may not yet have written the most recent ~3 seconds, so there is no point polling faster than once per second.
https://docs.lootx.trade/en/market-api/oi-funding