Skip to content

@livefolio/sdk / SyntheticAsset

Type Alias: SyntheticAsset

SyntheticAsset = object

Defined in: tactical/types.ts:54

A simulated leveraged or expense-adjusted asset that the runtime synthesizes on-the-fly from its underlying data feed. The bar stream is computed by withSynthetics, which wraps a real DataFeed and intercepts requests for the synthetic's id.

The synthesized daily close is:

close_t = close_{t-1} × (1 + leverage × underlyingReturn_t) × (1 − expense/252)

Example

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

const qqq3x: SyntheticAsset = {
  id:         'QQQ_3X',
  symbol:     'QQQ3X',
  underlying: { id: 'QQQ', symbol: 'QQQ' },
  leverage:   3,
  expense:    0.0095,  // 0.95% annual
};

Properties

expense?

optional expense?: number

Defined in: tactical/types.ts:64

Annual expense ratio as a decimal (e.g. 0.0095 for 0.95%). Defaults to 0.


id

id: AssetId

Defined in: tactical/types.ts:56

Stable ID for this synthetic; must be unique in the spec universe.


leverage

leverage: number

Defined in: tactical/types.ts:62

Daily return multiplier (e.g. 3 for 3× leverage, -1 for inverse).


symbol

symbol: string

Defined in: tactical/types.ts:58

Display symbol for this synthetic.


tradeAs?

optional tradeAs?: AssetRef

Defined in: tactical/types.ts:66

When set, orders are routed to this proxy asset instead of the synthetic id.


underlying

underlying: AssetRef

Defined in: tactical/types.ts:60

Reference to the real asset whose returns are scaled.

Released under the MIT License.