Skip to content

@livefolio/sdk / FeatureKey

Type Alias: FeatureKey

FeatureKey = object

Defined in: interfaces/feature-cache.ts:36

Content-addressed cache key for a feature computation result.

Every field participates in key equality — changing any one of them addresses a different cache entry. Use this type when building custom FeatureCache implementations.

Example

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

const key: FeatureKey = {
  feature:    'sma',
  paramsHash: 'abc123',           // hash of { window: 20 }
  scope:      { kind: 'asset', asset: 'AAPL' },
  range:      { from: new Date('2024-01-01'), to: new Date('2025-01-01') },
  freq:       '1d',
};

Properties

feature

feature: string

Defined in: interfaces/feature-cache.ts:38

Feature name, e.g. 'sma', 'rsi'.


freq

freq: Frequency

Defined in: interfaces/feature-cache.ts:46

Bar granularity used when computing the feature.


paramsHash

paramsHash: string

Defined in: interfaces/feature-cache.ts:40

Deterministic hash of the feature's parameter object.


range

range: DateRange

Defined in: interfaces/feature-cache.ts:44

The date range the cached series spans.


scope

scope: FeatureScope

Defined in: interfaces/feature-cache.ts:42

Asset or universe this result covers.

Released under the MIT License.