Skip to main content

make_fill_trade_id

Function make_fill_trade_id 

Source
pub fn make_fill_trade_id(
    hash: &str,
    oid: u64,
    px: &str,
    sz: &str,
    time: u64,
    start_position: &str,
) -> TradeId
Expand description

Creates a deterministic [TradeId] from fill fields common to both WS and HTTP responses.

Uses FNV-1a hash of (hash, oid, px, sz, time, start_position) to produce a unique identifier consistent across both data sources for the same physical fill. Includes start_position (running position before each fill) to disambiguate multiple partial fills within the same transaction at the same price/size. Format: {fnv_hex}-{oid_hex} (exactly 33 chars, within 36-char limit).