API data for arbitrage: spreads, order books and funding
In short
- Each trader question has its own endpoint: the price gap is
spread_pctin/arbitrage/*, the coin transfer is the deposit and withdrawal flags plusnetworkandcontract, execution for your size is/orderbooks/*, and the funding case is/funding/*. - The row spread is computed from last trades. In the illustrative example, 1.5% on $2,500 shrinks to 0.72% after walking the order books and to roughly 0.52%, about $13, after two 0.1% taker fees.
- Every response carries its timing:
meta.updated_atis when the snapshot was built,meta.freshness_secis your plan's refresh step, andage_secandstalegive the order book's age. - A pair is checked on four points: price gap, transfer, order book and freshness. Failing any one of them cancels the entry.
- CEX arbitrage, funding and open interest are on every Genesis API plan, on-chain sections start at Start, and order books and DEX data come with Pro and Max.
Crypto arbitrage data answers five questions: is there a price gap, can you move the coin, is the order book deep enough for your size, does funding pay, and what are large players doing. In Genesis API each question has its own endpoint and a handful of response fields. The first request and the success, data, meta envelope are covered in lesson 2; this lesson is about which fields to read and in what order.
Trader question → endpoint → fields
| Question | Endpoint | Fields |
|---|---|---|
| Is there a price gap | /arbitrage/* | spread_pct, price_buy, price_sell |
| Can you move the coin | the same /arbitrage/spot-spot row | withdraw_enabled_buy, deposit_enabled_sell, network, contract |
| Is the book deep enough | /orderbooks/* | order_delta.spread_pct, order_delta.status |
| Does funding pay | /funding/* | spread_pct, interval_1, interval_2, next_payout_1 |
| What large players are doing | /onchain/*, /market/open-interest | direction, total_usd, oi_change_1h |
The asterisk marks a group: /arbitrage/* holds seven endpoints, from Spot – Spot to stocks, while /orderbooks/* and /funding/* hold six each. The sections below follow the order in which you check a pair.
Is there a price gap: spread_pct
A row from the Spot — Spot docs: FUEL, buy on ByBit at 0.0007029, sell on Gate at 0.0007037, spread_pct 0.11. Check: (0.0007037 − 0.0007029) / 0.0007029 × 100 ≈ 0.11%. The row spread is computed from price_buy and price_sell, the last-trade prices; on the site this is the Price column.
In the DEX – Spot and DEX – Futures datasets the sign matters: plus means the token is cheaper on the DEX, minus means it is more expensive. Parameters and fields of all seven datasets are in the arbitrage endpoints guide.
spread_pct answers only the first question: it contains no fees, no transfer and no order book.
Can you move the coin: deposits, withdrawals, network and contract
A cross-exchange spot pair needs a transfer: you buy the coin on one exchange, withdraw it and deposit it on the other. So the row has two flags to read: withdraw_enabled_buy, whether withdrawals are open on the buy exchange, and deposit_enabled_sell, whether deposits are open on the sell exchange. The request has no parameters for them, so your code filters the rows.
network and contract tell you whether it is the same token. Different coins can trade under one ticker on different exchanges, so compare the contract address with the withdrawal and deposit pages of both exchanges. A coin's contracts per network, and the exchanges that use each of them, come from /coins/search on any plan (Coin Search).
In the DEX datasets the flags belong to the CEX side: deposit_enabled and withdraw_enabled. In Cross-chain the token moves over a bridge between the buy.chain and sell.chain networks, so there are no exchange flags.
Is the order book deep enough: row spread vs spread after execution
A market order walks the order book: a buy takes asks upward from the best one, a sell takes bids downward. The larger the size, the worse the average price and the less is left of the row spread. Order-book Δ, /orderbooks/spreads/{dataset} on the Pro and Max plans, returns what is left for your size (docs).
Illustrative example: coin LMN, buy on OKX at 0.4000, sell on Bitget at 0.4060. Row spread: (0.4060 − 0.4000) / 0.4000 × 100 = 1.5%. Requesting /orderbooks/spreads/spot-spot with coin=LMN at different volume values:
| Size | Buy → sell | Order-book Δ | In dollars |
|---|---|---|---|
0 | 0.4002 → 0.4058 | 1.3993% | — |
| $500 | 0.4004 → 0.4055 | 1.2737% | $6.37 |
| $2,500 | 0.4012 → 0.4041 | 0.7228% | $18.07 |
| $10,000 | — | exhausted | — |
volume=0 uses the best OKX ask and the best Bitget bid: the best orders sit worse than the last trades, so 0.1 percentage points are gone even at the smallest size. At $2,500 the average buy price is 0.4012 and the average sell price 0.4041: (0.4041 − 0.4012) / 0.4012 × 100 ≈ 0.7228%. At $10,000 the Bitget bids ran out and order_delta.status is exhausted.
Each exchange charges a taker fee; the example assumes 0.1% (maker and taker). At $2,500 you keep 0.7228 − 2 × 0.1 = 0.5228%, or 2,500 × 0.5228 / 100 ≈ $13.07. Withdrawal fees are not in the responses: look them up on the exchange's withdrawal page and subtract them separately.
On Trial and Start the order book endpoints return 403 plan_restricted, so you check the book in the exchange terminal. Execution price and slippage are explained in Crypto order book API, and all six endpoints in the order book endpoints guide.
Does funding pay: spread, intervals and payouts
Funding arbitrage means a short where the funding rate is higher and a long where it is lower: price moves barely change the result, and the rate difference accrues. Candidates come from /funding/spread on any plan: the best exchange pair in best and its spread_pct (Funding spread).
The pair spread does not say when and how often payments happen. interval_1 and interval_2 are the two exchanges' funding intervals, and next_payout_1 and next_payout_2 are the next payout times in UTC: only a position open at the settlement moment receives funding. Rates with different intervals are compared after normalizing them to 8 hours, which is the funding_8h_pct field in /funding/rates.
Illustrative example: a spread of 0.03% per 8 hours, with a $5,000 position on each leg. One settlement brings 5,000 × 0.03 / 100 = $1.5. Four trades, opening and closing both legs, cost 4 × 5,000 × 0.1 / 100 = $20 at a 0.1% taker fee. The fees pay off after 20 / 1.5 ≈ 13.3 settlements: that is 14 eight-hour settlements, almost five days, if the rates hold.
History shows whether the gap holds: on Pro and Max, /funding/analytics/summary with coin returns, for each exchange, sum (accumulated funding), cov (coverage) and flips (sign changes) for each period. Details are in Funding rate API and the funding endpoints guide.
What large players are doing: on-chain and open interest
On-chain data and open interest explain why a pair may close before you execute it. A coin flowing into the sell exchange means sellers who arrive before your transfer does. Rising open interest means new leveraged positions, and a sharp move against them triggers liquidations.
| What you see | Request | Fields | Plans |
|---|---|---|---|
| Coin flows to and from exchanges | /onchain/coin-traffic | direction, target, total_usd | Start, Pro, Max |
| Token unlocks | /onchain/unlocks | unlock_value_usd, hours_left | Start, Pro, Max |
| Open interest by exchange | /market/open-interest | oi_usd, oi_change_1h, price_change_1h | All |
The sample response in the Genesis Onchain docs shows 18 LAB transfers to Gate worth $573,796.98 over 5.69 hours, with direction set to deposit. If LAB has a pair selling on Gate at that moment, such a flow is a reason to cut the size or skip the entry. More in On-chain data API and Open interest API.
Data freshness and timestamps
Every response carries its time: meta.updated_at is the unix time the snapshot was built, and meta.freshness_sec is your plan's refresh step: 60 seconds on Trial, 30 on Start, 10 on Pro and 5 on Max. The snapshot's age is the current time minus updated_at (data freshness).
Illustrative example: Trial plan, the response arrived at 1783802455 and updated_at is 1783802410. The snapshot is 1783802455 − 1783802410 = 45 seconds old: its pairs were computed from prices almost a minute old, and some of them may already be gone on the exchanges.
Order books have their own clock: in /orderbooks/book and /orderbooks/coin/{coin} each book has book_ts, age_sec (its age in seconds) and stale: true when it is older than 30 seconds. Books lag the exchange by 5–20 seconds, so check the age of both legs: a price gap between a fresh book and an old one can be a gap in time.
Why one field is not enough: the four-point check
Each field closes one question, and you can enter only when all of them are closed. A 3% spread with withdrawals closed leaves the coin stuck on the buy exchange. With exhausted your size will not fill. With a 50-second-old snapshot the pair may already be gone.
| Point | Fields | The pair fails if |
|---|---|---|
| 1. Price gap | spread_pct | spread minus two fees is below the threshold |
| 2. Transfer | withdraw_enabled_buy, deposit_enabled_sell, contract | withdrawals or deposits are closed, or the contract does not match |
| 3. Order book | order_delta.status, order_delta.spread_pct | status is not ok or what is left is below the threshold |
| 4. Freshness | meta.updated_at, age_sec, stale | the snapshot or a book is older than the threshold |
The function takes a data row from /arbitrage/spot-spot, the order_delta object for the same exchange pair (None on Trial and Start) and the response's meta. The thresholds are illustrative: tune them to your fees and plan.
import time
FEE = 0.1 # assumed taker fee per leg, %
MIN_NET = 0.3 # at least 0.3% left after fees
MAX_AGE = 60 # snapshot no older than 60 seconds
def check(row, od, meta):
"""The points a Spot – Spot pair failed."""
fails = []
if row["spread_pct"] - 2 * FEE < MIN_NET:
fails.append("1: spread does not cover the fees")
if not row["withdraw_enabled_buy"]:
fails.append("2: withdrawals closed on the buy exchange")
if not row["deposit_enabled_sell"]:
fails.append("2: deposits closed on the sell exchange")
if od is None:
fails.append("3: book not checked (Trial or Start)")
elif od["status"] != "ok":
fails.append("3: book — " + od["status"])
elif od["spread_pct"] - 2 * FEE < MIN_NET:
fails.append("3: too little left after the book")
if time.time() - meta["updated_at"] > MAX_AGE:
fails.append("4: snapshot older than MAX_AGE seconds")
return fails
An empty list means the pair passed all four points. The LMN pair at $2,500 passes: 1.5 − 0.2 = 1.3% on the row, 0.7228 − 0.2 = 0.5228% after the book, and a 45-second-old snapshot. At $10,000 the function returns "3: book — exhausted". The code cannot verify the contract: you check the address on the exchanges' withdrawal and deposit pages, and the age of both legs' books comes from /orderbooks/book.
The same check on the site's table, without code, is in the lesson Spread, depth, volume — reading the table, and polling the API in a loop is in lesson 4.
Which data comes with which plan
| Plan | Freshness | Arbitrage data |
|---|---|---|
| Trial, $20 a month | 60 s | Spot – Spot, Spot – Futures, Futures – Futures, funding rates and spread, open interest, Fair – Last, pumps, coin search |
| Start, $50 | 30 s | Everything in Trial plus stocks, on-chain sections /onchain/{section}, prediction arbitrage in exact and dutch modes |
| Pro, $100 | 10 s | All endpoints: order books and Order-book Δ, DEX – Spot, DEX – Futures, Cross-chain, funding analytics |
| Max, $200 | 5 s | The same endpoints as Pro, with 15 requests per second |
An endpoint outside your plan returns 403 plan_restricted, and that response does not use quota. Call quotas and requests-per-second limits are on the Genesis API pricing page.
Practice
Take a pair
In the Spot — Spot docs, open the Try it form, paste your key and pick a row with a spread of 1% or more.
Run points 1 and 2
Subtract two assumed 0.1% fees from
spread_pctand checkwithdraw_enabled_buyanddeposit_enabled_sell. Comparecontractwith the/coins/searchresponse for this coin.Run point 3
On Pro or Max, request
/orderbooks/spreads/spot-spotwith this coin andvolume=1000, and find the row with the same exchange pair. On Trial and Start, open the order book in the exchange terminal.Run point 4
Subtract
meta.updated_atfrom the current unix time:date +%sprints it in a terminal.Write down the verdict
Which point would reject the pair first, and how much of the spread would be left on $1,000.
Questions and answers
What data do you need for crypto arbitrage?
Prices of the coin on different exchanges and the spread between them, deposit and withdrawal status with the network and contract, order books to work out execution for your size, and the snapshot time. Funding arbitrage adds rates, intervals and payout times. In Genesis API that is /arbitrage/*, /orderbooks/* and /funding/*.
Can you place a trade through Genesis API?
No. Genesis API only reads data and does not place orders: you open the trades yourself on the exchanges.