Skip to main content

determine_trade_id

Function determine_trade_id 

Source
pub fn determine_trade_id(
    asset_id: &str,
    side: PolymarketOrderSide,
    price: &str,
    size: &str,
    timestamp: &str,
) -> TradeId
Expand description

Derives a deterministic [TradeId] for a Polymarket market data trade.

Polymarket does not publish a trade ID with last_trade_price events, so one is derived from the trade’s identifying fields. FNV-1a is stable across architectures and crate versions, and the 0x1f delimiter prevents variable-length fields from colliding (e.g. "0.12" + "34" vs "0.1" + "234").