Skip to main content

Module parse

Module parse 

Source
Expand description

Parsing utilities for the Polymarket adapter.

Functions§

deserialize_decimal_from_str
Deserializes a Decimal from a JSON string.
deserialize_optional_decimal_from_str
Deserializes an optional Decimal from a string-only field.
deserialize_optional_polymarket_game_id
Deserializes a Polymarket game ID. The Gamma API returns the field in two shapes (string on GammaMarket, integer on GammaEvent) and uses both null and -1 (or "-1") as the “no game” sentinel for non-sport markets. Either sentinel is mapped to None; valid values must be non-negative.
determine_trade_id
Derives a deterministic [TradeId] for a Polymarket market data trade.
serialize_decimal_as_str
Serializes a Decimal as a string (lossless, no scientific notation).
serialize_optional_decimal_as_str
Serializes an optional Decimal as a string.