Schema
interface Market {
// Identifiers
address: string; // On-chain account address
market_id: number; // Numeric market ID
// Content
question: string; // The question being asked
options: string[]; // Possible outcomes
// Metadata
creator: string; // Creator's wallet address
created_at: number; // Unix timestamp of creation
close_time: number; // Unix timestamp when trading ends
metadata_uri: string; // IPFS URI for full metadata
image_url: string | null; // Direct image URL
// State
status: MarketStatus; // Current market status
outcome_pools: number[]; // USDC in each outcome's pool
outcome_supplies: number[]; // Shares minted per outcome
// Statistics
total_volume: number; // Total USDC traded
trade_count: number; // Number of trades
unique_traders: number; // Distinct traders (on-chain only)
// Resolution (null until resolved)
resolution_outcome: number | null; // Winning outcome index
resolution_metadata_uri: string | null; // Evidence URI
resolved_at: number | null; // Resolution timestamp
resolver: string | null; // Resolver's wallet
}
Status Values
type MarketStatus = "open" | "closed" | "resolved" | "disputed";
| Status | Description |
|---|---|
open | Trading is active |
closed | Trading ended, awaiting resolution |
resolved | Outcome reported, redemption available |
disputed | Resolution contested, voting in progress |
Pool and Supply Arrays
Arrays are indexed by outcome:// Binary market (Yes/No)
outcome_pools: [1500000000, 2000000000] // Pool 0 = Yes, Pool 1 = No
outcome_supplies: [15000, 20000] // Supply 0 = Yes shares, Supply 1 = No shares
// Multi-outcome market
outcome_pools: [500000000, 800000000, 700000000] // 3 outcomes
outcome_supplies: [5000, 8000, 7000]
Pool values are in base units (microlamports). Divide by 1,000,000 for USDC.
IPFS Metadata
Themetadata_uri points to a JSON file with extended information:
{
"question": "Will Bitcoin hit $100k by 2025?",
"options": ["Yes", "No"],
"resolution_method": "CoinGecko daily close at 00:00 UTC",
"close_date": 1735689600,
"reasoning": "Standard market rules apply.",
"image_url": "https://ipfs.io/ipfs/Qm...",
"image_ipfs_hash": "Qm...",
"creator": "Host",
"created_at": 1704067200
}
Resolution Metadata
When resolved,resolution_metadata_uri points to:
{
"outcome": 0,
"outcome_name": "Yes",
"evidence": "Bitcoin reached $100,000 on Dec 30, 2025.",
"sources": ["https://coingecko.com/..."],
"reasoning": "Price threshold exceeded.",
"timestamp": 1735603500,
"market_address": "ABC123...",
"is_dispute_resolution": false
}
Example
{
"address": "ABC123def456...",
"market_id": 42,
"question": "Will ETH flip BTC by market cap in 2026?",
"options": ["Yes", "No"],
"creator": "Creator789...",
"created_at": 1704067200,
"close_time": 1767225600,
"metadata_uri": "ipfs://QmXyz...",
"image_url": "https://ipfs.io/ipfs/QmAbc...",
"status": "open",
"outcome_pools": [2500000000, 3500000000],
"outcome_supplies": [25000, 35000],
"total_volume": 60000.00,
"trade_count": 287,
"unique_traders": 45,
"resolution_outcome": null,
"resolution_metadata_uri": null,
"resolved_at": null,
"resolver": null
}