pub fn build_settlement_fills(
settlements: &[OutcomeSettlement],
spot_state: &SpotClearinghouseState,
meta: &OutcomeMeta,
http_client: &HyperliquidHttpClient,
tracker: &mut OutcomeSettlementTracker,
account_id: AccountId,
ts_init: UnixNanos,
) -> Vec<FillReport>Expand description
Materializes one closing [FillReport] per held outcome side token that
has newly settled.
settlements is the output of derive_outcome_settlements. Each
settlement is matched to a non-zero spot balance keyed by the +E token
name (Hyperliquid’s spot-balance convention for outcome side tokens). Pairs
already in tracker are skipped; pairs that emit a fill are recorded.
Commission currency comes from the cached instrument, then meta, with
USDC as the fallback when the quote token is unavailable.
Returns the synthetic fills ready to be forwarded through the execution emitter. Returns an empty vector when no held outcome side token has settled this round.