Market Metadata
Extended information about a market:interface MarketMetadata {
question: string; // Full question text
options: string[]; // Human-readable outcome names
resolution_method: string; // How outcome will be determined
close_date: number; // Trading end time (Unix timestamp)
reasoning: string; // Why this market is resolvable
image_url: string | null; // Market image URL
image_ipfs_hash: string | null; // IPFS hash for image
creator: string; // Creator display name
created_at: number; // Creation timestamp
}
Example
{
"question": "Will Bitcoin hit $100,000 by December 31, 2025?",
"options": ["Yes", "No"],
"resolution_method": "The market resolves Yes if Bitcoin's price on CoinGecko reaches or exceeds $100,000.00 USD at any point before 00:00 UTC on January 1, 2026.",
"close_date": 1735689600,
"reasoning": "Bitcoin price is publicly verifiable on multiple exchanges and aggregators. CoinGecko is used as the authoritative source.",
"image_url": "https://ipfs.io/ipfs/QmXYZ...",
"image_ipfs_hash": "QmXYZ...",
"creator": "Host",
"created_at": 1704067200
}
Resolution Metadata
Evidence and reasoning for a market resolution:interface ResolutionMetadata {
outcome: number; // Winning outcome index
outcome_name: string; // Human-readable outcome name
evidence: string; // Description of what happened
sources: string[]; // URLs to verifiable sources
reasoning: string; // Explanation of resolution logic
timestamp: number; // When resolution was determined
market_address: string; // Market being resolved
is_dispute_resolution: boolean; // If from dispute override
}
Example
{
"outcome": 0,
"outcome_name": "Yes",
"evidence": "Bitcoin reached $100,423.50 on CoinGecko at 14:32 UTC on December 30, 2025.",
"sources": [
"https://www.coingecko.com/en/coins/bitcoin",
"https://web.archive.org/web/20251230143200/https://www.coingecko.com/en/coins/bitcoin"
],
"reasoning": "The daily high price exceeded the $100,000 threshold before the market close time.",
"timestamp": 1735570320,
"market_address": "ABC123...",
"is_dispute_resolution": false
}
Fetching Metadata
- SDK
- Direct
// Market metadata
const market = await sdk.orica.fetchMarketWithMetadata(address, {
includeMetadata: true,
metadataTimeout: 10000
});
console.log(market.metadata?.resolution_method);
// Direct IPFS fetch
const metadata = await sdk.orica.fetchIpfsMetadata(
market.account.metadataUri,
5000
);
async function fetchMetadata(uri: string) {
let url = uri;
if (uri.startsWith("ipfs://")) {
url = uri.replace("ipfs://", "https://ipfs.io/ipfs/");
}
const response = await fetch(url);
return response.json();
}
IPFS Gateways
Common IPFS gateways:| Gateway | URL Pattern |
|---|---|
| Protocol Labs | https://ipfs.io/ipfs/{hash} |
| Cloudflare | https://cloudflare-ipfs.com/ipfs/{hash} |
| Pinata | https://gateway.pinata.cloud/ipfs/{hash} |
The
image_url field typically contains a pre-resolved gateway URL for convenience.