Solver Service
The Solver service acts as the mathematical brain of the trading system, focusing exclusively on route-finding optimization. It receives auctions and computes optimal trading paths to settle orders at the best possible prices.Key Responsibilities
The solver handles:- Route Discovery through DEX liquidity
- Order Matching including Coincidence of Wants (CoWs)
- Solution Scoring for evaluating proposed solutions
- Partial Fills for limit orders
- Multi-hop Routing through intermediate tokens
Primary Strategies
The baseline solver implements four main approaches:- Direct Matching (CoW) - Overlapping orders trade directly
- Single-Hop Routing - One liquidity source connection
- Multi-Hop Routing - Paths through intermediate tokens
- Partial Fill Optimization - Finding optimal fill amounts for limit orders
Configuration
Key parameters include:Deployment Options
The service can run standalone via HTTP API or integrate with the Driver. External solvers must implement a/solve endpoint accepting orders and liquidity data, returning optimized solution proposals.
Performance Tuning
Route exploration grows exponentially with hops. The recommended starting point ismax-hops = 1 with adjustments based on liquidity patterns and latency requirements.
Source: crates/solvers/