Execution
Execution primitives answer pre- and post-trade execution questions: “how much slippage on this swap?” and “did I get sandwiched?”
Primitives in this category
Section titled “Primitives in this category”CalculateSlippage— pre-trade slippage and price-impact decomposition for a proposed swap.DetectMEV— post-trade comparison of actual on-chain output vs the invariant-implied output.
Protocol coverage
Section titled “Protocol coverage”Execution analytics — slippage, price impact, MEV exposure — are V2/V3 only in v2.0. The math is available in BalancerExchange.get_amount_out and StableswapExchange.get_amount_out; the gap is primitive packaging, not derivation.
| Protocol | Coverage | Notes |
|---|---|---|
| Uniswap V2 | Full | CalculateSlippage, DetectMEV. |
| Uniswap V3 | Full | Both primitives. max_size_at_1pct is V2-only on CalculateSlippage (V3 tick-walking infra not yet implemented). |
| Balancer | Deferred (v2.1) | Sibling primitives or protocol-dispatching extension planned; Bucket A. Math is in BalancerExchange.get_amount_out. |
| Stableswap | Deferred (v2.1) | Same as Balancer; math in StableswapExchange.get_amount_out. |
Closing this gap also unblocks full CompareProtocols.slippage_at_amount plumbing.
MCP tool exposure
Section titled “MCP tool exposure”In the curated v2.0 set: CalculateSlippage. Not in: DetectMEV (post-trade forensic; agents typically want this after observing a settled trade, less common than pre-trade slippage).