> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lunya.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange Overview

> The native AMM of Lunya: three pool types, one plugin system

## What it is

The Lunya exchange is an AMM built as a **port of Uniswap V3 Core** to modern Solidity, then extended well beyond it. The core carries **ten typed hooks**, takes its fee from a plugin instead of an immutable field, and supports three pool types behind one shared interface.

<Note>
  It is a *port*, not a fork: rewritten for Solidity 0.8.x under Foundry, with a differential test suite verifying the math against Uniswap's own compiled bytecode. For where this sits against V2, V3, and V4, see [Compared to Uniswap](/exchange/uniswap-comparison).
</Note>

## Three pool types

| Type                            | Curve                                | Best for                                                  |
| ------------------------------- | ------------------------------------ | --------------------------------------------------------- |
| **CL** — Concentrated Liquidity | Uniswap V3-style ranged positions    | Most trading pairs                                        |
| **CP** — Constant Product       | Classic `x·y=k` full-range           | Simple LPing, [launchpad graduations](/launch/graduation) |
| **STABLE**                      | Amplified StableSwap curve, tickless | Tightly correlated pairs (e.g. stablecoins)               |

Every pool type answers the same interface — swap, mint, burn, collect, flash have identical signatures on all three — so integrators never need to know which curve they are holding.

<Info>
  Details in [Pools & Fees](/exchange/pools-and-fees), including how fees are set and where they go.
</Info>

## What the plugin system enables

Each pool can attach a plugin that reacts to pool events through typed hooks. The default plugin, attached automatically at pool creation, composes five modules:

<CardGroup cols={2}>
  <Card title="Dynamic Fees" icon="wave-sine" href="/exchange/plugins#dynamic-fees">
    The swap fee rises with measured price volatility and relaxes when the market calms
  </Card>

  <Card title="Limit Orders" icon="list-check" href="/exchange/limit-orders">
    On-chain limit orders, filled inside the swap that crosses them — a fill stays a fill
  </Card>

  <Card title="TWAP Oracle" icon="clock" href="/exchange/plugins#twap-oracle">
    Time-weighted price observations, as a plugin instead of dead weight in every pool
  </Card>

  <Card title="Security Module" icon="shield" href="/exchange/plugins#security-module">
    An emergency brake that can pause new activity — but never blocks the way out
  </Card>
</CardGroup>

Plus a **farming proxy** that feeds price movements to reward programmes — see [Farming](/exchange/farming).

## Beyond swaps

* **[Flash loans](/exchange/flash-loans)** — every pool can lend its balances within a single transaction
* **[Farming](/exchange/farming)** — liquidity incentive programmes that never take custody of your position NFT
* **[Liquidity Vaults](/exchange/vaults)** — automated management of concentrated positions for passive LPs

## For developers

The exchange keeps Uniswap V3's **events byte-identical** — existing subgraphs and indexers work unchanged — while callbacks and pool discovery differ. Integration notes in [Uniswap V3 Compatibility](/developers/integrations).
