Genesis Arbitrage

Genesis Arbitrage · · 14 min read

Open interest API: futures OI across exchanges and how to read it

In short

  • Open interest is the volume of futures positions that are still open. Counted in coins, it shows positions flowing in; counted in dollars, it also moves with the price.
  • Every exchange publishes OI in its own format and units. In Genesis API a single /market/open-interest call covers 13+ exchanges, with the sum in total, the breakdown in exchanges, and OI and price changes over 5, 15 and 30 minutes and 1 hour, on every plan.
  • Read with price and funding, OI shows who is building positions and who pays to hold them. It does not predict the price; the decision and the trade on the exchange stay with you.

An open interest API returns, for each coin, the volume of open futures positions, in coins and in dollars, per exchange and in total, along with how it changed over the last minutes and hours. Exchanges publish OI for their own contracts through their own APIs, and the formats differ from one exchange to the next. In Genesis API the whole snapshot comes from one call to /market/open-interest: 13+ futures exchanges, including Binance, Bybit, OKX, Bitget and Gate, with OI and price changes over 5, 15 and 30 minutes and 1 hour, on every plan, starting with Trial at $20 a month.

What open interest is

Open interest (OI) is the total of positions on a futures contract that are open and not yet closed. Every contract has two sides, a long and a short, and OI counts one of them: one trader buys 1 BTC long, another sells 1 BTC short, and open interest grows by 1 BTC.

OI rises when both sides of a trade open positions, falls when both close, and stays flat when a position passes from one trader to another. So rising OI means new positions are coming in, and falling OI means positions are being closed, voluntarily or by force.

OI in coins and in dollars

Exchanges report OI in contracts, in coins or directly in dollars, and coins are converted to dollars at the price. In the Genesis API sample response, ByBit's oi_usd for GRAM equals oi_tokens times price: 16,159,003.8 × 1.6609 = 26,838,489.41.

The dollar figure is handy for comparing coins and exchanges, but it moves with the price. Illustrative example: an exchange has 2,000,000 coins in open positions at $1.50, so OI is 2,000,000 × $1.50 = $3,000,000. An hour later the positions are unchanged, the price is $1.65, and dollar OI is already 2,000,000 × $1.65 = $3,300,000, up 10% without a single new position.

Total OI and the per-exchange breakdown

A coin's total OI adds up OI on the exchanges that list its futures and shows how much money the market holds in positions. The breakdown shows where that money sits: in the same response ByBit holds 26,838,489.41 / 96,544,685.3 × 100 = 27.8% of GRAM's dollar OI.

MeasureWhat it showsThe catch
OI in coinsHow many positions are openContract sizes differ by exchange
OI in dollarsHow much money is in positionsMoves with the price
Total OIPositions across the marketDepends on which exchanges are summed
OI per exchangeWhere positions are being builtExchange methods differ

What the Binance, Bybit, OKX and Hyperliquid APIs return

Each exchange publishes OI for its contracts through its own API. Here is what the official documentation says:

ExchangeCurrent OIOI historyWatch out for
BinanceGET /fapi/v1/openInterest, one symbol per requestGET /futures/data/openInterestHistHistory covers the latest month only
BybitGET /v5/market/tickers, all symbols in one requestGET /v5/market/open-interest, steps from 5min to 1dopenInterest counts both sides, singleOpenInterest one
OKXGET /api/v5/public/open-interestGET /api/v5/rubik/stat/contracts/open-interest-historyoi in contracts, oiCcy in coins, oiUsd in dollars
HyperliquidPOST /info, type metaAndAssetCtxsNot in the docsOI for perpetual futures in one request

The details are in the Binance, Bybit, OKX and Hyperliquid docs. Binance history comes as sumOpenInterest and sumOpenInterestValue, while OKX returns the latest 1,440 entries in steps from 5 minutes. Hyperliquid takes a request to https://api.hyperliquid.xyz/info with the body {"type": "metaAndAssetCtxs"} and returns openInterest for each perpetual next to markPx and funding.

The difference in method can be twofold. In Bybit's sample /v5/market/open-interest response, openInterest is 63,910,691 and singleOpenInterest is 31,955,346, exactly half: the first counts both sides, the second counts one, as in the OI definition above.

Building one snapshot yourself means polling each exchange by its own rules, converting contracts to coins and coins to dollars, and staying within every venue's limits. On Binance that takes a separate request for each contract.

Open interest in Genesis API: /market/open-interest

The /market/open-interest endpoint returns the same data as the OI Tracking table on the site: total OI per coin in total and the per-exchange breakdown in exchanges. Without parameters you get every coin; coin keeps one coin, and exchange keeps the selected exchanges, comma-separated for several.

