Skip to content

Models

Normalized records keep vendor data out of the engine boundary while retaining the source and instrument identity needed for reproducibility.

models

Provider-neutral records shared by adapters and engine sinks.

AssetClass

Bases: StrEnum

Broad economic asset class, independent of execution venue.

MarketType

Bases: StrEnum

Trading-market structure for an instrument listing.

ContractSpec dataclass

ContractSpec(
    contract_size: float | None = None,
    linear: bool | None = None,
    inverse: bool | None = None,
    expiry_ms: int | None = None,
    strike: float | None = None,
    option_type: OptionType | None = None,
)

Normalized derivative terms supplied by a market catalog.

Instrument dataclass

Instrument(
    symbol: str,
    venue: str = "",
    timezone: str = "UTC",
    session: str = "24x7",
    volume_unit: str = "base",
    asset_class: AssetClass = UNKNOWN,
    market_type: MarketType = UNKNOWN,
    base: str = "",
    quote: str = "",
    settle: str = "",
    provider_id: str = "",
    contract: ContractSpec | None = None,
)

A normalized market instrument with provider identity kept explicit.

MarketListing dataclass

MarketListing(
    instrument: Instrument,
    active: bool | None = None,
    margin_supported: bool | None = None,
)

One instrument as listed by one provider-bound venue.

Bar dataclass

Bar(
    instrument: Instrument,
    timestamp_ms: int,
    open: float,
    high: float,
    low: float,
    close: float,
    volume: float,
    source: str,
)

One confirmed, provider-normalized OHLCV bar.

TradeTick dataclass

TradeTick(
    instrument: Instrument,
    timestamp_ms: int,
    sequence: int,
    price: float,
    quantity: float,
    source: str,
)

One normalized executed trade ready for the PineForge stream ABI.

MacroObservation dataclass

MacroObservation(
    key: str,
    currency: str,
    period_end_ms: int,
    released_at_ms: int,
    vintage_at_ms: int,
    value: float,
    unit: str,
    source: str,
)

A vintage-aware macro value safe to align without revised-data lookahead.