The mathematics of BlazePhoenix: every formula, and which ones are ours

Known formally as Invariant-Driven Design in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · updated 2026-07-18 · 9 min · written from the deployed bytecode

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

EnglishThe complete formula set behind the protocol, marked by origin: the standard AMM invariants we compute and cite, and the originals we authored — the Iron Law Φ, the Vitality Field Ψ, the Capital-Anchored Filter, the capacity clamp and the Master Conservation Identity, each derived from the deployed bytecode.

PortuguêsO conjunto completo de fórmulas do protocolo, marcado por origem: os invariantes AMM padrão que calculamos e citamos, e os originais que criámos — a Iron Law Φ, o Vitality Field Ψ, o Capital-Anchored Filter, o capacity clamp e a Master Conservation Identity, cada um derivado do bytecode implantado.

EspañolEl conjunto completo de fórmulas del protocolo, marcado por origen: los invariantes AMM estándar que calculamos y citamos, y los originales que creamos — la Iron Law Φ, el Vitality Field Ψ, el Capital-Anchored Filter, el capacity clamp y la Master Conservation Identity, cada uno derivado del bytecode desplegado.

FrançaisL'ensemble complet des formules du protocole, marqué par origine : les invariants AMM standard que nous calculons et citons, et les originaux que nous avons créés — l'Iron Law Φ, le Vitality Field Ψ, le Capital-Anchored Filter, le capacity clamp et la Master Conservation Identity, chacun dérivé du bytecode déployé.

DeutschDer vollständige Formelsatz des Protokolls, nach Herkunft markiert: die standardmäßigen AMM-Invarianten, die wir berechnen und zitieren, und die von uns verfassten Originale — das Iron Law Φ, das Vitality Field Ψ, der Capital-Anchored Filter, der Capacity Clamp und die Master Conservation Identity, jeweils aus dem deployten Bytecode abgeleitet.

РусскийПолный набор формул протокола, размеченный по происхождению: стандартные AMM-инварианты, которые мы вычисляем и цитируем, и оригиналы нашего авторства — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp и Master Conservation Identity, каждый выведен из развёрнутого байткода.

TürkçeProtokolün ardındaki tam formül seti, kaynağa göre işaretlenmiş: hesaplayıp atıf verdiğimiz standart AMM değişmezleri ve bizim yazdığımız orijinaller — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp ve Master Conservation Identity; her biri dağıtılan bytecode'dan türetilmiş.

العربيةمجموعة الصيغ الكاملة وراء البروتوكول، موسومة بأصلها: ثوابت AMM المعيارية التي نحسبها ونستشهد بها، والأصليات التي ألّفناها — Iron Law Φ وVitality Field Ψ وCapital-Anchored Filter وcapacity clamp وMaster Conservation Identity، كلٌّ مشتق من البايتكود المنشور.

हिन्दीप्रोटोकॉल के पीछे का पूरा सूत्र-समूह, मूल के अनुसार चिह्नित: मानक AMM इनवैरिएंट जिन्हें हम गणना कर उद्धृत करते हैं, और हमारे रचे मौलिक — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp और Master Conservation Identity, प्रत्येक तैनात बाइटकोड से व्युत्पन्न।

日本語プロトコルを支える完全な式の集合を出自ごとに明示:私たちが計算し引用する標準AMM不変量と、私たちが著した独自式——Iron Law Φ、Vitality Field Ψ、Capital-Anchored Filter、capacity clamp、Master Conservation Identity。いずれもデプロイ済みバイトコードから導出。

中文协议背后的完整公式集,按来源标注:我们计算并引用的标准 AMM 不变量,以及我们原创的公式——Iron Law Φ、Vitality Field Ψ、Capital-Anchored Filter、capacity clamp 与 Master Conservation Identity,每一条都从已部署的字节码推导。

한국어프로토콜을 떠받치는 전체 공식 집합을 출처별로 표시: 우리가 계산하고 인용하는 표준 AMM 불변식과 우리가 저술한 원본 — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp, Master Conservation Identity, 각각 배포된 바이트코드에서 유도.

Bahasa IndonesiaKumpulan rumus lengkap di balik protokol, ditandai menurut asal: invarian AMM standar yang kami hitung dan kutip, serta orisinal yang kami tulis — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp, dan Master Conservation Identity, masing-masing diturunkan dari bytecode yang di-deploy.

বাংলাপ্রোটোকলের পেছনের সম্পূর্ণ সূত্র-সেট, উৎস অনুসারে চিহ্নিত: প্রমিত AMM ইনভ্যারিয়েন্ট যা আমরা গণনা করি ও উদ্ধৃত করি, এবং আমাদের রচিত মৌলিকগুলি — Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp ও Master Conservation Identity, প্রতিটি ডিপ্লয় করা বাইটকোড থেকে উদ্ভূত।

FilipinoAng kumpletong set ng pormula sa likod ng protocol, minarkahan ayon sa pinagmulan: ang standard na AMM invariants na kinukuwenta at sinisipi namin, at ang mga orihinal na sinulat namin — ang Iron Law Φ, Vitality Field Ψ, Capital-Anchored Filter, capacity clamp at Master Conservation Identity, bawat isa'y hinango sa naka-deploy na bytecode.

BlazePhoenix is invariant-driven, not imperative. An imperative router is a script: do this, then this, hope the state cooperated. An invariant-driven system is a set of equations the code is only allowed to satisfy — the floor MUST hold, the books MUST balance, the address MUST derive — and any execution that would violate one reverts itself. This is our design authorship: the safety lives in mathematics the chain enforces, not in control flow a developer remembered to write. Below is the full formula set, marked by origin. Standards we compute and cite; originals we derived and own (© 2026 BlazePhoenix).

