Multi-DEX Smart Order Router
Challenge: DeFi protocol needed to give users best execution across 8 DEXs — naive single-venue routing leaving 0.3-1.5% value on table for large orders.
Architecture: Off-chain route finder computing all paths up to 3 hops across 8 DEXs. Split execution across multiple pools to minimise price impact. On-chain aggregation contract executing atomic multi-venue swaps. Gas cost included in route optimisation — a cheaper route that saves $10 in fees is better than a marginally better price costing $15 more gas.
Outcome: Users receive 0.4-1.8% better execution vs single-venue routing. Protocol handles $15M daily volume. Route calculation completes in under 200ms for 95% of pairs.