Phase 4 — Coil Integration

// WIRING A DEX INTO A STABLECOIN FLYWHEEL WITHOUT GIVING IT A KEY · VYPER 0.4 · SEPOLIA

Coil — an MEV-resistant intent DEX where every order in a batch clears at one uniform price — plugs into the TARE stack three ways, and every connection only moves value Coil has already earned. A DEX is a harder test of that rule than a gauge vote: now there's order flow, fees, and a contract that wants to trade. Three small contracts, each built so the worst an operator can do is leave money on the table — never take it.

Vyper 0.4EIP-1271EMA Oracle Floor Curve StableSwap-NGHypothesisFork-ProvenSepolia
⚠ Sepolia testnet · fuzzed · self-reviewed · NOT audited. A + B live and wired; C (CoilMakerStrategy) is fork-proven and deployed to Sepolia (0x07cD…3006). Gauge weights activate at the weekly epoch boundary (Thu 00:00 UTC).
“No vote, keeper, admin, or caller may move a solvent user’s collateral, mint on a bad price, or alter live debt. Routers only move value already released or earned.”
1→0.99989USDC fee → TARE (A)
1000→1001.94Vault out on 1000 in (C)
20%Gauge slice · ≤50% cap (B)
160Keep suite · green

A — Coil's fees become TARE's yield

CoilFeeRouter is installed as Coil's fee_recipient. The permissionless harvest(token) pulls the accrued (≤1%) fee: TARE passes straight through (donated as-is); USDC is swapped USDC→TARE through the canonical Curve StableSwap-NG pool, then donated to the engine's permissionless donate_to_surplus() — no engine change.

B — lock TARE, earn Coil's fees in USDC

A capped slice of each USDC fee routes — still in USDC — to gauge voters, with zero veForge contract changes. A second EmissionRouter instance whose reward token is USDC feeds the existing token-agnostic BribeDistributor; CoilFeeRouter peels off a bounded slice before it swaps.

C — the vault makes markets on Coil, and still can't be drained

CoilMakerStrategy is a Keep strategy (asset = USDC) that is itself a Coil trader: it rests limit intents ("sell USDC, buy TARE, at or above this price") and authorizes them on-chain via EIP-1271 — a keeper-managed registry of approved order digests, answered from isValidSignature.

Invariants, fuzzed

For the maker strategy a stateful machine plays all three roles — vault, keeper, solver — interleaved with harvests, time travel, and EMA moves, asserting after every step:

Totals: CoilFeeRouter 27+1 · CoilMakerStrategy 12+1 · plus a veForge integration test proving the 6-decimal USDC emission path end-to-end. Full Keep suite: 160 green, no regression.

Proven on a Sepolia fork vs real contracts

Mocks prove logic; they don't prove you got a real counterparty's ABI, decimals, and EIP-712 digest right. Both risky integrations were run on a Sepolia fork against the real contracts.

Sepolia addresses (chain 11155111)

ContractAddress
Coil (intent DEX)0x95107C1844191047D781C4f6AD90Ea14c422a578
CoilFeeRouter (A)0xdD4A74631770C32930b03A0a7AbD8572D1641547
EmissionRouter · USDC (B)0xf28A9E305BD4631442b89a73a58387B4d66b511F
CoilMakerStrategy (C)0x07cD6636840a44B77e4AC2e971eD96c076C73006
GaugeController (reused)0xA28c124827bbe1e6d5fce394d04F7Dff8550c369
BribeDistributor (reused)0x64452025DbDbaA862C8A7137deB05A1FC11316B3