Standard invariants we compute (and cite)

The Eightfold Dispatcher Ω evaluates eight AMM species. Where a closed form is the truth we compute it directly; where only the pool's own bytecode is honest (Curve, Solidly) we ask it. The constant-product branch (Uniswap V2 and forks), with reserves x (in), y (out) and fee f in basis points:

Δy=Δx(10000f)yx·10000+Δx(10000f)
Standard — Uniswap V2 constant product (Adams et al.). Concentrated liquidity (V3/Algebra) uses the canonical sqrt-price SwapMath; the Solidly stable curve is k = x³y + xy³; Curve is quoted by its own get_dy. We reproduce these exactly so quote and fill cannot diverge.

The Iron Law Φ — original

The minimum-output floor is not a caller input and not a constant: the Router re-derives it on-chain at execution from the route's real measured impact ι, its leg count ℓ and a volatility term σ. It starts at 96% for a clean single-leg swap, loosens adaptively, and is hard-clamped so it can never fall below 75% (a 25% maximum loss) regardless of inputs. The caller's minOut may only tighten Φ, never relax it.

Φ=max(9600200(1)ισ1014,7500)bps
Original to BlazePhoenix (Core.ironFloorBps). The novelty is the vector: prior art bounds slippage with a single caller-supplied number; Φ makes the floor a contract-derived function of measured execution reality that the caller can only strengthen.

The Vitality Field Ψ — original

Pool fitness is a field over the packed Monoslot. Vitality v is the swap count decayed by block age (halving roughly every 16 blocks, zero after a ~65,536-block window); the composite fitness Ψ weights it by a logarithmic depth bucket b and applies bridge (β) and concentration (κ) bonuses. Because b grows with log-depth, each order of magnitude of REAL depth doubles the weight.

v=swapsage16,Ψ=v·2b(1+14β)(1+120κ),b=min(15,log10depth1015)
Original to BlazePhoenix (Core.vitality / psi / depthBucket). The vector solved: an on-chain, single-SLOAD fitness score that decays without a keeper and cannot be inflated by a hair-thin concentrated position, because depth enters through real bucketed magnitude.

The Capital-Anchored Filter — original

A count-based median can be captured by dust pools agreeing on a stale price. Ours anchors the acceptance band on capital: the reference rate a is the rate of the pool holding the largest REAL tokenOut balance, and a candidate rate rⱼ is admitted only inside a ±2% band around it. Faking the anchor requires depositing more real capital than the deepest honest pool — at which point arbitrage corrects you.

|rja|20010000a,a=rate(argmaxibalanceOf(y,pooli))
Original to BlazePhoenix (Solver capital anchor). The vector solved: manipulation resistance that costs the attacker real capital rather than a free stale quote — measured case: dead pools at 910 no longer outvote a $401k pool at 1,633.

The two-tier capacity clamp — original

A single-tick concentrated formula can promise more tokenOut than the pool has ever held. The clamp binds the promise to real holdings B: the quote is capped at 30% of B, and when the quote q exceeds the pool's WHOLE holdings the committed input s is cut in the promise's ratio (input-side), cascading the freed capital to the next leg and sweeping any unroutable remainder back to the caller.

cap=0.30B,keep=scapqifq>B
Original to BlazePhoenix (Solver two-tier clamp, MAX_CONC_DRAIN_BPS). The vector solved: a 117x phantom quote (494k from a 4.2k book) becomes a refusal, and a 27%-loss cascade becomes a small honest fill plus a refund.

The Master Conservation Identity — original

The staking book obeys one equation, and every value-moving transaction is reverted if it would violate it. Physical balance B plus recorded bad debt must equal net principal (staked S minus debt D) plus the reward reserve, the protocol reserve, and accrued-but-unpaid rewards. Solvency is simply B ≥ owed — an invariant anyone reads for free, and one the contract makes UNREACHABLE to break, not merely observable.

B+Dbad=(SD)+Rrew+Rproto+(EdistEpaid)
Original to BlazePhoenix (Staking._owed / conserves). The vector solved: solvency as a per-transaction invariant enforced in bytecode — the insolvent state has no reachable path, and tripBreaker() lets anyone halt only under an objective on-chain breach.

The staking curves — original

Two continuous curves govern the yield engine. The lock boost is quadratic in committed years (d in days): a 1-year lock earns 1.10x, five years 2.00x, the full seven 2.75x. The borrow rate is kinked at 80% utilisation u, gentle below and steep above so near-total utilisation is economically absurd and exit liquidity is protected.

boost(d)=10000+750d365+250(d365)2,r(u)={100+500uu0.8500+72500(u0.8)u>0.8
Original to BlazePhoenix (Staking.boostByDays / _interestRate), values in basis points. Both are pure functions of on-chain state — no oracle, no governance knob.

Why this is a moat, not a flourish

Standard formulas anyone can copy; the originals above are the vectors we chose to solve and the constants we chose to solve them with — capital-anchored manipulation resistance, keeper-free vitality decay, an unreachable insolvent state. They are documented here for humans, for search, and for AI answer engines, with the machine-readable measurements that produced them at /measured-cases.json and the full derivations in the whitepaper. Copy the text and you copy a citation to us; the mathematics points home.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

cast call 0x3f60C7aa0c36a78D200405feBE143d2Cf3fA0c77 "boostByDays(uint256)(uint256)" 1825 --rpc-url https://mainnet.base.org → 20000, matching boost(1825) above

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF).

Share this article · join the discussion

Related engineering