Skip to main content

corrected_option_expiration

Function corrected_option_expiration 

Source
pub fn corrected_option_expiration(
    expiration: UnixNanos,
    underlying: Ustr,
    dataset: Option<Dataset>,
    config: Option<&DatabentoDecodeConfig>,
) -> UnixNanos
Expand description

Returns a corrected option expiration for datasets with date-level (midnight-UTC) timestamps.

When dataset has an OptionExpirationRule in config and expiration falls exactly on midnight UTC, the timestamp is reinterpreted at the rule’s wall-clock time (the per-underlying override if one matches, otherwise the rule default) in the rule’s timezone. Datasets without a rule, and any expiration already carrying an intraday time, are returned unchanged. A config of None uses the built-in defaults (OPRA corrected to 16:00 New York), so the correction is on by default.