# Markets and events

Every tradeable question on HermesTrade belongs to a two-level hierarchy: an **event** at the top, and one or more **markets** beneath it. Understanding this hierarchy is the foundation for everything else — market lookups, order placement, and position tracking all reference IDs that come from this structure.

***

## Events

An event is the real-world happening that prediction markets are built around — a sports match, an election, a protocol vote. It acts as a container for related markets and carries the metadata that describes the situation.

**Key Gamma API fields on an `Event`:**

| Field          | Type     | Description                                       |
| -------------- | -------- | ------------------------------------------------- |
| `id`           | string   | Unique event identifier                           |
| `title`        | string   | Human-readable event name                         |
| `slug`         | string   | URL-friendly identifier                           |
| `eventType`    | string   | Category of event (e.g., sports, politics)        |
| `category`     | string   | Sub-classification                                |
| `startDate`    | datetime | When the event begins                             |
| `endDate`      | datetime | When the event is expected to resolve             |
| `active`       | boolean  | Event is open and accepting activity              |
| `closed`       | boolean  | Event has concluded; markets in resolution        |
| `archived`     | boolean  | Fully settled; no longer shown by default         |
| `negRisk`      | boolean  | Whether this event uses the negRisk capital model |
| `volume`       | number   | Total lifetime trading volume                     |
| `volume24hr`   | number   | Volume in the last 24 hours                       |
| `liquidity`    | number   | Current resting liquidity across markets          |
| `openInterest` | number   | Total value of open positions                     |

Fetch events from `GET /events` (list) or `GET /events/{id}` (single). The `slug` is also a valid lookup key via `GET /events/slug/{slug}`.

***

## Markets

A market is a single binary question. Every market resolves to one of two outcomes — typically "Yes" and "No" — and every market is the unit of trading on HermesTrade. When you place an order, you are buying or selling the outcome shares of a specific market.

**Key Gamma API fields on a `Market`:**

| Field              | Type      | Description                                                        |
| ------------------ | --------- | ------------------------------------------------------------------ |
| `id`               | string    | Unique market identifier                                           |
| `conditionId`      | string    | On-chain condition identifier (used in resolution)                 |
| `question`         | string    | The binary question being traded                                   |
| `outcomes`         | string\[] | Outcome labels, e.g., `["Yes", "No"]`                              |
| `outcomePrices`    | string\[] | Current market prices per outcome                                  |
| `clobTokenIds`     | string\[] | `[YES_token_id, NO_token_id]` — ERC1155 token IDs used in the CLOB |
| `bestBid`          | string    | Highest current buy price                                          |
| `bestAsk`          | string    | Lowest current sell price                                          |
| `volume`           | number    | Lifetime trading volume                                            |
| `active`           | boolean   | Market is open                                                     |
| `closed`           | boolean   | Market has closed; resolution in progress                          |
| `acceptingOrders`  | boolean   | New orders can be submitted                                        |
| `enableOrderBook`  | boolean   | CLOB trading is enabled for this market                            |
| `negRiskAugmented` | boolean   | Market uses the negRisk capital model                              |

The `clobTokenIds` array is the bridge between the Gamma API and the CLOB API. The first element is the YES token ID; the second is the NO token ID. All CLOB endpoints that accept `token_id` expect one of these values.

***

## Single-market vs. multi-market events

**Single-market events** contain exactly one market. The event and its market are functionally the same thing — "Will X happen by date Y?" has one YES outcome and one NO outcome. These are the simplest case.

**Multi-market events** group several mutually exclusive outcomes under one event. A sports match might have markets for each possible score band, or a race might have one market per competitor. Traders can take positions across multiple markets within the same event. When an event uses `negRisk: true`, there is an additional capital efficiency mechanism that applies across its markets — see the [Order book](/core-concepts/order-book.md) page for details.

***

## Sports markets

Sports events are a first-class feature of HermesTrade, not an afterthought. They are backed by live game data via the `PredictGameFixture` model.

**Key `PredictGameFixture` fields:**

| Field                     | Type     | Description                                    |
| ------------------------- | -------- | ---------------------------------------------- |
| `sportType`               | string   | Sport category (see `GET /config/sport-types`) |
| `homeTeam` / `awayTeam`   | object   | Team metadata                                  |
| `scheduledAt`             | datetime | Kick-off / start time                          |
| `gameStatus`              | string   | `pre-game` \| `live` \| `finished`             |
| `homeScore` / `awayScore` | number   | Live score values                              |

{% hint style="warning" %}
When a game begins (status transitions to `live`), outstanding limit orders on related markets are canceled. If you are running an automated strategy, monitor `gameStatus` and manage your orders accordingly before the scheduled start time.
{% endhint %}

Use `GET /games` to list games with filters (sport type, date, status) and `GET /games/{id}/scores` for score sync metadata.

***

## Market lifecycle

A market moves through a predictable sequence of states:

{% stepper %}
{% step %}

### Active and accepting orders

`active: true`, `acceptingOrders: true`. The market is live; traders can post and fill orders freely.
{% endstep %}

{% step %}

### Event in progress

For sports markets, the underlying game has started. New orders may not be accepted during active play depending on market configuration.
{% endstep %}

{% step %}

### Closed, resolution pending

`closed: true`, `acceptingOrders: false`. The event has concluded. All open limit orders are automatically canceled. The market enters the adjudication process.
{% endstep %}

{% step %}

### Resolved and settled

`closed: true`, the adjudication's `resolvedAt` is set. Winning shares redeem at $1.00; losing shares at $0.00. Positions are settled.
{% endstep %}

{% step %}

### Archived

`archived: true`. The market is fully settled and excluded from default listings. Historical data remains accessible.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
The `negRisk` flag on an event and `negRiskAugmented` on a market indicate a capital-efficient model for multi-outcome events where all outcomes sum to one. The mechanics are explained on the [Order book](/core-concepts/order-book.md) page.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hermestrade.xyz/core-concepts/markets-and-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
