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

# Markets

> Hyperliquid HIP-4 prediction markets at the token-side grain.

The `hyperliquid.predictions.markets` table contains every Hyperliquid HIP-4 prediction-market outcome at the token-side grain. Each outcome has two rows, one per token in the YES/NO pair. The primary key is `coin`, the native side-token identifier (e.g. `#54760`).

<Info>
  HIP-4 has three market categories:

  * `price_binary`: auto-generated price-threshold outcomes (Recurring), parameterized by an underlying asset, a target price, an expiry, and a recurrence period.
  * `categorical`: outcomes that belong to a parent question with multiple named choices and a fallback "Other".
  * `binary`: standalone named outcomes with no parent question.
</Info>

## Table Columns

| Column Name              | Description                                                                                                                                                                                                                     |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project                  | Top-level project namespace (`hyperliquid`).                                                                                                                                                                                    |
| protocol                 | Protocol within the project (`hyperliquid_hip4`).                                                                                                                                                                               |
| chain                    | The blockchain network (`hyperliquid`).                                                                                                                                                                                         |
| market\_title            | Human-readable title for the row.                                                                                                                                                                                               |
| category                 | Market type. One of 'price\_binary', 'categorical', 'binary'.                                                                                                                                                                   |
| sub\_category            | Underlying asset for Recurring outcomes (e.g. 'BTC'). NULL otherwise.                                                                                                                                                           |
| coin                     | The HL-native side-token identifier (e.g. '#54760'). Primary key.                                                                                                                                                               |
| encoding                 | HL-canonical numeric encoding for the side-token.                                                                                                                                                                               |
| asset\_id                | HL-canonical numeric identifier for the side-token.                                                                                                                                                                             |
| token\_name              | The fee-token symbol form (e.g. '+5476') used in `fee_token` for opens.                                                                                                                                                         |
| token\_side              | Which side of the outcome's YES/NO pair the row represents (0 or 1).                                                                                                                                                            |
| side\_label              | Display label for this row's token\_side (e.g. 'Yes', 'No', or a categorical label).                                                                                                                                            |
| outcome\_id              | HIP-4 outcome identifier (shared by both token sides).                                                                                                                                                                          |
| outcome\_name            | Outcome display name from the HL API. The literal string 'Recurring' marks HL's auto-generated price-binary outcomes.                                                                                                           |
| outcome\_description     | Outcome description string. For Recurring outcomes this is a structured pipe-separated payload (`class:...\|underlying:...\|expiry:...\|targetPrice:...\|period:...`). For named outcomes this is free-form prose.              |
| side\_specs              | VARIANT array with one entry per token side, each holding that side's label.                                                                                                                                                    |
| is\_recurring            | True for HL's auto-generated price-binary outcomes.                                                                                                                                                                             |
| class                    | The market class for Recurring outcomes (e.g. 'priceBinary'). NULL for non-Recurring outcomes.                                                                                                                                  |
| underlying               | The asset whose price the outcome resolves against (e.g. 'HYPE', 'BTC'). NULL for non-Recurring outcomes.                                                                                                                       |
| target\_price            | The target price for Recurring outcomes. Stored as VARCHAR. token\_side=0 resolves YES iff underlying price >= target\_price at expiry; token\_side=1 resolves YES iff price \< target\_price. NULL for non-Recurring outcomes. |
| period                   | The recurrence cadence (e.g. '15m', '1h', '1d'). NULL for non-Recurring outcomes.                                                                                                                                               |
| expiry\_ts               | Resolution timestamp (UTC). NULL for non-Recurring outcomes.                                                                                                                                                                    |
| question\_id             | Parent question ID. NULL for Recurring / orphan outcomes.                                                                                                                                                                       |
| question\_name           | Question name from the HL API.                                                                                                                                                                                                  |
| question\_description    | Question description from the HL API.                                                                                                                                                                                           |
| fallback\_outcome        | The outcome ID representing the parent question's fallback / "Other" choice.                                                                                                                                                    |
| named\_outcomes          | VARIANT array of outcome IDs grouped under the parent question.                                                                                                                                                                 |
| settled\_named\_outcomes | VARIANT array of outcome IDs that have settled (winning side).                                                                                                                                                                  |
| is\_named                | True when this outcome is one of the parent question's named outcomes.                                                                                                                                                          |
| is\_fallback             | True when this outcome is the parent question's fallback outcome.                                                                                                                                                               |
| event\_ticker            | Stable cross-side event identifier. Use for COUNT(DISTINCT) when reporting markets/events traded so a multi-outcome question counts as one event, not many token-side rows.                                                     |
| is\_winner               | True for the winning side of a settled outcome. NULL while unsettled.                                                                                                                                                           |
| is\_settled              | True once the outcome has been resolved on-chain.                                                                                                                                                                               |
| settled\_at              | Settlement timestamp (UTC). NULL while unsettled.                                                                                                                                                                               |
| resolution\_outcome      | The winning side\_label when `is_settled`.                                                                                                                                                                                      |
| market\_status           | One of 'active' (open), 'closed' (expired, awaiting settlement), 'settled' (resolved).                                                                                                                                          |
| active                   | True when the market is currently open for trading.                                                                                                                                                                             |
| closed                   | True when the market is no longer accepting new trades.                                                                                                                                                                         |
| end\_date                | Market end date (UTC).                                                                                                                                                                                                          |
| unique\_id               | Deterministic unique identifier per row.                                                                                                                                                                                        |
| \_created\_at            | Row creation timestamp.                                                                                                                                                                                                         |
| \_updated\_at            | Row last update timestamp.                                                                                                                                                                                                      |

## Sample Query

```sql theme={null}
SELECT
  coin,
  category,
  sub_category,
  market_title,
  market_status,
  is_settled,
  expiry_ts
FROM hyperliquid.predictions.markets
WHERE category = 'price_binary'
  AND market_status = 'active'
ORDER BY expiry_ts ASC
LIMIT 100
```
