- Bots listen for oracle-trigger conditions (e.g. asset price ≥ target).
- Upon trigger they call
MarketContract.resolve()passing Pyth price ID. - Contract sets outcome ⟶ users burn winning tokens for $1 each.
Typical resolution timeline
- A market’s trigger condition is met and a bot submits the relevant Pyth update.
- The contract fetches a fresh price, validates it, and determines the winning side.
- The market resolves on-chain and claims open immediately for the winning token.
Oracle failure contingency
- If Pyth is unavailable or returns stale data,
updatePriceAndFulfillreverts. - Bots continually retry the call until a valid price is published.
- Until then, the market remains unresolved and funds stay locked.
SEDA Resolution (Oracle Program)
SEDA resolution uses a Data Request (DR) executed by the SEDA network. The Oracle Program in this repo fetches fixture results, outputs an ABI-encoded payload, and the EVM contract verifies a signed result before resolving the market.What the Oracle Program returns
- Primary path (resolve_outcome): ABI
(uint8 winnerToken, string resultInfo) winnerTokenis1(yes/win/draw) or2(no/lose/not draw)resultInfois a human-readable string from the fixture API
Execution + Tally
- Execution phase fetches SportMonks fixture data and computes the winning token.
- Tally phase collects reveals and requires unanimous agreement. If any mismatch exists, the tally returns an error and the DR is not finalized.
Execution inputs and outputs
Exec inputs (JSON)operation(optional, defaultresolve_outcome)fixture_id(required)predicted_participant_id(required ifdraw = false)draw(bool)market_id(required ifoperation = cancel_market)
resolve_outcome->(uint8 winnerToken, string resultInfo)cancel_market->uint256 yesMarketPrice(6 decimals)
End-to-end flow
On-chain verification (fulfillAndResolve)Failure and retry behavior
- If the tally phase detects mismatched reveals, it returns an error and no consensus is produced.
- If
result.consensusis false orexitCode != 0,fulfillAndResolvereverts. - Relayers can re-submit the DR after the underlying data source stabilizes.
Info: Resolution is deterministic. The EVM contract only accepts results that pass SEDA consensus and FAST signature verification.