@livefolio/sdk / Portfolio
Type Alias: Portfolio
Portfolio =
object
Defined in: portfolio/types.ts:68
A point-in-time snapshot of the full portfolio state.
t advances to the latest fill timestamp each time applyFills is called. It is used as the portfolio's logical "now" for downstream computations.
Example
ts
import type { Portfolio } from '@livefolio/sdk';
const portfolio: Portfolio = {
cash: 50_000,
positions: [],
t: new Date('2024-01-01'),
};Properties
cash
cash:
number
Defined in: portfolio/types.ts:70
Uninvested cash in the portfolio's base currency.
positions
positions:
ReadonlyArray<Position>
Defined in: portfolio/types.ts:72
All currently open positions. Immutable array — replaced (not mutated) by apply functions.
t
t:
Date
Defined in: portfolio/types.ts:74
Logical timestamp of the most recent fill (or the portfolio's start date).