Connect ›
Cover: The Eightfold Dispatcher: one quote function for eight species of AMM

The Eightfold Dispatcher: one quote function for eight species of AMM

V2, V3, Algebra, Solidly, Uniswap V4 and native-ETH V4 — one dispatcher returns output, depth proxy and impact hint for any pool kind, asking the pool's own bytecode wherever replication could lie.

Known formally as The Eightfold Dispatcher Ω in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · updated 2026-10-05 · data through 2026-10-11 · 6 min · written from the deployed bytecode

By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.

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

English — One dispatcher quotes eight species of AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — using closed-form math where formulas are truth and asking the pool's own bytecode wherever replication could lie.

Português — Um único dispatcher cota oito espécies de AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — com matemática fechada onde a fórmula é a verdade e perguntando ao próprio bytecode do pool onde a replicação poderia mentir.

Español — Un solo dispatcher cotiza ocho especies de AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — con matemática cerrada donde la fórmula es la verdad y preguntando al propio bytecode del pool donde la replicación podría mentir.

Français — Un seul dispatcher cote huit espèces d'AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — par formules fermées là où la formule est la vérité, et en interrogeant le bytecode du pool partout où la réplication pourrait mentir.

Deutsch — Ein Dispatcher quotiert acht AMM-Arten — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — mit geschlossenen Formeln, wo die Formel die Wahrheit ist, und fragt den Bytecode des Pools, wo Replikation lügen könnte.

Русский — Один диспетчер котирует восемь видов AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — замкнутыми формулами там, где формула и есть истина, и спрашивая байткод самого пула там, где репликация могла бы лгать.

Türkçe — Tek bir dağıtıcı sekiz AMM türünü fiyatlar — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — formülün hakikat olduğu yerde kapalı form matematikle, kopyalamanın yalan söyleyebileceği her yerde havuzun kendi bytecode'una sorarak.

العربية — موزّع واحد يسعّر ثمانية أنواع من AMM — V2 وV3 وAlgebra وSolidly وCurve المستقر وCurve المشفر وBalancer وV4 — برياضيات مغلقة حيث تكون الصيغة هي الحقيقة، وبسؤال بايتكود المجمّع نفسه حيثما أمكن للنسخ أن يكذب.

हिन्दी — एक ही डिस्पैचर आठ प्रकार के AMM कोट करता है — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — जहाँ सूत्र ही सत्य है वहाँ बंद-रूप गणित से, और जहाँ प्रतिकृति झूठ बोल सकती है वहाँ पूल के अपने बाइटकोड से पूछकर।

日本語 — 一つのディスパッチャーが8種のAMM(V2、V3、Algebra、Solidly、Curve stable、Curve crypto、Balancer、V4)を見積もります。式が真実である所は閉形式の数学で、複製が嘘をつき得る所ではプール自身のバイトコードに尋ねます。

中文 — 一个调度器为八种 AMM 报价——V2、V3、Algebra、Solidly、Curve 稳定池、Curve 加密池、Balancer、V4——公式即真相处用闭式数学,复制可能撒谎处则直接询问池自身的字节码。

한국어 — 디스패처 하나가 여덟 종의 AMM을 견적합니다 — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4. 공식이 곧 진실인 곳은 닫힌 수식으로, 복제가 거짓말할 수 있는 곳은 풀 자신의 바이트코드에 묻습니다.

Bahasa Indonesia — Satu dispatcher menguotasi delapan spesies AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — memakai matematika bentuk-tertutup di mana rumus adalah kebenaran, dan bertanya pada bytecode pool sendiri di mana pun replikasi bisa berbohong.

বাংলা — একটি ডিসপ্যাচার আটটি প্রজাতির AMM কোট করে — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — যেখানে সূত্রই সত্য সেখানে বদ্ধ-রূপ গণিতে, আর যেখানে প্রতিলিপি মিথ্যা বলতে পারে সেখানে পুলের নিজস্ব বাইটকোডকে জিজ্ঞেস করে।

Filipino — Isang dispatcher ang nagko-quote ng walong uri ng AMM — V2, V3, Algebra, Solidly, Curve stable, Curve crypto, Balancer, V4 — gamit ang closed-form math kung saan ang pormula ang katotohanan, at nagtatanong sa mismong bytecode ng pool saanman maaaring magsinungaling ang panggagaya.

Every AMM family speaks a different mathematical language: constant product (V2), square-root-price ticks (V3/Algebra), the x³y+xy³ stable curve (Solidly), V4's singleton with hooks. Aggregators usually handle this with one adapter contract per venue — a maintenance surface that grows with every fork. BlazePhoenix compresses it into one dispatcher: give it a pool of any of the six kinds and an input amount, and it returns the output, a depth proxy for the split allocator, and an impact hint.

The branching doctrine is what matters: closed-form math where the formula is the truth (V2's single-expression output with division deferred to the last step, so the only rounding is the final floor), and ASK-THE-POOL where a venue's own bytecode is the only honest source — Solidly's getAmountOut is called directly, because the same code that will enforce the invariant at execution produced the number, so quote and fill cannot diverge.

The constant-product branch, exactly as the Core computes it

For a Uniswap-V2-class pool with reserves x (in) and y (out) and fee f in basis points, the exact output for an input Δx is a single closed-form expression, computed with division deferred to the last step so the only rounding is the final floor:

Δy=Δx·(10000−f)·yx·10000+Δx·(10000−f)
Constant-product output (Core.outV2). Depth proxy = min(x, y); the same 30-bps default is mirrored in the execution path so quote and fill agree by construction.

Defaults that prevent reverts by construction

The details carry the reliability: a V2 venue registered with no fee defaults to 30 bps — the universal Uniswap-V2/Sushi fee — mirrored byte-for-byte in the execution path, so the quote matches the pool's own K check and a fee mismatch cannot revert the swap. V4 state is read via extsload from the singleton PoolManager with the slot layout verified against the canonical StateView; delta-altering hooks are refused outright (fail-closed) rather than guessed at.

One dispatcher, eight species, zero per-venue adapters — and every branch documented in the whitepaper with the exact formula the Core computes.

Do not trust this page — reproduce it

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

Prepare and decode quotes for a V2 pair, a V3 pool and a Solidly stable pool (/api/quote/prepare, your node, /api/quote/decode): the decoded responses share one shape — one dispatcher, eight species
Cite this article

Licensed CC BY 4.0 — quote, translate and reuse freely, including commercially, with attribution and a link. Copy a ready-made citation:

BlazePhoenix (2026). The Eightfold Dispatcher: one quote function for eight species of AMM. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/eightfold-dispatcher
@misc{blazephoenix_eightfold_dispatcher,
  title  = {The Eightfold Dispatcher: one quote function for eight species of AMM},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/eightfold-dispatcher},
  note   = {Accessed: reproduce the claim with the command above}
}

Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.

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

Related engineering

Next in Routing & pricing · 3 / 19
Why some Ethereum pairs quote differently here than the price you see elsewhere ›On a few Ethereum pairs — stablecoins and correlated assets — our quote can sit below the market. The reason is a deliberate trust boundary, not arithmetic: that depth trades on venue families we excised by choice into our Ethereum registry. How to tell if it affects your trade.7 min