DEX-CEX Arbitrage Bot Architecture: Inventory, Latency and Execution
Visible DEX-CEX spread is not profit. Fees, executable depth, gas, inventory and the risk of completing only one leg determine realized edge.
Visible DEX-CEX spread is not profit. Fees, executable depth, gas, inventory and the risk of completing only one leg determine realized edge.
Normalize quotes
Calculate CEX depth-weighted fill price and DEX output at the intended size. Subtract maker or taker fees, pool fees, gas, slippage and later rebalancing costs. Reject stale inputs.
Pre-position inventory
Hold base and quote assets on both venues so legs can execute immediately. Set inventory targets, venue imbalance limits and free-balance reserves; rebalance separately when conditions are favorable.
Failed-leg recovery
CEX and chain legs cannot be atomic. Define whether to cross the hedge, unwind, hold temporary exposure within a cap or stop the pair. Test recovery with the same care as entry.
On-chain safety
Simulate exact calldata, derive minimum output from the opportunity threshold and centralize nonce management. Private relays may reduce mempool exposure; read Flashbots Protect versus public mempool.
TierZero develops EVM arbitrage bots and their monitoring dashboards.
Need a bot like this built?
We design, build and run trading bots on Solana, Hyperliquid and Polymarket.
Start a projectMore from the blog
Public vs Paid RPC: How to Run a Fair Benchmark
A fair comparison of public and paid RPC endpoints must account for quotas, workload, freshness and support guarantees.
Read articleRPC Benchmark Percentiles Explained: p50, p95 and p99
Why averages hide the latency spikes that break trading bots, wallets and production blockchain applications.
Read articleHyperliquid REST vs WebSocket Benchmark: What to Measure
A benchmark plan for Hyperliquid market data that separates request latency from streaming freshness and recovery.
Read article