Trading

DEX Arbitrage (CoW vs Velora spread capture)

10 min read

What it is

Cross-DEX same-chain arbitrage between CoW Protocol and Velora solver networks. Pre-signed cycles sit in a pool waiting for the spread to cross your threshold. When CoW and Velora price the same pair differently by enough basis points to overcome fees, the worker fires both legs back-to-back to capture the spread. MEV-protected fills, 3-loss-streak auto-pause, daily fire cap. Fully isolated from CEX Arbitrage (separate code, separate menu).

How to think about it

Arbitrage on DEX is HARD — solver networks already squeeze most of the spread out, and the windows close in seconds. This bot captures the residual spreads CoW vs Velora occasionally produce on stable→volatile legs. Spread thresholds default to 0.30% (conservative — fees eat anything tighter). Expect this to be a low-frequency profit source, not a money printer. The radar shows live spread % so you can see whether the pair is even worth watching before committing capital.

Step-by-step

  1. Pick chain + pair + direction

    Chain = Ethereum / Arbitrum / Base (intersection where both protocols are live). Pair = stable + volatile (USDC + WETH on Base is the most-tested combo). Direction = "Buy on CoW · Sell on Velora" OR the reverse. Run BOTH directions as separate bots if you want to capture both sides.

  2. Set minimum spread threshold (default 0.30%)

    How wide the spread must be before a cycle fires. 0.30% = conservative (covers fees + small slippage cushion). Below 0.30% you almost certainly lose money after fees. Above 0.50% = rare opportunities, mostly during volatility spikes.

  3. Pick pool size (5 / 10 / 20 cycles)

    5 cycles = 10 signatures (small test). 10 cycles = 20 signatures (standard). 20 cycles = 40 signatures (high-frequency, for stable→volatile pairs you watch all day). Each cycle = 2 signatures (one for the buy leg, one for the sell leg, both pre-signed).

  4. Set daily fire cap

    Max number of cycles the bot fires per day. Default 10. Acts as a brake on bad market conditions — if spreads stay too tight and the threshold never engages, fire count stays at 0. If spreads go wild and the bot would fire 50× / day at 0.3% each, cap stops it at 10 to limit blast radius.

  5. Sign approval + N×2 cycles

    First-time spend-token: ERC-20 approval (gas, one-time). Then N × 2 EIP-712 signatures back-to-back. 10 cycles = 20 popups. 20 cycles = 40 popups. Be ready for the cadence.

  6. Watch the radar + P&L summary

    Live opportunity radar polls every 60s and plots spread % over the last 15 min on a line chart. Green threshold line shows your minSpreadPct. "⚡ ready to fire" badge appears when current spread > threshold. P&L summary shows total fires, win count, win rate, daily count vs cap, cumulative net P&L.

  7. Auto-pause + manual pause

    3 consecutive losing fires = auto-pause + notification. Manual pause button stops the radar polling and prevents new fires. Resume to re-enable. Cancel ends the bot and unwinds the pool.

Tips & pitfalls

  • Architecturally validated May 2026 (radar, direction logic, threshold gating all live-proven). First organic fire pending a real USDC/WETH-Base spread spike > 0.30%. This is a low-frequency strategy by design — don't expect a fire every hour.
  • Run a Small test first (5 cycles, $50 per cycle) before committing larger pools. Validate the loss-streak auto-pause behavior with skin in the game.
  • Pair selection matters more than chain. USDC/WETH on Base is the canonical test pair — high liquidity on both protocols means tight spreads MOST of the time, which is exactly the regime where the bot should NOT fire. The bot earns its keep during volatility spikes when one protocol lags.
  • Daily cap is your blast-radius limit. Set it to (max-tolerable-loss / per-cycle-amount). Example: max $50 loss tolerance, $25 per cycle → daily cap = 2. Aggressive setups (cap = 50) need wider net P&L to overcome inevitable losers.
  • 3-loss-streak auto-pause is conservative. If the bot has 3 losing fires in a row, the market regime has likely shifted (one protocol changed its pricing curve, a new solver is competing aggressively, etc). Better to pause and investigate than to keep losing.
  • The radar polls every 60 seconds — meaningful spreads can vanish in under 60s, so the bot may miss fast opportunities. This is a documented limitation. Higher polling rate = higher API cost; we hold the line at 60s.
  • Fully isolated from CEX Arbitrage. The CEX Arbitrage feature lives in the CEX Trade menu, uses CCXT exchanges, and has its own code path. Editing this DEX bot will never affect CEX arbitrage.
  • Cancel cancels all UNFILLED cycles in the pool. Already-submitted cycle halves may still attempt to complete — read the cancellation toast for any partial-completion warnings.