Skip to content

@livefolio/sdk / RebalanceOrder

Type Alias: RebalanceOrder

RebalanceOrder = object

Defined in: orders/types.ts:117

Adjusts a long position in asset by delta shares. Positive delta increases the position (buy); negative delta decreases it (sell). If no position exists and delta > 0, a new position is opened.

Used by the rebalance engine when transitioning a portfolio to target weights — strategy code typically does not construct these directly.

Example

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

const order: RebalanceOrder = {
  id:    'ord_004',
  kind:  'rebalance',
  asset: { kind: 'equity', id: 'MSFT', symbol: 'MSFT' },
  delta: -50,  // reduce long by 50 shares
};

Properties

asset

asset: Asset

Defined in: orders/types.ts:122

The instrument whose long position is being adjusted.


delta

delta: number

Defined in: orders/types.ts:127

Share delta. Positive → buy more; negative → sell (reduce or close). Zero-delta orders MUST be omitted by callers.


id

id: string

Defined in: orders/types.ts:119

Caller-supplied identifier carried back on the resulting Fill via orderRef.


kind

kind: "rebalance"

Defined in: orders/types.ts:120

Released under the MIT License.