TracerDocs
Docs menu
About Tracer

Architecture

What Tracer is, how it sits on the official 1inch Aqua and SwapVM contracts, and what is deployed.

Tracer is a two-sided market in capped ETH realized-variance receipts, built on the official 1inch Aqua and SwapVM contracts. A writer funds a maker vault; the vault ships three SwapVM strategies; buyers pay an executable ask for receipt tokens, holders can sell them back at an executable bid before expiry, and after expiry every receipt redeems for USDC at the realized variance computed on-chain from the Chainlink feed's own round history.

Every unit sold is fully collateralized: the vault reserves that unit's capped payout, and the writer cannot withdraw the reservation, cannot revoke the vault's Aqua allowance, cannot move unsold inventory, and cannot dock the strategies that pay holders out.

The same realized-variance primitive prices a vol-adaptive spread for an Aqua AMM, so an LP can measure and hedge loss-versus-rebalancing (LVR ∝ σ²) with the instrument that pays σ².

Aqua and SwapVM in one paragraph

Aqua is 1inch's shared-liquidity layer: a maker ships a strategy (a SwapVM program plus the tokens it may draw on) and Aqua records virtual balances. Nothing is deposited into Aqua — when a taker swaps, Aqua pulls from the maker with transferFrom and pushes the taker's tokens back. A SwapVM program is a flat list of instructions [opcode:1][argsLength:1][args]; the router runs them in order and the last terminal instruction fixes the price.

Tracer runs on the unmodified official AquaSwapVMRouter. Every Tracer program is built from three stock instructions — Salt (0x02), Deadline (0x20) and Extruction (0x04) — and all of Tracer's pricing lives behind the Extruction target. There are no custom opcodes and no forked router. See Running on the official router.

The three legs

A series is three Aqua strategies, all shipped from the writer's vault by VarianceSeriesFactory.createSeries:

ISSUE   Salt(id,1) · Deadline(saleEnd) · Extruction(engine, [1,1,id])     USDC → receipts
EXIT    Salt(id,2) · Deadline(expiry)  · Extruction(engine, [1,2,id])     receipts → USDC   + burn hook
SETTLE  Salt(id,3) ·                     Extruction(engine, [1,3,id])     receipts → USDC   + burn hook

Each of EXIT and SETTLE is shipped with a virtual USDC balance covering the whole capped liability, but both draw on one real balance — the writer's vault. That is safe because either path burns the receipt it is paid for: a unit can be exited or redeemed, never both. The engine bounds every payout by the liability that burn releases, so the two virtual allocations can never both be spent on the same unit.

What is deployed

ContractResponsibility
AquaSwapVMRouterThe official router, deployed unmodified from the upstream source
VarianceSeriesFactoryController: validates and creates series, ships all three strategies, owns every reservation
TracerMarketEngineThe Extruction target that prices ISSUE, EXIT and SETTLE
TracerMakerVaultOne per writer. Deterministic address, no admin, no upgrade path, no rescue function
VarianceAccumulatorBounded permissionless checkpointing of the observation window, and permissionless finalization
VarianceReceiptPer-series ERC-20. Its router-only maker hook burns every unit that leaves through EXIT or SETTLE
TracerSeriesDeployerCREATE2 deployer for vaults and receipts, so a vault address is a pure function of its writer
TracerLensBatched read model: live quotes, vault state, oracle progress, leg status
TracerProgramsStateless read model for the raw orders, programs and ship plans
RealizedVarianceOracleTrailing realized variance for the LVR tools and VarianceSpread

Every constructor dependency must contain code, and the Lens verifies at construction that the controller, engine, accumulator, deployer and router all agree about each other. Contracts are immutable and non-upgradeable.

Components

ComponentWhat it does
contracts/ (Foundry)The contracts above, the pricing library and its 60-digit reference vectors, unit and invariant suites, and a Base-fork adversarial demo
backend/ (Rust, axum, :8787)Indexes controller / router / Aqua / vault events, caches Chainlink rounds, replicates realized variance and the market quote off-chain for charts, serves the JSON read model. Holds no keys and sends no transactions.
subgraph/ (The Graph)Indexed historical entities—fills, checkpoints, finalization, vault activity and receipt balances; never the authority for live executable quotes or balances
web/ (Next.js 16, :3000)Markets, the series terminal, the write flow, portfolio, the LVR calculator and these docs. Live quotes and wallet actions go straight to the Lens and the router through viem/wagmi; history comes from the backend.

The Lens and the on-chain quotes are authoritative. The backend is a replica: when the two disagree, the chain is right and the backend is stale.

Deployer metadata

Values below are read from web/src/config/deployment.json for the chain this build targets.

Deployer MetadataValue
NameTracer
ChainTracer Fork (31337) — not deployed
Aqua0x0000000000000000000000000000000000000000
AquaSwapVMRouter0x0000000000000000000000000000000000000000
VarianceSeriesFactory0x0000000000000000000000000000000000000000
TracerMarketEngine0x0000000000000000000000000000000000000000
VarianceAccumulator0x0000000000000000000000000000000000000000
TracerSeriesDeployer0x0000000000000000000000000000000000000000
TracerPrograms0x0000000000000000000000000000000000000000
TracerLens0x0000000000000000000000000000000000000000
RealizedVarianceOracle0x0000000000000000000000000000000000000000
USDC (quote token)0x0000000000000000000000000000000000000000
Chainlink ETH/USD feed0x0000000000000000000000000000000000000000
WETH0x0000000000000000000000000000000000000000
Deployment block0