Skip to content

Markets & Events

A GoMarket market is one binary question with a deadline and a resolution source. On-chain it is a Market PDA derived from a numeric market ID — in either the AMM (high-market-program) or the CLOB (markets) program, depending on the venue:

Market PDA seeds = ["market", market_id: u64 LE]
YES mint PDA seeds = ["yes_mint", market_pda]
NO mint PDA seeds = ["no_mint", market_pda]
Vault PDA seeds = ["vault", market_pda]

The Market account holds the end time, the collateral mint, both outcome mints, its status and outcome, and a one-hour price accumulator.

Both programs use these same seeds and name the struct Market, so the Anchor discriminator is identical between them — check the account’s owner to tell which venue you’re looking at. → Two Venues

Three identifiers travel with a market, and mixing them up is the most common integration bug:

IdentifierScopeWhere it comes from
Market IDOn-chainu64 in the Market PDA seed
Condition IDCatalogueThe market’s key in the Markets API and the order manager
Token ID (asset ID)One sideIdentifies YES of market X or NO of market X

You place orders against a token ID. You query books and cancel by market using the condition ID. The executor resolves a token ID to its (market_id, outcome_mint) pair through the Markets API catalogue — the on-chain program has no registry of its own.

StatusTradingMeaning
OpenyesLive and before end_time
Closedsettlement onlyPast end_time; awaiting resolution
PendingResolutionnoA resolution has been proposed, dispute window running
DisputednoSomeone bonded a dispute
ResolvednoFinal outcome set; winners redeem 1:1
CancellednoVoid; collateral refunded

execute_trade is gated on Open or Closed and before end_time, so settlement of an already-matched trade can land just after close, but no new matching happens.

→ Resolution & Disputes

An event groups related markets — one football match, one election, one earnings release. Events give the product its navigation, but on-chain they carry a specific job: correlation control.

A MarketEventLink PDA ties a market to its event:

MarketEventLink seeds = ["market_event_link", market_id: u64 LE]

Parlay creation reads that link for every leg and rejects the slip if two legs belong to the same event (SameEventCorrelation, error 6005). A market with no event has a derived-but-empty account at that address, which the program reads as “no event.”

This is why you cannot build a parlay out of “Team A wins” and “Team A wins by 2+”. Those legs are almost perfectly correlated, so multiplying their probabilities as if they were independent would massively overprice the slip against the vault.

→ Leg Eligibility

From the Markets API:

Terminal window
curl -s http://localhost:8081/markets | jq
curl -s http://localhost:8081/markets/{condition_id} | jq

From the order manager (SIWS-authenticated):

Terminal window
curl -s http://127.0.0.1:8080/v1/markets -H "Authorization: Bearer $CLOB_TOKEN"
curl -s http://127.0.0.1:8080/v1/tokens -H "Authorization: Bearer $CLOB_TOKEN"
curl -s http://127.0.0.1:8080/v1/markets/{condition_id} -H "Authorization: Bearer $CLOB_TOKEN"

From the Platform API, for product-shaped data — questions, images, categories, trending:

Terminal window
curl -s https://prod-api.gomarket.io/api/markets/
curl -s https://prod-api.gomarket.io/api/markets/trending/
curl -s https://prod-api.gomarket.io/api/markets/events/
curl -s https://prod-api.gomarket.io/api/markets/{market_id}/price-history/

The order manager refreshes its own copy of the catalogue every CLOB_MARKET_UPDATES_INTERVAL_MS (default 10s), creating and deleting books as markets come and go.

Two gates sit between a catalogue row and a tradable book:

  • Readiness — a market must pass MarketDetails::is_market_ready before orders are accepted.
  • Game start — markets with a scheduled start eject every order placed before it. An order that arrives inside the window is parked on the pending service and comes back with status: "delayed" instead of resting immediately.

That second gate exists so orders priced on pre-match information don’t sit on the book into live play.