> 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/automated-market-maker-amm.md).

# Automated Market Maker (AMM)

Hyer uses an Automated Market Maker model inspired by decentralized exchanges, adapted specifically for prediction markets. This model ensures that liquidity and pricing adjust automatically as traders buy or sell outcome shares.

## How It Works

Each market has a liquidity pool that holds shares for every possible outcome. The AMM’s constant product formula keeps the pool balanced — when shares for one outcome are bought or sold, the prices of all outcomes shift accordingly. This dynamic pricing encourages fair odds and continuous liquidity.

## Liquidity Formula

In simple terms, the pool’s liquidity is the product of the number of shares for each outcome. For example:

* **Two outcomes**: Liquidity = SharesA × SharesB
* **Multiple outcomes**: Liquidity = SharesA × SharesB × SharesC × …

This ensures that any change in one outcome’s shares impacts the others.

## Price Calculation

Prices are determined by the relative balance of shares in the pool:

* In two-outcome markets, the price of one outcome is based on the shares of the other.
* In multi-outcome markets, each outcome’s price is calculated by multiplying the shares of all other outcomes, then dividing by the total of these values across the market.

This mechanism ensures that prices always reflect real-time market activity, rewarding informed predictions and keeping trading smooth without the need for order books.


---

# 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/automated-market-maker-amm.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.
