MarketsOracle System

Oracle System

The oracle is the automated system that fetches external data and determines market outcomes.


How it works

Market closes (trading stops)

Oracle cron runs every 10 minutes

Fetches data from specified source(s)

Applies resolution rule

If confident: settles market
If uncertain: retries (Pending Recheck)
If conflict: flags for review (Needs Review)

Oracle states

StateMeaningNext action
OpenMarket is live; oracle not yet activeWait for trading to close
Pending RecheckOracle ran but data was inconclusive or API unavailableRetry on next cycle (every 10 min)
Needs ReviewOracle detected a data conflict it cannot resolve automaticallyAdmin verifies and settles manually
ResolvedOutcome confirmed; market settledDone

Data sources

Bags.fm graduation markets

CheckSourceWhat it verifies
Token statusBags.fm Public API v1 /token-launch/feedstatus == MIGRATED
Pool existenceHelius Solana RPC getAccountInfoDAMM v2 pool account exists on-chain

Both checks must pass for YES. A NO requires only the deadline to pass with no graduation.

Bags.fm fee race markets

CheckSourceWhat it verifies
Current feesBags.fm Public API v1 /token-launch/lifetime-feesFee growth since market open

Fee snapshot at open is recorded at market creation. Resolver fetches current fees and computes delta.


Resolution audit trail

Every oracle attempt is logged to the bags_resolution_snapshots table. You can view the full history on any token detail page at /solana/bags/{mint}.

Each snapshot records:

  • Timestamp of the attempt
  • Observed Bags status at that moment
  • DAMM pool key found (if any)
  • On-chain confirmation result
  • Outcome of the attempt (skipped / pending / YES / NO / needs_review)
  • Reason code
💡

Resolution is auditable. No hidden decisions — every oracle run is logged and visible on the token’s detail page.


Manual resolution

If a market enters Needs Review, an admin reviews the resolution snapshots and external data, then settles manually via the admin API.

Manual resolution requires documented evidence matching the resolution rule. Admin cannot settle based on judgment alone — the logged data must support the outcome.


What happens if the oracle fails permanently?

If a market cannot be resolved (e.g. data source permanently down), Cupdiction will void the market and refund all stakes.

This scenario is rare and would be communicated via the platform and community channels.