> ## 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.

# Markets

> Understanding market structure, lifecycle, and data.

A **Market** in Orica represents a question about a future event. Each market has a set of possible outcomes, a close time, and an on-chain state that tracks liquidity, trading activity, and resolution status.

> [!NOTE]
>
> Markets are validated by [Claude 4.5 Sonnet](https://openrouter.ai/anthropic/claude-sonnet-4.5) to ensure questions are resolvable, unambiguous, and have clear resolution criteria.

***

## Market Structure

Every market is an on-chain Solana account with the following key properties:

| Field | Type | Description |
| - | - | - |
| `address` | `string` | The on-chain public key of the market account |
| `question` | `string` | The question being asked |
| `options` | `string[]` | List of possible outcomes |
| `creator` | `string` | Wallet address of the market creator |
| `created_at` | `number` | Unix timestamp of creation |
| `close_time` | `number` | Unix timestamp when trading ends |
| `status` | `string` | Current status: `open`, `closed`, `resolved`, `disputed` |
| `outcome_pools` | `number[]` | USDC liquidity in each outcome's pool |
| `outcome_supplies` | `number[]` | Number of shares minted for each outcome |
| `total_volume` | `number` | Total USDC volume traded |
| `trade_count` | `number` | Number of trades executed |

***

## Market Lifecycle

**1. Open**

The market is active. Users can buy and sell shares of any outcome.

* Trading is enabled
* Prices fluctuate based on supply/demand
* `close_time` is in the future

**2. Closed**

The `close_time` has passed. Trading is halted, and the market awaits AI resolution.

* No new trades allowed
* Positions are locked
* Claude 4.5 Sonnet analyzes the outcome

**3. Resolved**

The AI has reported an outcome. A dispute window may be active.

* Winning outcome is set by Claude 4.5 Sonnet
* Redemption is enabled (after dispute window)
* Losing shares become worthless

**4. Disputed**

The resolution has been challenged. Weighted voting determines the final outcome.

* Trading remains disabled
* Stakeholders vote on correct outcome
* Resolution may be overturned

***

## Market Metadata

In addition to on-chain data, markets have off-chain metadata stored on IPFS. This includes:

```json theme={"dark"}
{
  "question": "Will Bitcoin hit $100k by 2025?",
  "options": ["Yes", "No"],
  "resolution_method": "CoinGecko daily close price at 00:00 UTC on Dec 31, 2025",
  "close_date": 1735689600,
  "reasoning": "Standard market rules apply. Price must reach $100,000.00 exactly.",
  "image_url": "https://ipfs.io/ipfs/Qm...",
  "creator": "Host",
  "created_at": 1704067200
}
```

> [accordion] Metadata Fields
>
> | Field | Description |
> | - | - |
> | `question` | The full question text |
> | `options` | Human-readable outcome names |
> | `resolution_method` | How the outcome will be determined |
> | `close_date` | When trading ends (Unix timestamp) |
> | `reasoning` | Additional context or rules |
> | `image_url` | Optional market image (IPFS gateway URL) |
> | `creator` | Display name or identifier of the creator |
> | `created_at` | When metadata was created |

***

## Fetching Markets

> [tab] REST API
>
> ```bash theme={"dark"}
> curl "https://api.orica.markets/markets?limit=50&offset=0"
> ```
>
> Response:
>
> ```json theme={"dark"}
> [
>   {
>     "address": "ABC123...",
>     "question": "Will ETH flip BTC by 2026?",
>     "options": ["Yes", "No"],
>     "status": "open",
>     "outcome_pools": [1500000000, 2000000000],
>     "outcome_supplies": [15000, 20000],
>     "total_volume": 35000.50,
>     "trade_count": 142,
>     ...
>   }
> ]
> ```

> [tab] SDK
>
> ```typescript theme={"dark"}
> // Fetch all markets (on-chain only)
> const markets = await sdk.orica.fetchAllMarkets();
>
> // Fetch with IPFS metadata
> const marketsWithMeta = await sdk.orica.fetchAllMarkets({
>   includeMetadata: true,
>   metadataTimeout: 10000,
> });
>
> // Fetch single market
> const market = await sdk.orica.fetchMarketWithMetadata(
>   new PublicKey("..."),
>   { includeMetadata: true }
> );
> ```

***

## Market Status Computation

The API dynamically computes market status based on the current blockchain time:

* If `status` is `open` but `close_time` has passed, the API returns `closed`
* `resolved` and `disputed` statuses are stored on-chain and returned as-is

> [!NOTE]
>
> The blockchain time is fetched from Solana's slot time, not the server's system clock. This ensures consistent status across all clients.

***

## Next Steps

> [card] [Trading](https://docs.orica.markets/guides/trading.md)
>
> Learn how to buy and sell shares.

> [card] [Bonding Curve](https://docs.orica.markets/guides/bonding-curve.md)
>
> Understand the pricing mechanism.


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