Skip to content

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.

  • AggregatePortfolio — breadth-chain over AnalyzePosition / AnalyzeBalancerPosition / AnalyzeStableswapPosition. Numeraire enforced as the shared first-token symbol; mismatched first-tokens raise ValueError.

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.

ProtocolCoverageNotes
Uniswap V2Fullentry_x_amt / entry_y_amt; full PnL contribution to portfolio totals.
Uniswap V3FullSame input shape as V2 plus optional lwr_tick / upr_tick for tick-aware analysis.
BalancerFullentry_x_amt / entry_y_amt (mapped to base/opp internally); fee_income = 0.0 (upstream limit).
StableswapPartialUses 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.

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.