Portfolio
Portfolio answers “how is the LP book doing as a whole?” — aggregating N positions across protocols into a single common-numeraire view.
One primitive in v1. The category is intentionally small — once leaf primitives stabilize, more portfolio-level views land here.
Primitives in this category
Section titled “Primitives in this category”AggregatePortfolio— breadth-chain overAnalyzePosition/AnalyzeBalancerPosition/AnalyzeStableswapPosition. Numeraire enforced as the shared first-token symbol; mismatched first-tokens raiseValueError.
Protocol coverage
Section titled “Protocol coverage”AggregatePortfolio is the canonical breadth-chain — one primitive applied N times, results aggregated. Cross-protocol dispatch lives in this aggregator, not in the per-protocol leaf analyzers (composition-layer dispatch scales; primitive-layer dispatch does not). All positions in a single call must share a common first-token numeraire.
| Protocol | Coverage | Notes |
|---|---|---|
| Uniswap V2 | Full | entry_x_amt / entry_y_amt; full PnL contribution to portfolio totals. |
| Uniswap V3 | Full | Same input shape as V2 plus optional lwr_tick / upr_tick for tick-aware analysis. |
| Balancer | Full | entry_x_amt / entry_y_amt (mapped to base/opp internally); fee_income = 0.0 (upstream limit). |
| Stableswap | Partial | Uses entry_amounts (list, not pair); unreachable-alpha positions contribute 0.0 to totals and append to shared_exposure_warnings; fee_income = 0.0 (upstream limit). |
Numeraire must match across positions in a single call (peg-token positions vs ETH-token positions can’t mix) — the aggregator raises ValueError if first-tokens differ.
MCP tool exposure
Section titled “MCP tool exposure”Not in the curated v2.0 set. Composition primitives are better assembled LLM-side from Analyze*Position calls so the agent can decide which positions to include, what numeraire to use, and which sub-views to surface.