Skip to content

@livefolio/sdk / AllocateNode

Type Alias: AllocateNode

AllocateNode = object

Defined in: tactical/types.ts:222

A leaf node in a RuleNode tree that terminates evaluation and returns a target weight allocation. weights is a map from asset IDs to fractional weights; weights should sum to 1 for a fully-invested portfolio, but the runtime does not enforce this constraint.

Example

ts
import type { AllocateNode } from '@livefolio/sdk';

// 60% equities, 40% bonds
const node: AllocateNode = {
  op:      'allocate',
  weights: { SPY: 0.6, TLT: 0.4 },
};

Properties

op

op: "allocate"

Defined in: tactical/types.ts:223


weights

weights: Record<AssetId, number>

Defined in: tactical/types.ts:225

Map from asset ID to target portfolio weight (0–1).

Released under the MIT License.