Every crypto arbitrage trader eventually asks the same question: which exchange API is fastest? The honest answer is that the number most people quote, a ping time, tells you almost nothing about whether your arbitrage orders will actually make money. An exchange can answer a ping in 3 ms and still deliver stale order-book updates, slow acknowledgements at busy moments and fills that land a few ticks away from the price your bot saw.
This guide shows how to measure crypto exchange API latency properly: which five delays matter, how to set up a fair test, how to read the results as a distribution instead of an average, and why fill quality usually decides more than raw speed. It is a measurement method, not a league table. We deliberately publish no per-exchange numbers, because latency depends on where your server sits, which endpoints you use and when you test. The only figures that count are the ones you measure yourself.
If you have not yet built the connection itself (WebSockets, rate limits, signing, order-book sync), start with our guide to アグリゲーションのために仮想通貨取引所APIへの接続 and come back here once data is flowing.
Why a ping time is the wrong number
A ping, or a call to an exchange’s server-time endpoint, measures one thing: how long a tiny request takes to travel to the exchange’s edge and back. Arbitrage depends on a chain of separate delays, and the network round trip is often the smallest and most stable of them. The delays that move your profit and loss are the ones inside the exchange: how quickly the matching engine’s events reach your WebSocket, how long the order gateway takes to accept an order, and how long the fill report takes to come back, especially when the market is moving and everyone else is sending orders too.
The five latencies that matter
- Network round trip. Your server to the exchange’s API edge and back. Mostly decided by geography and routing. Stable, easy to measure, rarely the bottleneck once your server is in the right region.
- Market-data latency. The time between the exchange’s own event timestamp on a trade or book update and the moment your bot receives it. This decides how fresh your view of the price is, and therefore whether the gap you see still exists.
- Order acknowledgement latency. From sending a new order to receiving the exchange’s “accepted” response. This covers the gateway, risk checks and queueing in front of the matching engine.
- Fill (execution report) latency. From sending the order to receiving the fill on your private stream. For a taker order this is the number that tells you when you are actually hedged.
- Cancel latency. From sending a cancel to receiving confirmation. It matters whenever a resting order must be pulled because the opportunity vanished.
Set up a fair test before you measure anything
Most latency comparisons you find online are not wrong, they are just measuring something different from what you will trade. Before you trust a number, fix these conditions.
- Measure from your production location. Latency from a laptop at home says nothing about latency from a server in the exchange’s cloud region. Run the test on the same machine, in the same region, that will run the bot. The server location guide explains how to choose that region.
- Use the endpoints you will trade through. If your bot sends orders over a WebSocket order API, measure that, not the REST endpoint. Some exchanges route REST and WebSocket orders through different gateways with different queues.
- Synchronise your clock. Market-data latency compares the exchange’s timestamp with yours, so a clock that is 15 ms off produces a 15 ms error. Run chrony or NTP against good time sources and record the offset alongside your results.
- Use a monotonic clock for round trips. For ack, fill and cancel latency you only need your own start and end time. Take both from a monotonic high-resolution clock, not wall time, so clock corrections during the test cannot distort results.
- Test at the times you trade. Quiet Sunday mornings flatter every exchange. Include the US open, major macro releases and fast market moves, because that is when arbitrage gaps appear and when gateways slow down.
- Collect enough samples. A few dozen pings is anecdote. Aim for thousands of market-data messages and at least several hundred order round trips per exchange before comparing tails.
Measuring market-data latency
Most exchange WebSocket messages carry an event time or transaction time set by the exchange. Record your local receive time the instant the message arrives, before parsing it, and store both. The difference, corrected by your known clock offset, is your market-data latency.
Two refinements make the number trustworthy. First, separate message types: trade prints, top-of-book updates and depth diffs often travel through different internal pipelines and can show very different delays on the same exchange. Second, watch the gaps between messages as well as their age. A feed that normally ticks every 100 ms but sometimes goes silent for two seconds during volatility is more dangerous than one that is consistently 20 ms slower, because the silence is exactly when your bot believes a stale price.
If an exchange’s timestamps are coarse, for example rounded to whole milliseconds or set late in its pipeline, treat market-data latency as approximate and lean more on the order round-trip numbers below.
Measuring order round trips safely
You cannot measure order latency without sending orders, but you can do it without taking market risk. The standard method is a post-only limit order placed far enough from the market that it cannot fill, followed by an immediate cancel. You record the send time, the acknowledgement time and the cancel confirmation time, which gives you ack latency and cancel latency on every cycle.
- Use the exchange’s minimum order size and a price well outside the spread.
- Stay comfortably inside the documented rate limits and order-to-trade expectations. A latency test that triggers a rate-limit ban or a warning from the exchange has measured the wrong thing.
- Read the exchange’s API terms. Test orders are normal practice, but spamming orders that are never meant to trade can breach some venues’ rules, so keep the volume modest and spread over time.
Fill latency needs real fills. The cleanest way is to record it from your genuine small trades, or from a short series of minimum-size taker orders on a liquid pair, measuring from send time to the fill message on your private stream. Do not assume the ack time equals the fill time: on some venues the fill report arrives noticeably later than the acknowledgement, and your hedge leg should be timed off the fill.
Read the distribution, not the average
An average hides the only part of the latency profile that hurts arbitrage: the slow tail. If 99 orders take 8 ms and one takes 900 ms, the average is about 17 ms and looks fine, yet that one slow order is the one that leaves you legged during a spike. Report every measurement as percentiles.
- p50 (median): the typical case. Useful for comparing regions and endpoints.
- p95 and p99: what happens on a busy day. This is where exchanges differ most.
- Max and timeouts: count separately how often a request never got a reply within your timeout. A venue with a good p99 but frequent timeouts is not a fast venue.
- Jitter: the spread between p50 and p99. Low jitter makes your hedging logic predictable; high jitter forces wide safety margins that eat the edge.
Fill quality: the metric that actually pays
Latency is a means, not the goal. What you are really buying with speed is better fills: getting the price you saw, in the size you wanted, without rejections. Two venues with similar latency can produce very different results because of matching-engine behaviour, book depth, self-trade rules or how their gateways behave under load. Track these alongside latency, per exchange and per pair:
- Fill ratio: the share of intended taker orders that filled completely. Partial fills and IOC orders that expire unfilled both count against it.
- Slippage versus signal price: the difference between the price your bot saw when it decided to trade and the average fill price, in basis points or ticks. This single number combines market-data staleness, reaction time, order latency and book depth.
- Reject and timeout rate: orders refused for rate limits, price bands, insufficient balance or internal errors, plus orders with no response in time. Each one is a potential legged trade on a two-exchange strategy.
- Effective edge: gross gap captured, minus fees, minus slippage, per trade. This is the number to compare venues by.
This is the trade-off the people searching for “platforms that balance latency and fill quality” are really asking about. In cross-exchange arbitrage, the right venue is the one with the best effective edge at your trade size, and latency is one input into it, not the answer.
A scorecard for comparing exchanges
Put your measurements into one table per exchange and pair, refreshed weekly. It keeps decisions based on data rather than reputation.
| メートル | How to measure | Good sign | Red flag |
|---|---|---|---|
| Network RTT | TCP connect or server-time call, p50 | Low single-digit ms from the right region | Tens of ms: wrong region or routing |
| Market-data latency | Receive time minus event time, clock-corrected | Stable p99, no long silences | Multi-second gaps during volatility |
| Ack latency | Post-only far limit order, send to ack | Tight p50 to p99 spread | p99 many times p50, timeouts |
| Fill latency | Taker order, send to fill on private stream | Close to ack latency | Fill reports lag acks noticeably |
| Cancel latency | Cancel sent to cancel confirmed | Similar to ack latency | Cancels slow down under load |
| Fill ratio | Filled size / intended size | Above 95% at your size | Frequent partials or IOC expiries |
| Slippage vs signal | Fill price minus decision price, bp | Small and stable | Grows sharply in fast markets |
| Reject / timeout rate | Rejected or unanswered / total orders | Well under 1% | Rate-limit or internal-error rejects at peaks |
Common measurement mistakes
- Timing after parsing. If you record receive time after JSON decoding and book updates, you measure your own code. Timestamp first, process second. Measure your processing separately, as reaction time.
- Testing one region and trading from another. Even a few hundred kilometres change the picture, and exchanges behind global CDNs can route you to different edges from different places. Our hop-by-hop latency breakdown shows how much of a round trip is outside your control.
- Ignoring the queue. Your order waits behind everyone else’s at busy moments. That queueing is real latency, which is why quiet-hour tests mislead.
- Comparing REST against WebSocket. A REST request may pay connection or TLS overhead that a persistent WebSocket session does not. Compare like with like.
- Trusting one week of data. Exchanges change infrastructure, endpoints and limits. Keep the measurement running continuously and alert when p99 or reject rate drifts.
Step by step: build your own latency and fill-quality benchmark
- Deploy the probe where the bot will run. Same server, same region, same network path.
- Sync the clock. Run chrony or NTP, log the offset, and use a monotonic clock for all round trips.
- Record market-data latency. Store exchange event time and local receive time for every trade and book message, per channel.
- Run safe order round trips. Post-only, minimum-size, far-from-market orders plus cancels, at a modest steady rate within the limits, recording send, ack and cancel times.
- Log real fills. For live or small test trades, record decision price, send time, fill time, fill price and size.
- Summarise as percentiles. p50, p95, p99, max and timeout count per metric, per exchange, per hour of day.
- Rank by effective edge. Combine fees, slippage and fill ratio into net basis points per trade at your size, and review the scorecard weekly.
Once you have the numbers, the decisions follow naturally: which venue to use for the hard-to-fill leg, which pairs to drop, where to move your server, and how wide your safety margins must be. For the bigger picture of running a bot across several venues, see our クロス取引の暗号資産相場アグリゲーションボットガイド.
よくある質問
Is ping a good way to compare crypto exchange APIs?
Only as a first check that your server is in the right region. Ping measures the network round trip to the exchange’s edge, not market-data freshness, order acknowledgement, fill timing or behaviour under load, which are what decide arbitrage results.
What is a good API latency for crypto arbitrage?
There is no universal number. It depends on the strategy, the size of the gaps you trade and how fast competitors are. A stable p99 matters more than a low median, and the real test is whether your effective edge after fees and slippage stays positive.
Is WebSocket order entry faster than REST?
Often, because a persistent WebSocket session avoids per-request connection and authentication overhead, but not on every exchange. Measure both endpoints from your own server before choosing, and compare them under busy conditions, not just quiet ones.
How can I measure order latency without taking market risk?
Place minimum-size, post-only limit orders far from the market and cancel them immediately, recording send, acknowledgement and cancel times. Keep the rate modest, stay inside documented limits and check the exchange’s API terms.
How many samples do I need?
Thousands of market-data messages and at least several hundred order round trips per exchange, spread across quiet and busy hours. With fewer samples the p99 is mostly noise.
Why do my fills differ from the price my bot saw?
The gap between signal price and fill price combines stale market data, your reaction time, order latency and limited book depth. Measuring each part separately shows which one to fix: server location, code, endpoint choice or trade size.