> For the complete documentation index, see [llms.txt](https://docs.hyerapp.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyerapp.io/trading.md).

# Trading

When you trade on Hyer, you are buying or selling **shares** of one of two possible outcomes in a market. The price of each outcome is always between 0 and 1 unit of the settlement token, and the sum of both outcome prices is always 1.

If your chosen outcome is correct when the market resolves, each share is worth 1 unit of the settlement token. If it is incorrect, the shares are worth 0.

## How Prices Are Determined

Hyer uses an **Automated Market Maker (AMM)** similar to those found in decentralized exchanges. Prices are set algorithmically based on the balance of shares in the market’s liquidity pools.

For a binary market, the liquidity pool holds shares for both outcomes. The relationship between them follows a **constant product formula**:

```
LiquidityShares² = SharesOutcomeA × SharesOutcomeB
```

This ensures that whenever shares are bought or sold for one outcome, the price of both outcomes adjusts automatically.

## Initial Prices

When a market is created, the creator provides liquidity in the settlement token. This initial liquidity is split evenly between both outcomes, so prices start at **0.5** each.

Example:\
If the market is funded with 1,000 USDC:

* Shares in Outcome A = 1,000
* Shares in Outcome B = 1,000
* Initial price for each = 0.5

## Price Changes During a Trade

When someone buys shares of an outcome, the liquidity pool for that outcome decreases while the other outcome’s pool increases proportionally. The AMM then recalculates prices using the formula:

```
Price of Outcome A = SharesOutcomeB / (SharesOutcomeA + SharesOutcomeB)  
Price of Outcome B = SharesOutcomeA / (SharesOutcomeA + SharesOutcomeB)
```

This means buying Outcome A will raise its price and lower the price of Outcome B, reflecting the market’s updated sentiment.

#### Example Trade

A market starts with both outcomes priced at 0.5 and 1,000 shares each.

* A trader buys $300 of Outcome A (minus fees).
* After the purchase, the formula updates the pools and recalculates prices.
* Outcome A might move to 0.63, and Outcome B to 0.37, showing increased confidence in Outcome A.

## Why This Matters

This system ensures:

* **Continuous liquidity** — traders can enter and exit positions at any time before the market closes.
* **Fair odds** — prices reflect supply, demand, and market sentiment.
* **Decentralized control** — no single party sets prices manually.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.hyerapp.io/trading.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.
