连接
Cover: Eightfold Dispatcher:一个报价函数,覆盖八种 AMM

Eightfold Dispatcher:一个报价函数,覆盖八种 AMM

译文 · 如有冲突,以英文版本为准。 阅读英文原文 ›

V2、V3、Algebra、Solidly、Uniswap V4 以及原生 ETH 的 V4——一个调度器就能针对任何池子类型返回输出、深度代理值和冲击提示,凡是复刻可能说谎的地方,就直接询问池子自身的字节码。

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

BlazePhoenix Engineering · article updated 2026-10-05 · site dataset through 2026-11-19 · 6 min · written from the deployed bytecode

概览
正式名称The Eightfold Dispatcher Ω
阅读时间6 min
章节3
更新于2026-10-05

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

每个 AMM 家族都使用不同的数学语言:恒定乘积(V2)、平方根价格刻度(V3/Algebra)、x³y+xy³ 稳定曲线(Solidly)、带 hooks 的 V4 单例(singleton)。聚合器通常用每个交易场所一个适配器合约来应对——这是一个随每个分叉而增长的维护面。BlazePhoenix 把它压缩成一个调度器:给它六种原生类型中任一种的池子,或 Gate 用于 Balancer 和 Curve 场所的外部类型的池子,再给一个输入金额,它就返回输出、供拆分分配器使用的深度代理值,以及冲击提示。

真正重要的是这套分支学说:凡公式即真相之处,用闭式数学(V2 的单表达式输出,除法推迟到最后一步,因此唯一的舍入就是最终的向下取整);凡某个场所自己的字节码是唯一诚实来源之处,就询问池子(ASK-THE-POOL)——Solidly 的 getAmountOut 被直接调用,因为将在执行时强制该不变量的同一份代码产生了这个数字,所以报价与成交不可能产生分歧。

恒定乘积分支,与 Core 的计算完全一致

对于 Uniswap-V2 类池子,储备为 x(输入)和 y(输出),费率 f 以基点计,输入 Δx 对应的精确输出是一个单一的闭式表达式,计算时把除法推迟到最后一步,因此唯一的舍入就是最终的向下取整:

Δy=Δx·(10000−f)·yx·10000+Δx·(10000−f)
恒定乘积输出(Core.outV2)。深度代理值 = min(x, y);同样的 30 bps 默认值在执行路径中也有镜像,因此按构造,报价与成交一致。

按构造防止 revert 的默认值

细节承载着可靠性:未登记费率的 V2 场所默认为 30 bps——Uniswap-V2/Sushi 通用的费率——并逐字节地镜像于执行路径,因此报价与池子自身的 K 检查一致,费率不匹配不会让兑换 revert。V4 状态通过 extsload 从单例 PoolManager 读取,其槽位布局已对照规范的 StateView 验证;会改变 delta 的 hooks 被直接拒绝(fail-closed),而不是靠猜测。

一个调度器,八个物种,零个逐场所适配器——每个分支都在白皮书中有记录,并附有 Core 所计算的精确公式。

不要轻信本页,请自行复现

上文的每一项主张都可以在链上核查。从这里开始:

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
引用本文

采用 CC BY-NC-ND 4.0 许可:引用时请注明出处并附链接。商业使用和衍生版本须获得 BlazePhoenix 的书面许可;译文由 BlazePhoenix 提供。 Copy a ready-made citation:

BlazePhoenix (2026). Eightfold Dispatcher:一个报价函数,覆盖八种 AMM. BlazePhoenix Engineering. https://blazephoenix.xyz/zh/learn/eightfold-dispatcher/
@misc{blazephoenix_eightfold_dispatcher,
  title  = {Eightfold Dispatcher:一个报价函数,覆盖八种 AMM},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/zh/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).

相关工程文章

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

Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz

Go to APP