curl -G "https://api.genesisarbitrage.com/v1/market/open-interest" \
  -d coin=GRAM \
  -H "X-API-Key: gns_live_XXXXXXXXXXXXXXXX"

The response is a data array. Below is one of its elements from the docs, with some fields cut:

{
  "coin": "GRAM",
  "total": {
    "oi_usd": 96544685.3,
    "oi_tokens": 58105803.3,
    "avg_price": 1.661224,
    "volume_24h": 47010004.63,
    "oi_change_5m": 0.0196,
    "oi_change_1h": 0.3185,
    "price_change_5m": -0.0228,
    "price_change_1h": -0.1929,
    …
  },
  "exchanges": {
    "ByBit": {
      "price": 1.6609,
      "oi_usd": 26838489.41,
      "oi_tokens": 16159003.8,
      "oi_change_1h": -0.097,
      "price_change_1h": -0.1683,
      "trade_url": "https://www.bybit.com/trade/usdt/GRAMUSDT",
      …
    }
  }
}
FieldMeaning
total.oi_usd / total.oi_tokensTotal OI in dollars and in coins
total.avg_priceAverage coin price across exchanges
total.volume_24h24h volume, USD
total.oi_change_5m/15m/30m/1hOI change over 5, 15 and 30 minutes and 1 hour, %
total.price_change_5m/15m/30m/1hPrice change over the same intervals, %
exchanges{}The same metrics per exchange: price instead of avg_price, plus trade_url

Changes are percentages: 0.3185 means 0.3185%. Empty values arrive as null, so skip them. Freshness depends on the plan: 60 s on Trial, 30 s on Start, 10 s on Pro and 5 s on Max, so polling more often than meta.freshness_sec gains nothing.

An unfiltered response carries an ETag header. Send it back in If-None-Match, and an unchanged snapshot comes back as a 304, which does not use your quota; the mechanics are explained in ETag and If-None-Match. The exchange filter narrows only exchanges: total is still computed across all exchanges.

Fields, parameters and the "Try it" form are in the "OI Tracking" docs section. All market endpoints are walked through with examples in the Genesis API market data guide.

Reading OI with price: four scenarios

Rising OI tells you positions are opening, but not which side is driving. The price over the same interval gives the hint.

PriceOIUsual readingWhat to check
UpUpNew positions in the direction of the move, the rally is backed by moneyFunding: strongly positive means longs are crowded
DownUpShorts are building, or longs are buying into the dropFunding: strongly negative means short squeeze risk
UpDownThe rally runs on short covering, no new moneyWhether OI falls on every exchange
DownDownLongs are closing, by choice or by forceOI collapsing within 5 minutes points to liquidations

In the docs example, GRAM's total OI rose 0.32% in an hour while the price fell 0.19%, which formally puts it in the second row. Fractions of a percent per hour are ordinary noise, though: read the scenarios on clear moves and on coins with large OI.

OI and funding: who holds positions and who pays for them

The funding rate shows which side of perpetual futures pays the other, and OI shows how many positions are open. Together they show both which way the market leans and how heavily leveraged it is.

Rising OI and price with a strongly positive rate means longs are adding positions and paying shorts to hold them. If the price turns, their liquidations speed up the fall. Rising OI and price with a negative rate means shorts are building against the move, and a sharp rally can close them by force.

Every combination of funding, OI and price is laid out in The funding rate as a market indicator. In Genesis API, /funding/rates returns every exchange's rate, also on every plan: the rate per funding interval (funding_pct) and the rate normalized to 8 hours (funding_8h_pct). The funding endpoints and settled-funding history are covered in Funding rate API, and the fields in the docs.

Python: OI up more than 5% in an hour while price rises

The script pulls the whole snapshot in one call and keeps coins whose total OI grew more than 5% in an hour while the price rose, with OI itself at $5M or more. For each one it prints the per-exchange breakdown: the exchange's share of OI and its OI and price changes over the hour. The key comes from the GENESIS_API_KEY environment variable; on 429 and 503 the script waits Retry-After seconds and retries.

import os
import time
import requests

API = "https://api.genesisarbitrage.com/v1"
HEADERS = {"X-API-Key": os.environ["GENESIS_API_KEY"]}
MIN_OI_USD = 5_000_000  # on small OI one position moves it a lot

def get(path, **params):
    while True:
        r = requests.get(API + path, headers=HEADERS,
                         params=params, timeout=15)
        if r.status_code in (429, 503):  # rate limit or data rebuild
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json()["data"]

