# BlazePhoenix-Dex Whitepaper v2.4.0 — part 2 of 9: Part I — The problem and the discipline > One part of the whitepaper in llms.txt form; every part and every section is listed in > https://blazephoenix.xyz/whitepaper/llms.txt. The parts are the full text, unabridged: the bodies of parts > 1-9, joined in order, are https://blazephoenix.xyz/whitepaper.md byte for byte (sha256 a47389f947e4aa6656f693004e43fbe3e0101dccaf133e49c303767811f223cc). > Cite as https://doi.org/10.5281/zenodo.24517342; numbering (§, E, INV-) as in the paper. ----- verbatim text of whitepaper.md follows ----- ## Part I — The problem and the discipline ## §1 The problem: a quote is a promise someone else computed Imagine selling a car in a city with twenty dealers. A good broker visits all twenty, finds the best price, and perhaps splits the sale across two of them. Most on-chain "brokers" check prices on their own database — possibly stale — and show you a result. You cannot verify that they looked at all twenty, or that they showed you the best one. You can only verify that they have, so far, been honest. Every aggregator whose documentation we read — 1inch, CoW Swap, Velora (ParaSwap), KyberSwap, OpenOcean, Jupiter and UniswapX, as documented on 2026-09-07 (survey not re-checked for this edition) — works this way: a service computes the route off-chain and the contract executes the route it is handed. The contract does not choose; it checks. That is sound engineering — it is why those systems are fast and cheap — and it has one consequence rarely stated plainly: **the strongest claim such a system can make is that its operator is honest.** The gap is not usually fraud. It is drift, from three ordinary sources. The quote was computed against reserves that moved before the transaction landed. The search was only as exhaustive as the operator's budget. And every correction between quote and fill — a slippage buffer, a fee on the way — was applied by code the user did not read, to a number the user cannot reproduce. None of that requires bad intent. All of it is invisible. ### §1.1 The fragmentation is real, and shallower than it looks A trader who wants the best price faces a paradox. The liquidity exists, spread across dozens of decentralised exchanges, each with its own pool contracts, its own pricing curve, its own address scheme — but no single venue holds it all. The price of best execution is the cost of speaking every exchange's language at once, and of trusting every translator between the price shown and the trade that lands. The incumbent answer integrates venues one at a time: a connector for Uniswap, another for the Solidly forks, another for each concentrated-liquidity variant, each with bespoke quoting, bespoke address lookups, bespoke execution. The integration surface grows linearly with the number of venues, and every connector is a fresh place for a pricing defect or a silent mismatch between the number quoted and the number executed. The fragmentation is shallower than it appears. Beneath the surface diversity, the automated market makers that hold most on-chain liquidity are governed by a small set of invariants. Constant-product pools obey $x \cdot y = k$. Concentrated-liquidity pools track a square-root price in fixed point over a piecewise-constant active liquidity. The Solidly family obeys a quartic, $x^{3}y + xy^{3} = k$, on its stable pairs and constant product on its volatile ones. There are a handful of shapes, not sixty. If the shapes are few, the cost of aggregation need not grow with the number of venues; it need only grow with the number of shapes. A protocol that implements each shape once, correctly, and dispatches every venue to the right one collapses the integration surface from linear to constant. Adding a venue stops being engineering and becomes configuration: assign a kind and an address-derivation mode, and the existing mathematics prices it, the existing router settles it, the existing registry learns it. **The central claim of the design:** every venue BlazePhoenix routes through is a parametrisation of one of a small family of output functions — four working families across a six-kind taxonomy (§4) — held once, in a single stateless library, and never redefined. Adding a venue means assigning a kind and a derivation mode, not writing new pricing code. ### §1.2 The off-chain escape hatch The prevailing aggregator architecture quotes routes on a fleet of servers, runs an auction among off-chain solvers, indexes pool liquidity with keeper bots, and ships the result to a thin on-chain settlement contract — frequently behind an upgradeable proxy whose admin key can replace the logic outright. A web service produces the price, a database holds the liquidity graph, a privileged operator can change the rules, and the chain becomes a settlement venue for decisions made elsewhere, by software the user cannot see and cannot verify. That arrangement reintroduces exactly the trust the technology was meant to remove. An off-chain quote can differ from the on-chain fill, and the user cannot prove that it should not have. A keeper can go dark and the router goes blind. A proxy admin can, in one transaction, turn an honest contract into a hostile one. | Concern | Off-chain-solved aggregator | BlazePhoenix-Dex | |---|---|---| | Quoting | Off-chain servers or a solver auction | One on-chain dispatcher, shared by the preview and by in-frame execution | | Liquidity discovery | Keeper bots index and push lists | Self-Healing Registry — liquidity learned by trading it — plus deterministic discovery | | Route selection | Proprietary off-chain optimiser | On-chain Solver, reproducible by anyone from public state | | Upgrade surface | Admin-controlled proxy | Stateless Core; no proxy, no upgrade path, no `selfdestruct` | | Privileged power over funds | Often present | The Router holds no user balance at rest (only a fee share a token refused to deliver, owed to its treasury slot); no function moves user principal | | Cross-chain consistency | Per-chain backend logic | One bytecode per chain | | Trust assumption | The operator's honesty | The user's own minimum, which the contract refuses to accept as zero | BlazePhoenix rejects both halves of the bargain. It refuses the linear integration surface by showing the surface is not linear, and it refuses the off-chain escape hatch by keeping the entire decision — discovery, quoting, scoring, routing and settlement — inside contracts anyone can read that produce the same answer on every chain. The cost is real: quoting a concentrated pool on-chain is more expensive than reading it from a database. What the cost buys is the removal of one class of failure — the silent, unprovable divergence between what a server promised and what the chain delivered. Every design decision that follows is an instance of that trade. ## §2 The answer and the discipline **The thing that chooses is the thing that trades.** BlazePhoenix-Dex has an entry point that takes six values — the two tokens, the amount, your minimum, a recipient, a deadline — and works out the route inside the transaction that executes it, from pool reserves that are public state: which venues, how much to each, in what order. Because the route was derived from public state by public code, anyone can re-derive it. Because the number that binds at settlement is re-derived by the same dispatcher, in the same frame, from the same live state, the quote and the execution are not two artefacts to reconcile; they are one computation, and what separates a preview from a fill is time, not a second model. Three further entry points accept a pre-computed route from calldata, for callers who want the cheaper path and are willing to supply their own answer; the same measurement, floor and settlement machinery applies to all four doors (§11). We do not claim the off-chain approach is wrong, and we do not claim to be cheaper. We claim a different class of guarantee — auditable rather than promised — for the user who wants it and will pay gas for it. Four decisions in this design are, as far as we can establish, unusual in the field, and each is stated with the boundary that keeps it honest. - **Addresses are derived, not fetched.** Wherever a venue family's deployment is reproducible, a pool's address is computed by CREATE2 arithmetic — a theorem anyone can recheck from three public inputs — rather than read from a factory's storage; where the arithmetic is not sound, the protocol asks, and an asked pool proves its own pair before it is listed (§7). - **A pool's routing state is one word.** The Monoslot packs everything needed to rank a venue into a single 256-bit slot and deliberately contains no price, so the registry's memory can bias which pools are asked but is structurally incapable of pricing a trade (§8–§9). - **The floor is re-derived from the trade that actually happened.** The Router measures each leg's realised impact and each hop's realised concentration inside the executing frame and recomputes its floor from those measurements, so caller-supplied fields can tighten protection and never loosen it (§11). - **Discovery is deployer-blind where venues have no addresses.** For the Uniswap V4 singleton, pool identifiers are derived from public parameters and then proven live against the manager's own storage — a proof nobody else can write (§5). None of these removes the residual every aggregator carries — state can move between signature and inclusion — which is why the minimum you set yourself is mandatory, and final: every door refuses a zero minimum with `RouterE(10)` before a token moves. One law sits under the four decisions and under everything in this chapter: no permissionless datum may choose a venue's shape or domain, the `(factory, init-code-hash)` pair that identifies it, or lower a floor; security parameters come only from an immutable or a sealed source, and what a proposer supplies are coordinates that the contract measures on chain and fails closed on. §2.1 to §2.3 state the method that follows from it, and §2.4 to §2.9 state the six working rules it has produced, each with the guard that enforces it. ### §2.1 Invariant-driven design Behind the answer sits a method. We call it invariant-driven design: the protocol is specified not as a sequence of operations but as a set of properties that must hold in every reachable state, with the code organised so that those properties are structural — enforced by the shape of the code, not by the vigilance of the programmer. Most software is written imperatively, and correctness is an emergent hope. For ordinary software that is acceptable, because failures are recoverable. On a public blockchain none of that holds: code is immutable once deployed; it custodies value directly; it executes in an adversarial environment where every edge is hunted; and a single arithmetic slip is an irreversible loss, not a crash. An invariant is a property that is true regardless of how the system reached its state. *The Router holds no user funds between transactions; the only balance it keeps is a fee share a token refused to deliver.* *A registry pair holds at most sixteen pools, and eviction keeps the fittest sixteen.* *A settlement that paid no protocol fee does not exist.* Three principles put such statements at the centre: | Principle | Statement | Where it appears | |---|---|---| | Compute, don't trust | Where a value can be derived or proven, never fetch or assume it. | 𝒟 computes pool addresses; the Router re-derives fee base and floor in-frame from measured balances. | | One source of truth | Every mathematical primitive is defined once and imported; never restated. | The Core holds all pricing, derivation, floor and scoring mathematics; Hub, Solver, Router and Quoter import it and none redefines a primitive. A shared-quantity register (§15) grades every quantity with two producers. | | Fail closed | When a property cannot be established, halt rather than proceed on a guess. | The Solver returns no route rather than a fabricated one (`SolverE(5)`); the stable solver returns zero rather than a saturated quote (§6); the registry's coherence guard reverts a structurally impossible venue before any state is written (§9). | A fourth principle governs custody: **no privileged path to funds.** The Solver and Quoter are read-path contracts; the Router is the only contract that moves money, it moves it atomically under the user's own bound, and every administrative power that could redirect it can be permanently surrendered through the One-Way Door (§14). ### §2.2 Why this discipline fits this medium Each property of the environment that makes imperative code dangerous is a property invariant-driven code turns to advantage. Immutability rewards provability: deployed code cannot be patched, so the value of an up-front proof is correspondingly high. Composability rewards a single source of truth: a pricing function may be invoked inside a vault its authors never anticipated, and with one Core every caller gets the same answer. Adversariality rewards failing closed: an attacker needs only one path the author did not consider, and a system that halts when its assumptions break denies them the improvisation. Value at stake rewards legibility: a protocol expressed as five named operators over one mathematical core can be checked line by line by people who did not write it. The discipline is not free, and the trade is deliberate: proving an overflow bound takes longer than assuming it away; routing every product through a full-precision multiply-divide costs gas a naïve multiply would not; deriving an address costs engineering that fetching one skips. That is more cost before deployment in exchange for removing the failures that cannot be recovered after it. ### §2.3 Metrological Design: one morphism, measured coordinates Invariant-driven design says what must always hold. Further rules say how the code that upholds it is *shaped*, and together they form a method we have not found named elsewhere in the field, so this paper names it: **Metrological Design** — building a contract as an *instrument*. Its thesis in one line: *code that believes is attack surface; code that measures is defence.* **The unifying law and the measurement principle.** No permissionless datum may choose a shape, a domain or a `(factory, init-code-hash)` pair, or lower a floor; a security parameter comes only from an immutable or a sealed source, and whatever a proposer supplies is a coordinate the contract measures on chain and fails closed on. The working form of the law is the measurement principle: the contract never acts on a modelled, nominal or assumed value when an on-chain measurement exists. The principle has three corollaries. First, a measurement is sampled where the attacker does not control the sampling: a value the attacker can set at the moment you read it is a claim, not a measurement. Second, the absence of a measurement is not a value: an empty, zero or missing read is a fact about the source, so the candidate is dropped or refused and never replaced by a default. Third, the instrument must be fixed or observable: a mutable instrument with no event measures the wrong place, so an instrument is compiled in, or its change is visible before it takes effect (§4.5). **One morphism, evaluated at a point.** The aggregator does not contain an integration per venue; it is the evaluation of one parametrised pricing morphism at a point of the space (venue shape, chain, fee model). Expressed as branches, half a dozen live venue kinds with their own fee conventions multiply into hundreds of pairwise combinations — multiplicative bytecode, multiplicative audit surface, multiplicative drift. Expressed as a morphism, the same coverage is a handful of *state shapes*, one stateless Core, fee conventions carried in their native units, and registration tables — and the bytecode grows *additively*: a new venue is a row, not a branch. The rule that guards the collapse is `KIND → SHAPE`: a venue family is *data* — a kind assigned to an existing shape and a derivation mode — never a new code path that adversarial input gets to select. The Core states the shapes as a bit table (`THETA_ATTR`, §4), so "does this kind read reserves?" is a shift and an AND, and there is no default branch for anyone to forget. The collapse has a brake: there is no single universal formula. Two closed forms are evaluated exactly — constant product and concentrated liquidity — and for every curve where replication would be a liability, the venue's own bytecode is asked (§6). The morphism collapses *membership*, never *verification*. **Coordinates are measured, never believed.** The contract never acts on a modelled, nominal or caller-supplied value where an on-chain measurement exists — and no permissionless datum ever chooses which code runs. Data supplied by an untrusted party — a route, a declared fee, a claimed depth, a pool id — are *coordinates*: places to point the instrument, which the contract then reads for itself, fail-closed. Every load-bearing defence in this paper is an instance: the post-pull balance measured instead of the nominal amount (§11), the fee base taken from a measured balance delta instead of from calldata (§13), the believability band anchored on a depth-weighted median of measured depths instead of on a raw balance a donation can inflate (§10), the capacity clamp cut against measured holdings (§10), the V4 fee gate reading live state instead of trusting a sentinel (§5), proof-of-existence discovery reading the singleton's own storage (§5), and an asked pool proving its own `token0`/`token1` before discovery lists it (§7). The repository publishes the classification of every caller-writable field under this rule: 25 rows (18 distinct field names, some listed once per pool family), 17 confirmed against an observation, 5 steering, 3 declared with the reason (§15; `docs/assurance/fields.json`). **Where measurement ends.** Some numbers can be neither measured nor re-derived: a caller's floor, a caller's declared scale, the caller's own minimum. §2.4 states the three legal exits for such a number and the one that applies when measuring is impossible. Metrological Design governs the engineering around the artefact too, because an instrument is only as good as its calibration. Safety margins are priced from measured hazards: the split gate sits at 25 ppm (`MIN_SPLIT_IMPROVEMENT_PPM`), about eight times the 3 ppm that an extra leg's 320 bytes of calldata cost on Base (§10). External comparisons carry their method's error bars or are not printed (§17). And the measuring apparatus is itself measured: each assurance instrument was calibrated against a defect already known by another route before its number was printed (§15). That is the whole theory; the rest of this document is its practice. ### §2.4 Measure, re-home, or make lying costly Some numbers enter the system from a caller and cannot be measured by the contract: the minimum a caller will accept, the scale a caller declares, the route a caller proposes. The discipline allows exactly three exits for such a number, and no fourth. 1. **Measure it.** Read the quantity from the pool, from a balance delta, or from a derivation, and discard the claim. This is the first exit and the one used wherever a measurement exists (§2.3). 2. **Re-home it.** Move the quantity to a source the caller cannot write: an immutable constant, a value sealed at construction, or a record only the protocol's own code can update. The parameters that bound security (the floors of §11, the arming delay of §4.5, the registry caps of §9) live here. 3. **Make lying costly.** Accept the caller's number and design the function that consumes it so that a false value can only hurt the party who supplied it. The third exit is the least obvious and the one worth deriving. Let $c^{\ast}$ be the value the caller would honestly choose, let $C$ be the values the caller is able to pass, and let $G(c)$ be the guarantee the protocol makes to everyone else when $c$ is passed. The function is *monotone against the caller* when $$ G(c) \;\geq\; G_{0} \quad \text{for every } c \in C, $$ where $G_{0}$ is the guarantee that holds with no caller input at all, and the caller's choice can only move the outcome *toward* the caller's own loss. The settlement floor is the concrete case. The Router delivers at least $\max(F,\, m)$, where $F$ is the protocol floor computed from measured quantities (§11) and $m$ is the caller's `userMinOut`. Since $\max(F, m) \geq F$ for every $m$, no choice of $m$ lowers the protocol floor. Since $\max(F, m)$ is non-decreasing in $m$, a larger $m$ only adds a revert condition the caller imposed on its own trade, and a smaller $m$ falls back to $F$. A caller who lies about $m$ therefore moves only its own result. The repository states the two halves as invariants, `invariant_DeliveredNeverBelowTheProtocolFloor` and `invariant_DeliveredNeverBelowUserMinOut` (Router invariant suite, DEX commit 969bcc6). The consequence is practical. A monotone input may be computed anywhere (in the interface, in a script, by an agent) without moving trust, because the contract does not rely on the computation being honest. This is why the minimum a person sets is the one bound no interface can take from them (§3.2), and why the order in which exits are tried matters: measure first, re-home second, and reach for monotonicity only when the number is the caller's by nature. ### §2.5 One question, one producer The defect class this architecture is most exposed to is not a missing check. It is two components answering one question in two frames: a planner and an executor, a preview and a delivery, a quote and a fill. Each answer can be individually right and the pair still disagree. The rule is that a quantity with more than one producer or consumer is written in a register, with the *question* it answers, and the register says what binds the copies: either a single producer with a CI guard forbidding a second, or a named test that asserts the producers agree and states what it pins. A CI check fails the build when a row's test does not reach the quantity the row claims to tie. At the commits this paper measures the DEX register holds 131 rows in five sections (floors and fees, registry state, identity and keys, transient state, measurement harness) and the staking register 37 rows [SHARED_QUANTITIES.md, DEX 969bcc6, STK 9958d5f]. Only totals are published here; the grading of each row is in the repository. The agreement tests are ordinary invariants, which is what makes them checkable: `invariant_encodeAgreesWithPreview` and `invariant_accountingNeverDrifts` tie the Quoter's preview to the encoded plan, and `invariant_Sq_BothSolversAnswerTheSameBytes` ties the two solver paths to one answer. The rule has a boundary, stated so it is not over-applied. Single production is for *primitives*: a quantity every consumer needs derived from the source. The predicates that decide acceptance keep their redundancy on purpose, because a refusal that two independent checks can each make is stronger than a refusal one check makes (§2.6). ### §2.6 Membership is not acceptance The Metrological Design collapses diversity into coordinates (§2.3). The collapse has a limit, and the limit is the difference between *membership* and *acceptance*. *Membership* is a read: which pools exist for a pair, which kind each belongs to, what its state is. A membership question has one answer and one producer, so it collapses into a single table and a single derivation. *Acceptance* is a gate: whether the Router may execute across a given pool, at this size, under this floor. Acceptance stays a gate with its own reads. If the two are fused, the check that a pool is *listed* silently becomes the check that it is *safe to trade*, and a coincidence that held when the two were written becomes a dependency nobody declared. A coincidence measured today is pinned by a parity test that fails when the two producers drift, and is not merged into one. The same honesty applies to pricing. There is no universal formula for every venue. The Core carries two closed forms, constant product and concentrated liquidity (§4.2); every other venue is DELEGATED, meaning the venue's own quote function is asked and its answer is bounded by the measured delta and the floor (§4.5). Unification reduces the if/else in the code; it does not remove the verification, and the paper does not claim that it does. ### §2.7 A guard that cannot fire A guard is a claim: *this input is refused*. A test that passes with the guard in place proves nothing about the guard unless the same test fails when the guard is removed. The rule is therefore structural: **every guard has a watcher.** The register holds, for each guard, one exact source line, the replacement that disables it, and the one test that must go red under that replacement. A guard without a mutant does not merge, and a one-second static check confirms that every mutant still points at exactly one line, so a refactor cannot silently orphan a watcher [AGENTS.md, rules 1-2; docs/AUDIT_METHOD.md §3, DEX 969bcc6]. Derivation of why the pairing is needed. Let $T$ be a test, $G$ a guard, and $M$ the program with $G$ removed. $T$ passing on the real program shows $T$ and the program agree. It shows that $T$ *watches* $G$ only if $T$ fails on $M$. A suite can be large and green while no test watches a given guard; the mutant is the instrument that tells the two cases apart, which is why the register is measured and not assumed. At commit 969bcc6 the DEX mutant register holds 1,895 mutants [README:270-276]. The result of running them is a campaign measurement and is given with its denominator in §15. The same pairing is applied to the stateful invariants themselves: a mutant is aimed at an `invariant_*` function that must go red under it, so the invariants are also watched and are not only believed (§15.3). ### §2.8 Fix the invariant, not the instance When a defect is found, the instance is not the finding. The finding is the invariant that failed to hold, and the instance is one place it failed. A patch to the instance restores that place and leaves every other place the same class can occur. The rule is that a fix states the invariant, places the guard where *every* instance of the class passes through it, and arrives with a test over the class rather than over the one input that exposed it: a fuzz or invariant campaign, not a fixture. The test header names the commit at which it was red, so red-before-green is checkable from the history, and the guard gets its mutant (§2.7). N instances of one class therefore resolve with one fix, one test over the class and one watcher, and the next instance of the class is refused by construction. ### §2.9 Verifying beats solving; measuring beats recomputing Two laws sit under the meta-equation of §3. **Law 1: verifying beats solving.** The Solver returns a plan $\hat a \approx a^{\ast}$, where $a^{\ast}$ is the argmax of the meta-equation $D(x,s)=\arg\max_a\,[\mu(a)-\gamma\,g(a)]$. Finding $a^{\ast}$ is an approximate search over routes and splits. The constraint the Router enforces is different in kind: the delivered amount against the floor, measured from balance deltas. That check is exact and costs O(1) in the size of the search. The safety predicate $S(\hat a)$ is evaluated on $\hat a$ itself and does not mention $a^{\ast}$. Hence for any $\hat a$ that passes $S$, settlement is safe; and $\mu(\hat a) \leq \mu(a^{\ast})$ means an imperfect search costs *price*, never *safety*. This asymmetry, exact verification against approximate search, is what lets the system be safe while its routing is imperfect, and it is why the paper never claims the route is optimal: it claims the route is checked. **Law 2: measuring beats recomputing.** A leg is opened only while its marginal output exceeds its marginal cost, $\partial\mu > \gamma\,\partial g$, using the marginal output measured at the point of the split. There is no fixed threshold and no magic constant to choose; the stopping rule is the inequality, evaluated on measured quantities. The one numeric gate the split carries, `MIN_SPLIT_IMPROVEMENT_PPM = 25`, is a margin priced from a measured break-even (§2.3, §10), not a tuned limit. Section 3 states the equation, the dependency budget that follows from it, and the three edges where the claim stops. ## §3 The Meta-Equation and the dependency budget The whole aggregator can be read as the maximisation of one expression. Given an input token $t_{\mathrm{in}}$, an output token $t_{\mathrm{out}}$ and an amount $x$, the Solver searches the admissible routes for the one maximising net received value, subject to a feasibility floor and an anti-scam gate: $$ R^{\star} \;=\; \mathrm{arg\,max}_{\;R \,\in\, \mathcal{R}_{\mathcal{D}}(t_{\mathrm{in}},\, t_{\mathrm{out}},\, x)} \;\; \mathrm{net}(R)\cdot \mathbf{1}[\,\mathrm{net}(R) \ge \Phi(R)\,]\cdot \Xi(R) $$ ^e1 $$ \mathrm{net}(R) \;=\; \sum_{\ell\in R}\Omega(p_{\ell},\, x_{\ell})\;-\;f_{\mathrm{proto}} $$ Here $\mathcal{R}_{\mathcal{D}}$ is the route space over pools located by the Deterministic Derivation 𝒟 and the registry; $\Omega(p_{\ell}, x_{\ell})$ is the dispatcher's output for leg $\ell$ pushing $x_{\ell}$ through pool $p_{\ell}$; $f_{\mathrm{proto}}$ is the protocol fee; $\Phi(R)$ is the Iron-Law floor for the route's measured impact and concentration; and $\Xi(R) \in \{0, 1\}$ is the anti-scam projector. | Operator | Name | Role in the equation | Section | |---|---|---|---| | Ω | Eightfold Dispatcher | Prices each leg — one branch per pool kind — and reports a token-denominated depth for the split allocator | §4 | | 𝒟 | Deterministic Derivation | Locates the pools the route uses, by computed address where the family permits it, by proven pool id for the V4 singleton | §5, §7 | | Φ | Iron-Law floor | Projects the route onto the feasible set: a floor under net output, re-derived in the executing frame | §11 | | Ψ | Vitality Field | Orders the probe and the registry's eviction, from earned quality read from the pool's packed on-chain state; never a factor in the output | §9 | | Ξ | anti-scam projector | Values any route that is unsafe to surface at exactly zero | §5, §14 | The factorisation is deliberate. Ω answers *how much a pool returns*; Ψ answers *in what order to probe it, and whom to evict first*; Φ answers *whether the route is admissible*; 𝒟 answers *where the pool lives*; Ξ answers *whether the route is safe to show*. The product form means a single failing leg collapses the route's score — a leg that quotes zero zeroes the route — and the indicator hard-zeroes any route whose net output falls below the floor. No soft penalties, no tunable weights, no near-miss route sneaking through. ![FIG-1 — The Meta-Equation as the Solver pipeline](https://blazephoenix.xyz/whitepaper/figs/v2.4/fig-1.svg) *FIG-1 — The Meta-Equation as the Solver's pipeline: candidates from 𝒟 and the registry, probed and quoted by Ω, cut by weight to the leg budget, allocated across legs, checked against Φ and Ξ; the Router re-evaluates Ω and Φ in the executing frame.* On chain, the Solver realises the equation as a pipeline (`findBestRoutePlan`): candidates per pair are gathered by the registry and, when the registry is not fresh, by 𝒟; ordered by Ψ, which fixes only the order of the probe (no count cuts the list: every candidate is probed and quoted by Ω, and dust is measured against the pair, §10); filtered by a believability band; cut by weight to the leg budget, `MAX_LEGS_PER_HOP` = 5 per hop, after the probe [checked in code: S:612-618, S:888-892, C:149]; allocated across legs; and the assembled route carries the floor Φ attests. The Router then re-evaluates Ω and Φ on the amounts that actually arrived. The claim the equation makes — the one an auditor can hold the code to — is that the code that pipeline runs is listed in §4-§11. Ψ only orders the probe; it never decides which candidate is quoted. ### §3.1 The dependency budget Instead of adjectives — the usual ones have stopped carrying information — here is the checkable list: everything that must exist, and keep working, for one trade to settle. | Dependency | Typical off-chain-solved aggregator | BlazePhoenix-Dex | |---|---|---| | A service that computes the route | Required | Not used — the Solver is a `view` function any node serves | | A price oracle or feed | Varies | None — no feed call exists in the seven contracts | | A solver network or auction | Common | None | | A keeper, cron or relayer | Varies | None — vitality decays by arithmetic when next read; the registry learns from ordinary trading | | An upgradeable proxy | Common | None — no proxy, no `selfdestruct`, no upgrade initialiser: the Hub's one-shot `initialize` (admin-only, refused after renunciation) wires the V4 manager once; the only `delegatecall`s are the compiler's own into the public functions of the two stateless libraries, Core and Math, fixed at link time (§26.5) [checked in code: Core:3025, 3061, 3535; Hub:1740; Math:20-23; Solver:790-795] | | A hosted interface | In practice yes | Convenience only | The last row is where most budgets quietly fail. The hosted interface is a convenience, not a dependency: `swapBestExactIn` takes six values a person can assemble by hand, and an integrator, a script, or a competitor's front end can call it with no relationship to us of any kind. If every server this project operates disappeared tonight, the contracts would quote, route and settle tomorrow on any node, with no server of ours in the path. The cost of that property is that the caller pays for the search in gas; the budget above is the list of things that gas buys out. Immutability cuts the other way too. A defect cannot be patched — the price of a contract that cannot change — which is why defects are disclosed and bountied instead (§21). ### §3.2 Three edges The budget has three edges, stated next to the claim they bound. The interface is hosted, like everyone's, and a compromised front end is the single largest exposure in the threat model: the contract honours whatever non-zero minimum it is handed, so the minimum you set is the one bound no interface can take from you. Venue discovery reads state that earlier transactions wrote — public and permissionless, but not conjured at trade time. And administrative powers exist until renounced through the One-Way Door, which refuses while paused. After renunciation the control tier is gone for ever: in the Router, admin, treasury assignment, Permit2, WETH, pause and rescue; in the Hub, pause, roles, wiring and removals; in the Gate, clearing or replacing an adapter family that was ever live. What remains is grow-only curation of venues and the payee's own slot: each treasury may move its slot and claim the fees that slot is owed (§14). Stateless core, serverless operation, grow-only governance: the table is the claim; the words are its shadow.