Seven contracts. One mathematics.
DEX V2 is seven contracts, built the same way throughout: a pure-math library at the base, imported by the working contracts, so no number is ever redefined and nothing trusts a value it did not compute. Five of them run today as DEX V1; V2 adds the Gate and the Math library. The staking engine is a separate engine, built on the same discipline. Every address below is the real, verified DEX V1 deployment on Base; the deployments on Ethereum, Optimism, Arbitrum and Robinhood Chain are listed per chain in /verify.
Version note: this map is DEX V1 (1.0.0), the version live today. DEX V2 (2.0.0) launches on 15 December 2026 with 7 DEX contracts — Core, Gate, Hub, Math, Quoter, Router, Solver — and its addresses are published at deployment.
DEX V2 launches 15 December 2026 on: Ethereum, Base, Optimism, Arbitrum One, Robinhood Chain, Avalanche C-Chain. DEX V1 (1.0.0) stays live for testing until then.
Live today: the Aggregator Pentad of DEX V1
5 core contracts“Five contracts, one of which is pure mathematics imported by the other four.” The Core computes; the Hub remembers; the Solver decides; the Router settles; the Quoter previews. Each exposes a single compact error path, keeping the revert surface as legible as the happy path.
Ω · 𝒟 · Φ · ΨNo storage, no owner, no upgrade path — only functions. The Eightfold Dispatcher Ω, Deterministic Derivation 𝒟, Iron Law Φ and Vitality Field Ψ live here as pure computations. Ω is Eightfold by house name: the kind enumeration it dispatches over now carries nine entries, and three of the numbers — 2, 3 and 7 — are absent by deliberate excision, which is a security decision and not a gap. Imported by the other four; no math is redefined anywhere else.
Ψ · registryHolds the Self-Healing Registry — 16 packed slots per pair, one Monoslot per pool, one SLOAD to read it — plus the vitality field’s persistent state and the bridge-token set. Entries are coherence-checked on the way in and namespaced under ERC-7201, so its storage can never collide with a consumer’s slots.
𝒰(route)A pure read-path optimiser that maximises the meta-equation over routes and touches no state it cannot derive. It splits across venues in proportion to depth under a capacity clamp, and collapses back to a single leg the moment splitting stops paying. It decides; it never settles.
Φ · executeThe single contract that moves value, and it moves it atomically. It measures what actually arrived rather than assuming, runs each leg through the venue-appropriate primitive — the One-Callback Doctrine for V3-shaped venues, the unlock dance for V4 — then recounts its real balance deltas and re-derives both the Iron Law floor and the fee base from measured execution, so a poisoned frontend can lower neither. Holds nothing at rest.
previewPlanMirrors the Solver’s selection for off-chain callers over eth_call, and can take a pool-exact reading by dry-run revert-extraction — the Exact Pass, the venue’s own swap run and rolled back. The preview is advisory by design: what binds is what the Router re-derives in-frame, so an integrator sets its minimum from its own price expectation, never from a preview field.
DEX V2 adds two: the Gate and the Math library
2 contracts · pendingDEX V1 is five contracts. DEX V2 is seven: the same five roles, plus the Gate and the Math library. Their addresses are published at deployment.
wrap · measureThe Gate stands in front of venues the Core cannot read natively. It is a CREATE2 factory of thin wrappers: each wrapper looks like a Uniswap-V3 pool to the Router and forwards the input it was paid to the adapter of its family, which trades on the real venue. A wrapper is immutable and has no proxy; it holds no token between calls.
per-hop choiceThe library that makes each hop’s choice for the Solver: where the market is, how the order splits, and who takes the remainder. The Solver delegatecalls it once per hop that has two or more candidates, and pins its codehash in its constructor: against any other build, the Solver refuses to deploy.
Adapters: one per venue family
An adapter is the small contract that speaks one family of venues. The Gate keeps one adapter per family, with its code pinned by codehash, and every swap checks that pin again.
- Identity is derived
- A wrapper's address comes from a formula over the Gate, the two tokens and the venue key. The Hub finds it with the same formula it uses for every V3 factory, never because a caller named it.
- Custody is the measured delta
- The wrapper forwards exactly what it measured arriving, requires that the adapter ends up holding no more of either token than before, and counts the output as the amount measured at the recipient, never a value the adapter reports.
- Execution does not trust the quote
- The swap path never reads the quote; the floors that bind are the Router's.
An adapter enters the registry by proposal, a 48-hour wait, then acceptance. Its code is scanned for DELEGATECALL, CALLCODE and SELFDESTRUCT when it is proposed, and acceptance checks that the code is still the one proposed. Clearing an adapter is immediate. Once control is renounced, families and wrappers can still be added, but an adapter can no longer be replaced or cleared.
Venue families reached through the Gate:
- Balancer V2
- Balancer V3
- Curve StableSwap-NG
- Curve Twocrypto-NG and Tricrypto-NG
The staking engine: the Staking Dyad
a separate engineThe same discipline, applied to the protocol's own capital: a pure-math library and the engine that imports it. Because the collateral and the borrowed asset are the same token (BZPX), no price oracle exists anywhere — an entire attack surface is absent by construction.
mulDiv · rawBalanceOfThe full 512-bit multiply-then-divide every proportion flows through, plus rawBalanceOf — the staticcall that lets the contract read its OWN backing. All-internal, so it is inlined into the engine’s bytecode (no separate address), exactly as the Core is to the aggregator.
conservesOne contract doing what most protocols split across three — vault, lending market and lock-boost — reconciled through a single UserInfo record and two accumulators, every value-moving path wrapped in the conserves guard. 90,000,000 BZPX on Base and 90,000,000 BZPX on Robinhood Chain, each with its own 8-year emission clock, launching Q2 2027; solvency is a revert condition, not a dashboard reading.
The one equation each engine stands on
The aggregator maximises a single objective over candidate routes — take the net output, but only from routes that clear the Iron Law floor, weighted by each pool's vitality:
The staking engine stands on the Master Conservation Identity — physical balance equals what the ledger owes, enforced per transaction by the conserves guard, so a hidden shortfall is unreachable, not merely observable:
== (totalStaked − totalDebt) + rewardReserve + protocolReserve
+ (totalRewardDistributed − totalRewardsPaid)
Once staking ships (coming soon), read it for free from the chain: /solvency (or isSolvent() · solvency() · auditInvariants()).
Verify the whole thing yourself
Nothing here asks for trust. Once the staking engine is deployed, its solvency is one free call (<staking> is the address published on /verify at deployment):
cast call <staking> "isSolvent()(bool)" --rpc-url https://mainnet.base.orgCode license: contracts are BUSL-1.1 until 2030 — read, audit and verify freely; production use needs a license. Partner, don't clone ›
Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz