> For the complete documentation index, see [llms.txt](https://docs.metric.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metric.xyz/start-here/how-metric-works.md).

# How Metric works

An active pool separates pricing logic from liquidity allocation.

<figure><img src="https://2762670563-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvQVWzbfEJJ8Aelwvxmj%2Fuploads%2FcLOr8P1wsJFTy223TJ8l%2Fmetric_active_bin_deviation_v3.png?alt=media&#x26;token=296c18a8-f5d3-4c6f-8c28-a158bd266bbd" alt=""><figcaption></figcaption></figure>

## Pricing

Each pool has a [Price Provider](/how-pools-work/price-providers.md), a smart contract that supplies a quote containing bid, ask and reference price.

It can follow oracle feeds, use other onchain data, or run custom pricing logic. Most of an active pool's flexibility lives in its provider.

The pool doesn't form its own view of price. It relies on the price provider and applies its own execution logic on top. Halting trading is an accepted safe state for a pool.

## Liquidity and deviation

Liquidity sits in **bins**, each covering a percentage range around the reference. The **active bin and the position within it determine the current deviation**.

A position halfway through a **+1% to +2% bin** means **+1.5% deviation**. At a $100 reference, the pool's current price before the spread is $101.50.

If the reference rises to $105 and nobody trades, the pool's price becomes $106.58 before the spread, still 1.5% above the reference. **The deviation and token quantities stay unchanged.** Unlike in concentrated-liquidity AMMs, LPs don't need to withdraw and redeposit to follow the price.

<figure><img src="https://2762670563-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvQVWzbfEJJ8Aelwvxmj%2Fuploads%2FJ2ONnHfy5EP8cpS11AwW%2Fimage.png?alt=media&#x26;token=2d73b4c4-253e-46d8-9fe2-2c1bc1d8d39d" alt=""><figcaption></figcaption></figure>

## Swaps

A trade fills in the active bin first and continues into the next bin once that one runs out. Buying pushes the pool's deviation up and selling pushes it down, so the larger the trade, the worse its average price. That's **price impact**.

## Extensions

Extensions add rules around swaps, deposits and withdrawals. They can restrict who trades or deposits, reject trades that breach configured limits, block all trades when something goes wrong, or record fills for a pricing strategy. They **can't change a trade's price**: the pool reads the Price Provider's quote before any extension runs, and an extension can only let the trade through or reject it.

See [Risks and safeguards](/use-metric/provide-and-manage-liquidity/risks-and-safeguards.md).

More detail: [Liquidity and bins](/how-pools-work/liquidity-and-bins.md) · [Price Providers](/how-pools-work/price-providers.md) · [Extensions](/how-pools-work/extensions-and-permissions.md).
