Portfolio
Event-sourced ledgers, positions, lots, cash, P&L attribution and timelines.
Record what happened as dated events (fills, deposits, income, costs, corporate actions) and derive everything else: positions, lots, cash, P&L between any two marks and a valuation timeline. The trade-lifecycle tools propose, preflight and reconcile rebalances without ever placing an order.
Try it live
Common APIs
fn
createPortfolioLedgerBuild the immutable ledger artifact from a definition and its economic events.fnportfolioPnlReconciled P&L between two valuation marks — see the module comment for the identity and the conversion convention.fnportfolioTimelineNAV, cash, flows, exposure, drawdown, and P&L components through time — see the module comment.fnportfolioSnapshotValue a portfolio state against an explicit market snapshot at an explicit instant.fnapplyPortfolioEventsThe direct pure reducer (FC7 required API; the agent-native doc's decided API ladder): fold `events` over a fresh `portfolio` definition or a `previousState`, returning a new deeply frozen {@link PortfolioState}.fnreconcilePortfolioCompare a derived state with a normalized external snapshot at `asOf` — see the module comment.fnproposePortfolioRebalancePropose a rebalance of the ledger's managed book toward the policy's targets at `asOf` — a plan, never an execution.fnpreflightTradePlanSee the reference for its full contract.fnmonitorPortfolioEvaluate one explicit valuation against the policy and the prior monitor state — see the module comment for the decisions.fncompareDisclosedHoldingsCompare supplied reported holdings; exact decimal quantities and values are never inferred trades.Guides
Complete API reference
Browse all public exports, types, and feature imports below.