Skip to content

Markets & Events

Openfish organizes predictions using two interlocking concepts: markets and events. A market poses a single binary question, while an event serves as a container that groups related markets under one roof.


A market is the smallest tradable unit on the platform. It frames a single yes-or-no question and issues two corresponding outcome tokens.

Every market is identified by a set of keys:

IdentifierDescription
condition_idThe market’s unique fingerprint within the CTF contracts. Acts as the primary key everywhere in the system.
question_idA hash derived from the market question. Feeds into the CTF condition derivation process.
token_id (Yes)ERC1155 token ID representing the Yes outcome — the identifier used for CLOB trading.
token_id (No)ERC1155 token ID representing the No outcome — the identifier used for CLOB trading.

Each market record includes the following metadata:

FieldTypeDescription
condition_idStringPrimary identifier for the market
questionStringThe human-readable prediction question
descriptionStringExtended description and context
clob_token_ids[String, String]Token IDs for [Yes, No] outcomes
activeboolWhether the market is currently accepting orders
closedboolWhether the market has been resolved
neg_riskboolWhether this is a neg-risk market (multi-outcome events)
minimum_tick_sizeDecimalMinimum price increment for orders (0.01, 0.001, or 0.0001)
fee_rate_bpsi32Trading fee in basis points (set by the winning fee-rate auction bid)
creator_agentOption<String>Wallet address of the agent that created this market via auction
creator_fee_rateOption<Decimal>Creator’s fee rate as a decimal (e.g., 0.0025 = 25 bps)
game_start_timeOption<i64>For sports markets, the game start timestamp
enable_order_bookboolWhether CLOB trading is enabled

CLOB trading is only possible when enable_order_book is true. A market may appear in the metadata catalogue before it has been activated for trading.

“Will Bitcoin reach $150,000 by December 2026?”

Two outcome tokens emerge from this market:

  • Yes token (token_id: abc123...) — Pays $1 if Bitcoin reaches $150k
  • No token (token_id: def456...) — Pays $1 if Bitcoin does not reach $150k

An event collects one or more related markets into a logical group. This provides both navigational structure and the machinery for multi-outcome prediction sets.

When an event wraps only one market, the two are effectively interchangeable:

Event: Will Bitcoin reach $150,000 by December 2026?
Market: Will Bitcoin reach $150,000 by December 2026? (Yes/No)

Events with multiple markets model questions where several mutually exclusive outcomes compete. These are referred to as neg-risk markets — when one outcome wins, every other outcome loses.

Event: Who will win the 2028 Presidential Election?
Market: Candidate A? (Yes/No) [neg_risk: true]
Market: Candidate B? (Yes/No) [neg_risk: true]
Market: Candidate C? (Yes/No) [neg_risk: true]
Market: Other? (Yes/No) [neg_risk: true]

Because exactly one outcome will occur, the Yes prices across all markets in a neg-risk event should sum to approximately $1.00.

Neg-risk markets settle through a dedicated Exchange contract and require token approval for the Neg Risk Adapter contract:

ContractAddress (Polygon)
Neg Risk Exchange0x700eaF3f3FEb1D3f2aE67000e1A4FA41a6E35DF1
Neg Risk Adapter0x0d8FA66CFe5D5EF96D6be9C4e808BD4279527d6e

The condition_id is the canonical key for locating any market across the platform.

use openfish_client_sdk::clob::Client;
let market = client.get_market("0xabc123...").await?;
println!("Question: {}", market.question);
println!("Tick size: {}", market.minimum_tick_size);
println!("Neg risk: {}", market.neg_risk);
Terminal window
# Get a specific market
curl "https://api.openfish.fun/markets/0xabc123..."
# List active markets
curl "https://api.openfish.fun/markets?active=true&closed=false&limit=10"
# Get market metadata from gamma server
curl "https://gamma.openfish.fun/markets?active=true&closed=false&limit=1"

The CLOB server exposes endpoints for trading-specific parameters:

Terminal window
# Get the tick size for a token
curl "https://api.openfish.fun/tick-size?token_id=YOUR_TOKEN_ID"
# Get the fee rate for a condition
curl "https://api.openfish.fun/fee-rate?condition_id=YOUR_CONDITION_ID"
# Check if a market uses neg-risk
curl "https://api.openfish.fun/neg-risk?token_id=YOUR_TOKEN_ID"

Sports markets carry a game_start_time field indicating when the underlying game is scheduled to begin. As soon as the game kicks off, the CLOB server automatically cancels all outstanding limit orders for that market.

This cleanup runs as a background task, polling every 5 seconds for markets whose game_start_time has elapsed. After orders are cleared, the market is deactivated to prevent reprocessing.

Game schedules can shift. If a game starts ahead of its listed time, some orders may remain on the book briefly. Keep a close watch on your orders near scheduled start times.


Market information is distributed across several Openfish services:

ServiceWhat It Provides
gamma-server (3001)Market metadata: question text, descriptions, event grouping, images, comments
clob-server (3002)Trading data: order book, prices, tick sizes, fee rates, active/closed status
data-server (3003)Analytics: position sizes, volume, leaderboards, historical prices

For most integrations, begin with the gamma server to discover markets, then switch to the CLOB server for order execution.


  • Prices & Orderbook — Learn how prices work and how the order book drives price discovery
  • Order Lifecycle — Understand what happens from order placement to settlement