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