Optimization
Optimization primitives answer “what’s the best version of this action?” — the optimal split for a single-sided deposit, the cost of a rebalance, the tradeoff across V3 tick ranges.
Per-protocol single-primitive coverage — each protocol gets the optimization question most relevant to its mechanics.
Primitives in this category
Section titled “Primitives in this category”OptimalDepositSplit— V2-only: optimal swap fraction for a single-sided zap-in (closed-form quadratic with the counterintuitivedα/d(dx) < 0result).EvaluateRebalance— V2-only: cost of cycling a position (withdraw → swap → re-zap).EvaluateTickRanges— V3-only: capital-efficiency vs IL-exposure vs fee-capture across N candidate ranges.
Protocol coverage
Section titled “Protocol coverage”| Protocol | Coverage | Notes |
|---|---|---|
| Uniswap V2 | Full | OptimalDepositSplit, EvaluateRebalance. |
| Uniswap V3 | Full | EvaluateTickRanges. |
| Balancer | Deferred (v2.1) | Optimal-weight selection and zap-in optimization deferred until weighted-pool primitives stabilize. |
| Stableswap | Deferred (v2.1) | Stableswap zap-in is non-trivial (non-symmetric reserves at peg); unblocked by future invariant-math primitives. |
MCP tool exposure
Section titled “MCP tool exposure”None of these are in the curated v2.0 set. Optimization primitives require multi-step reasoning (“is this rebalance worth it?”, “should I narrow my range?”) that’s better composed LLM-side over the leaf cost/scenario primitives. The category exists for when an agent needs the building blocks; the verdict is the LLM’s job.