PythResolver.sol
Last updated
Resolves orderbook markets with Pyth price updates.
Anyone submits Pyth update data after market expiry by calling resolveMarket(...).
The resolver pays Pyth's update fee from msg.value; excess ETH/BNB is refunded.
Pyth verifies the update data and returns a price for the market's configured feed and valid settlement window.
If this is the first valid submission, the market moves to Resolving and a 90-second finality window starts.
During the finality window, anyone can submit an earlier valid update that changes the outcome.
After finality, anyone can call finalizeResolution(...); outcome rule is price >= strike → YES wins, price < strike → NO wins.
function resolveMarket(uint256 factoryMarketId, bytes[] calldata priceUpdateData)
external
payable
function finalizeResolution(uint256 factoryMarketId) externalresolveMarket requires at least pyth.getUpdateFee(priceUpdateData) in msg.value. The current core CLOB contracts do not pay a resolver bounty.
Price IDs are stored as bytes32 in MarketFactory.marketMeta.
Resolution is permissionless, but hosted keepers normally perform it.
Confidence checks reject updates with too much price uncertainty.
If a market cannot be resolved with valid Pyth data, the factory can move it through its configured fallback/cancellation flow.
Last updated

