> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orica.markets/llms.txt
> Use this file to discover all available pages before exploring further.

# Market Model

> Complete reference for the Market data structure.

The Market model represents a prediction market on Orica.

***

## Schema

```typescript theme={"dark"}
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

```typescript theme={"dark"}
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:

```typescript theme={"dark"}
// 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]
```

> [!NOTE]
>
> Pool values are in base units (microlamports). Divide by 1,000,000 for USDC.

***

## IPFS Metadata

The `metadata_uri` points to a JSON file with extended information:

```json theme={"dark"}
{
  "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:

```json theme={"dark"}
{
  "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

```json theme={"dark"}
{
  "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
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.