Coil solver¶
ELI5: Off-chain program that collects signed intents, finds a fair clearing price, and sends one transaction to Coil to settle the batch.
What you can do¶
| Component | Role |
|---|---|
coil-solver (Rust) |
Match intents, compute clearing |
coil-cli |
Submit execute_batch |
| Whitelist | Only approved solver addresses |
Users do not run the solver — you sign intents; solver operates infrastructure.
Flywheel fit¶
Solver includes CoilMakerStrategy EIP-1271 intents alongside user orders — proprietary flow + retail flow in same batch.
Architecture¶
From Coil-DEX/solver/README.md:
coil-types — intent structs, EIP-712 helpers
coil-book — order book / aggregation
coil-solver — matching engine
coil-settle — on-chain calldata builder
coil-cli — operator CLI
Contract vector tests in repo validate solver output against Coil.vy.
flowchart TD
API[Intent pool] --> Book[coil-book]
Book --> Solver[coil-solver]
Solver --> Settle[coil-settle]
Settle --> Chain[Coil.execute_batch]
What can go wrong¶
Risks
- Solver trust — malicious solver could censor or reorder off-chain (not steal CDP collateral).
- Liveness — no solver → intents expire unfilled.
- Operator key compromise → bogus batches revert on-chain guards.
Deep dive: testing
mox test — 103 tests on-chain; solver has separate Rust tests + vector tests against Vyper.
Source: Coil-DEX/solver/README.md