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

> Prediction market metadata with API data, onchain events, and resolution outcomes.

The `polygon.predictions.markets` table provides metadata for prediction markets, combining API data, onchain events, and resolution outcomes at the token level. Each row represents a specific outcome token within a market.

Use this table to discover markets, analyze resolution patterns, and understand market structure across different categories.

### Table Columns

Unique Key: `market_unique_id`, `token_id`

| Column Name                  | Data Type         | Description                                       |
| ---------------------------- | ----------------- | ------------------------------------------------- |
| project                      | VARCHAR           | Project name (ex. polymarket).                    |
| protocol                     | VARCHAR           | Protocol name (ex. polymarket).                   |
| market\_unique\_id           | VARCHAR           | Unique key for grouping related markets.          |
| condition\_id                | VARCHAR           | Unique condition identifier.                      |
| market\_id                   | VARCHAR           | Market identifier.                                |
| market\_request\_id          | VARCHAR           | NegRisk market request ID.                        |
| market\_name                 | VARCHAR           | Market name from onchain data.                    |
| market\_description\_onchain | VARCHAR           | Market description from onchain events.           |
| question\_id                 | VARCHAR           | Unique question identifier.                       |
| question                     | VARCHAR           | Market question text.                             |
| description                  | VARCHAR           | Market description from API.                      |
| token\_id                    | VARCHAR           | Token ID for this outcome.                        |
| token\_outcome               | VARCHAR           | Token outcome name.                               |
| token\_name                  | VARCHAR           | Combined outcome and question name.               |
| token\_price                 | FLOAT             | Current token price.                              |
| is\_winner                   | BOOLEAN           | Whether this outcome won.                         |
| active                       | BOOLEAN           | Whether market is active.                         |
| archived                     | BOOLEAN           | Whether market is archived.                       |
| closed                       | BOOLEAN           | Whether market is closed.                         |
| accepting\_orders            | BOOLEAN           | Whether accepting new orders.                     |
| enable\_order\_book          | BOOLEAN           | Whether order book is enabled.                    |
| neg\_risk                    | BOOLEAN           | Whether this is a NegRisk market.                 |
| resolved\_by                 | VARCHAR           | Entity responsible for resolution.                |
| category                     | VARCHAR           | Main category.                                    |
| sub\_category                | VARCHAR           | Specific subcategory.                             |
| tags                         | VARCHAR           | Original category tokens.                         |
| api\_category                | VARCHAR           | Original category from API before categorization. |
| api\_type                    | VARCHAR           | API data source type.                             |
| start\_date                  | TIMESTAMP\_NTZ(9) | Market start time.                                |
| end\_date                    | TIMESTAMP\_NTZ(9) | Market end time.                                  |
| game\_start\_time            | TIMESTAMP\_NTZ(9) | Event start time.                                 |
| seconds\_delay               | NUMBER            | Resolution delay in seconds.                      |
| fpmm                         | VARCHAR           | FPMM contract address.                            |
| maker\_fee                   | FLOAT             | Maker fee.                                        |
| taker\_fee                   | FLOAT             | Taker fee.                                        |
| oracle                       | VARCHAR           | Oracle contract address.                          |
| fee\_bips                    | NUMBER            | Fee in basis points.                              |
| prepared\_at                 | TIMESTAMP\_NTZ(9) | Market preparation timestamp.                     |
| outcome                      | VARCHAR           | Resolution outcome.                               |
| resolved\_at                 | TIMESTAMP\_NTZ(9) | Resolution timestamp.                             |
| created\_at                  | TIMESTAMP\_NTZ(9) | API record creation time.                         |
| updated\_at                  | TIMESTAMP\_NTZ(9) | API record update time.                           |

***

### Sample Query

<Tabs>
  <Tab title="Market Category Diversity">
    Find market category diversity:

    ```sql theme={null}
    select
      category, 
      count(*) as category_count
    from polygon.predictions.markets 
    group by category
    order by category_count desc
    ```
  </Tab>
</Tabs>
