Skip to main content

CONTRACT_ID_FORMAT

Constant CONTRACT_ID_FORMAT 

Source
pub const CONTRACT_ID_FORMAT: &str = "v1:{UNDERLYING}:{expiration_ns}:{strike_cents}:{C|P}";
Expand description

The versioned contract_id join-key format, fixed here as the single source of truth for the round-trip check the validation chain (#32) enforces.

A contract_id is colon-delimited: "v1:{UNDERLYING}:{expiration_ns}:{strike_cents}:{C|P}", where {C|P} is a single upper-case style char (C = call, P = put), expiration_ns is the resolved absolute UTC instant (nanoseconds since epoch), and strike_cents is the strike in integer cents. UNDERLYING matches CONTRACT_ID_UNDERLYING_PATTERN and is therefore colon-free, so the five fields split unambiguously (docs/04-replay-mode.md ยง2.3). The parser that enforces this round-trip lives in #32; only the grammar is fixed here.