Expand description
Parsing utilities for the Polymarket adapter.
Functions§
- deserialize_
decimal_ from_ str - Deserializes a
Decimalfrom a JSON string. - deserialize_
optional_ decimal_ from_ str - Deserializes an optional
Decimalfrom 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 onGammaEvent) and uses bothnulland-1(or"-1") as the “no game” sentinel for non-sport markets. Either sentinel is mapped toNone; 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
Decimalas a string (lossless, no scientific notation). - serialize_
optional_ decimal_ as_ str - Serializes an optional
Decimalas a string.