Skip to main content

Module settlement

Module settlement 

Source
Expand description

Price-chain settlement helper for AdminInstantSettlement.

Reads the open reference from Treasury::last_close_*, reads the Pyth close price, resolves UP/DOWN, emits PeriodSettled, and writes the close price back to Treasury. All market pool math and USDC distribution happen off-chain.

Structs§

SettlementResult

Constants§

SIDE_DOWN
DOWN outcome constant (close <= open, including ties).
SIDE_UP
UP outcome constant (close > open).

Functions§

commit_settlement
Write close price back to Treasury and emit the PeriodSettled event.
resolve_settlement
Read open from Treasury, read close from Pyth, return outcome + both prices. Returns Err(GenesisNotSet) if the price chain has not been seeded.