def passes(t):
    oi, px = t.get("oi_change_1h"), t.get("price_change_1h")
    if oi is None or px is None:
        return False
    return (t.get("oi_usd") or 0) >= MIN_OI_USD and oi > 5 and px > 0

def pct(v):
    return "n/a" if v is None else f"{v:+.1f}%"

hits = [r for r in get("/market/open-interest") if passes(r["total"])]
for row in hits:
    t = row["total"]
    print(f"{row['coin']}: OI {pct(t['oi_change_1h'])} in 1h, "
          f"price {pct(t['price_change_1h'])}, "
          f"total ${t['oi_usd'] / 1e6:.1f}M")
    exs = sorted(row["exchanges"].items(), reverse=True,
                 key=lambda kv: kv[1].get("oi_usd") or 0)
    for name, m in exs:
        share = (m.get("oi_usd") or 0) / t["oi_usd"] * 100
        print(f"  {name:<8} share {share:4.1f}%, "
              f"OI {pct(m.get('oi_change_1h'))}, "
              f"price {pct(m.get('price_change_1h'))}")

Illustrative output for coin XYZ: OI +6.2% in an hour, price +3.0%, total OI $48.1M.

ExchangeOI shareOI 1hPrice 1h
Binance46.2%+8.0%+3.0%
ByBit27.0%+5.0%+3.1%
OKX17.5%+2.0%+2.9%
Bitget9.3%+9.0%+3.2%

The growth is broad: OI rose on all four exchanges, and by 5% or more on three of them. If the same +6.2% had come from one exchange that held 10% of the coin's OI an hour ago, its OI would have had to grow 62%: 0.10 × 62 = 6.2. A spike on a single venue more often means one large player, and it is too early to draw conclusions about the market from it.

The second part adds funding: one /funding/rates call for all coins, and for each coin found, the lowest and highest 8-hour rate across exchanges and how many exchanges have a positive rate.

# funding rates for every exchange: one call covers all coins
rates = {row["coin"]: row["exchanges"]
         for row in get("/funding/rates")}

for row in hits:
    fr = sorted((e["funding_8h_pct"], e["exchange"])
                for e in rates.get(row["coin"], [])
                if e.get("funding_8h_pct") is not None)
    if not fr:
        print(f"{row['coin']}: no funding rates")
        continue
    (lo, lo_ex), (hi, hi_ex) = fr[0], fr[-1]
    plus = sum(1 for rate, _ in fr if rate > 0)
    print(f"{row['coin']}: 8h funding {lo:+.4f}% ({lo_ex}) "
          f"to {hi:+.4f}% ({hi_ex}), positive on {plus} of {len(fr)}")

The script makes two calls. Run once a minute, that is 2 × 60 × 24 × 30 = 86,400 calls per 30 days, under a fifth of the Trial plan's 500K quota. To poll in a loop without spending quota on unchanged data, add ETag and If-None-Match: the techniques are in How to poll an API without hitting limits, and quotas and requests per second in the Genesis API limits guide.

Caveats: what distorts open interest

Without code, the same data is in the OI Tracking table on the site; its columns, filters and charts are described in the guide. API plan quotas and prices are on the Genesis API pricing page.

Questions and answers

How is open interest different from trading volume?

Volume is the sum of trades over a period; open interest is the positions that remain open right now. Every trade counts toward volume, but it changes OI only when both sides open or both close positions. High volume with flat OI means positions are mostly changing hands. The /market/open-interest response has both numbers: volume_24h and oi_usd.

Where can I get open interest history?

Genesis API has no history: the endpoint returns the current snapshot and changes over 5, 15 and 30 minutes and 1 hour, so a long series is something you build by saving responses. Exchanges offer history in their own APIs: Binance for the latest month, Bybit in steps from 5 minutes to a day, OKX the latest 1,440 entries. On the site, the Chart button in OI Tracking opens an OI chart on the site's Pro plan.

How often is OI data updated in Genesis API?

Freshness depends on the API plan: 60 seconds on Trial, 30 on Start, 10 on Pro and 5 on Max. The snapshot build time is in meta.updated_at, and the delay for your plan is in meta.freshness_sec. Polling faster than that delay gains nothing, and with If-None-Match an unchanged snapshot comes back as a 304, which does not use your quota.

What does rising open interest with a falling price mean?

Usually new shorts are opening, or someone is buying longs against the move. If funding turns negative at the same time, shorts are also paying longs to hold their positions. A sharp reversal upward at that point can force shorts to close and speed up the rally.