A quoted spread is not money in the bank
A crypto arbitrage bot looks for prices that disagree across related markets. Finding the gap is the easy part. The bot still has to fill every leg at the required size, pay the associated costs and survive the possibility that one order completes while another does not. Until then, the spread is only a quote.
Crypto markets regularly show price differences across venues, countries and instruments. Igor Makarov and Antoinette Schoar documented recurring cross-exchange deviations and linked some of the larger ones to market segmentation and the difficulty of moving arbitrage capital. Their research helps explain why gaps persist. It does not mean any particular account can capture them.
Four trades that sit under the arbitrage label
| Structure | Trade shape | What keeps it from being risk-free |
|---|---|---|
| Cross-venue | Buy an asset on the cheaper venue while selling it on the dearer venue. | Capital must usually be prefunded; fills, custody and withdrawals can diverge. |
| Triangular | Cycle through three pairs on one venue and finish in the starting currency. | Three order books, fees, quantity rules and partial fills determine the result. |
| Spot–futures basis | Buy spot and sell a related dated future, or use the reverse structure. | Margin, borrow, settlement terms and basis movement matter before expiry. |
| Perpetual funding | Offset spot and perpetual exposure while targeting net funding receipts. | The rate can change sign; basis, collateral and liquidation risk remain. |
These trades need different accounting. Cross-venue arbitrage moves inventory between two accounts. Triangular arbitrage follows a chain of conversions. Cash-and-carry has an expiry date. A perpetual never expires and uses funding payments to pull its price toward spot. The funding-rate arbitrage guide takes apart that final setup.
Cross-venue trading starts with prefunded accounts
Suppose BTC is cheaper on Venue A than Venue B. To trade both sides together, the account needs quote currency on A and BTC—or borrow that permits a short—on B before the gap appears. After the orders fill, A holds more BTC and B holds more quote currency. Rebalancing those accounts happens later and brings its own withdrawal fees, confirmation delays, network risk and venue limits.
- The symbols may look identical while using different quote assets, contract sizes or settlement currencies.
- A deposit or withdrawal can be paused even while trading remains open.
- A stablecoin-denominated price includes exposure to that stablecoin, not only the traded asset.
- Fee tiers and available borrow differ by account, so another trader’s spread may not be yours.
- Capital held across several venues increases custody and counterparty concentration.
- Rebalancing too often can consume the edge; rebalancing too late can strand inventory on the wrong side.
The bot needs a target balance for each asset on each venue and a rule that stops one-way trading before inventory runs out. A price signal is useless if the required asset is sitting somewhere else.
Triangular routes live or die on the third conversion
A triangular cycle starts and ends in one currency—for example, USDT to BTC, BTC to ETH, then ETH back to USDT. The bot must use the correct bid or ask for each direction, multiply the three executable conversion rates, round each intermediate quantity down to venue precision and subtract a fee on every fill.
Consider an illustrative $10,000 cycle whose three quoted conversions would return $10,080 before costs: a gross spread of $80, or 0.80%. Use rounded estimates of $30 for trading fees across the three legs, $20 for fill slippage and $15 for partial-fill and emergency-unwind risk.
$10,080 − $10,000 − $30 − $20 − $15 = $15 illustrative net edge The headline 0.80% has shrunk to 0.15%. A 0.15% move in the final bid would erase it. The example leaves out taxes and assumes all three orders complete. In a real account, fees may also be deducted from an intermediate asset, leaving less quantity for the next conversion.
A dated basis trade has to survive until expiry
A conventional cash-and-carry trade buys spot and sells a higher-priced dated future. If both legs remain intact through expiry, convergence can realize the opening basis. The path is not necessarily smooth: basis can widen first, creating a mark-to-market loss on the futures leg and a demand for more collateral.
Reverse cash-and-carry—short spot and buy the future—also depends on borrow availability, recall terms and borrow cost. Contract multiplier, index, settlement method and expiry are part of the trade, not footnotes. The Bank for International Settlements’ work on crypto carry highlights regulatory and margin frictions as limits on arbitrage capital, even when a visible basis is large.
Price the whole route before sending the first order
Pre-trade net estimate = size-adjusted quoted spread − fees − expected fill slippage − borrow/funding − transfer costs − one-leg failure reserve The quoted spread should use synchronized order books and volume-weighted prices for the intended size; the best bid and ask cover only the first level. Expected fill slippage is the additional movement between that snapshot and the actual fills. Once realized P&L is calculated from those fills, do not subtract slippage again. Reject stale quotes and recalculate the route after every partial fill.
Coordination matters more than spotting the gap first
Exchange feeds drop and delay messages. Coinbase’s WebSocket overview warns that messages can be dropped and points to sequence numbers as a way to detect gaps. A bot maintaining a local book should discard its view and rebuild from a fresh snapshot when that sequence breaks. Trading from an order book it cannot verify is not a speed advantage.
| Failure | Result | Required response |
|---|---|---|
| Stale book | The opportunity uses liquidity that no longer exists. | Expire the quote and wait for a synchronized snapshot. |
| One leg fills | The account becomes directionally exposed. | Cancel the remainder, hedge under a bounded loss rule and alert. |
| Partial cycle | An unwanted intermediate asset remains. | Reprice the remaining route or unwind according to a prewritten policy. |
| Unknown order state | A retry can create a duplicate order. | Query by client order ID before resubmitting. |
| Balance mismatch | The next opportunity may be sized from imaginary inventory. | Stop new orders until venue state and the internal ledger reconcile. |
The unglamorous machinery behind the trade
- Venue adapters: normalize symbols, contract multipliers, quantity increments, timestamps and error codes without hiding venue-specific rules.
- Order-book service: maintain snapshots and updates, detect gaps, record receive time and expose depth for the intended size.
- Opportunity engine: compare executable routes after account-specific fees, balances, borrow and conservative slippage.
- Pre-trade risk: cap order size, venue exposure, asset inventory, daily loss and maximum unhedged time.
- Execution coordinator: choose leg order, use unique client IDs and follow a written response to partial fills and timeouts.
- Independent ledger: reconstruct balances and net profit from fills, fees, funding, transfers and adjustments.
- Operations layer: monitor feed age, API health, clock drift, withdrawals, margin and reconciliation around the clock.
Even “simultaneous” orders are separate messages sent to separate matching engines. Cross-venue execution is never atomic, so the risk rules must begin with the assumption that one side can fill alone.
A backtest needs books, balances and broken trades
- Store timestamped order-book snapshots or reconstruct sequence-checked books; candles cannot test a depth-sensitive route.
- Replay every leg in order and round intermediate quantities according to the venue’s historical rules.
- Apply the account’s actual fee tier, borrow cost, funding, withdrawal cost and likely maker-versus-taker mix.
- Model partial fills, queue position, rejected orders, rate limits, feed gaps and the cost of emergency hedges.
- Separate detected opportunities, attempted routes, completed cycles and reconciled profit.
- Stress slower data and order latency, thinner depth and higher fees instead of testing one favorable setting.
- Run shadow orders against live books, then bounded live trades, before increasing inventory.
Track median and worst unhedged time, fill rate for each leg, realized slippage, net edge by venue, inventory imbalance, emergency-unwind loss and reconciliation failures. Counting detected opportunities says nothing about how many became profitable trades. For research-to-live failure modes, see backtests versus live results.
Questions worth asking before trusting an arbitrage bot
- Does the displayed spread use executable depth for all legs or only top-of-book prices?
- Which fee tier, borrow rate, funding assumption and slippage model produce the displayed net edge?
- Where must inventory and collateral be held before trading begins?
- How does the system detect stale books, unknown order states and duplicated requests?
- What is the maximum permitted one-leg exposure in both size and time?
- Can a user inspect every order, fill, fee, transfer and reconciliation adjustment?
- Are results simulated, shadow, testnet or rebuilt from live account records?
- What stops trading when a venue, stablecoin, network or custody provider is impaired?
A bot can compare more routes and react faster than a person. It cannot remove settlement, custody, liquidity or counterparty risk. The broader automated-trading systems guide explains how risk policy and reconciliation should remain outside the opportunity model.
Research and venue documentation
- Makarov and Schoar — Trading and Arbitrage in Cryptocurrency Markets
- Bank for International Settlements — Crypto carry
- Coinbase Developer Documentation — Exchange WebSocket overview
- Coinbase Markets — Trading rules
- Commodity Futures Trading Commission — Trading bot customer advisory
The rates, costs and conversions are examples. Venue rules and market structure change, so none of the figures should be read as a current opportunity or a recommendation of a bot, asset, venue or trade.