Markets & Events
A market
Section titled “A market”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
Identifiers
Section titled “Identifiers”Three identifiers travel with a market, and mixing them up is the most common integration bug:
| Identifier | Scope | Where it comes from |
|---|---|---|
| Market ID | On-chain | u64 in the Market PDA seed |
| Condition ID | Catalogue | The market’s key in the Markets API and the order manager |
| Token ID (asset ID) | One side | Identifies 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.
Lifecycle states
Section titled “Lifecycle states”| Status | Trading | Meaning |
|---|---|---|
Open | yes | Live and before end_time |
Closed | settlement only | Past end_time; awaiting resolution |
PendingResolution | no | A resolution has been proposed, dispute window running |
Disputed | no | Someone bonded a dispute |
Resolved | no | Final outcome set; winners redeem 1:1 |
Cancelled | no | Void; 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.
An event
Section titled “An event”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.
Reading the catalogue
Section titled “Reading the catalogue”From the Markets API:
curl -s http://localhost:8081/markets | jqcurl -s http://localhost:8081/markets/{condition_id} | jqFrom the order manager (SIWS-authenticated):
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:
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.
Market readiness and game starts
Section titled “Market readiness and game starts”Two gates sit between a catalogue row and a tradable book:
- Readiness — a market must pass
MarketDetails::is_market_readybefore 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.