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.
Building this for production?
We turn this architecture into tested, non-custodial software with monitoring, documentation and deployment support.
Related technical guides
Sharpe vs Sortino vs Calmar: Which Metric to Optimize?
Compares the three most common risk-adjusted return metrics for algo strategy selection, showing through simulation why optimising Sharpe alone leads to tail-risk blind spots and when Calmar is the right fitness function for drawdown-sensitive mandates.
Read articleJIT Liquidity on Solana: Just-in-Time LP Sandwiching for Meteora
A jit liquidity solana strategy for Meteora DLMM: detect big swaps via Yellowstone, add single-bin LP for one slot in a Jito bundle, earn the fee, exit.
Read articlePerformance Metrics Beyond Sharpe for HFT Strategies
Calmar, Sortino, profit factor, fill ratio, and adverse-selection rate give you a far more honest picture of HFT strategy health than Sharpe alone. Here is how each metric is calculated, what it actually tells you, and a Python dashboard template that derives all of them directly from exchange trade logs.
Read article