Skip to main content

Module outcome_settlement

Module outcome_settlement 

Source
Expand description

Runtime dispatch for HIP-4 outcome settlements.

Each periodic outcomeMeta poll calls crate::http::parse::derive_outcome_settlements to identify settled (outcome_index, outcome_side) pairs, then materializes position-closing [FillReport]s for any spot balance still holding a settled side token. Settlements settle in USDH at 0 (losing) or 1 (winning), so each closing fill carries a USDH commission of zero.

State is tracked in OutcomeSettlementTracker; once a pair has been dispatched it is not re-emitted on subsequent polls.

Structs§

OutcomeSettlementTracker
Tracks (outcome_index, outcome_side) pairs already dispatched so repeat polls do not re-emit settlement fills.

Functions§

build_settlement_fills
Materializes one closing [FillReport] per held outcome side token that has newly settled.