Skip to main content

parse_instrument

Function parse_instrument 

Source
pub fn parse_instrument(
    market: &Market,
    ts_init: UnixNanos,
) -> Result<BinaryOption, Error>
Expand description

Parses a checked provider-owned Polymarket Yes/No definition.

Polymarket uses pUSD and six-decimal shares, matching the native adapter’s conventions. Unavailable activation uses its zero timestamp convention. EndDateIso sets the simulated trading cutoff; it does not prove actual venue closure or authoritative settlement. Other venue families fail until their required field rules are verified.

§Errors

Returns an error if:

  • The venue or contract is unsupported.
  • Required identity or metadata is missing, invalid, or conflicting.
  • The tick is outside (0, 1) or the provider price is outside [0, 1].
  • A price requires rounding or expiry is outside the supported timestamp range.