# Smart Contracts

**Who this is for:** Integrators and auditors who need the contract layout and behavior of Mento V3 (FPMM pools, oracles, limits, strategies). The Mento protocol consists of a set of smart contracts deployed on supported chains (e.g. [Celo](https://celo.org/)).

> **For app and frontend developers:** This section describes the Solidity internals and is intended for smart contract developers. To quote swaps, discover pools, and execute trades from JavaScript/TypeScript, the [**Mento SDK**](https://docs.mento.org/mento-v3/build/mento-sdk) is usually the easiest path. Each contract page below includes **code snippets** showing how to call the contracts directly from Solidity when you are building on-chain integrations or tooling.

**See also:** [Integration](https://docs.mento.org/mento-v3/build/integration) — integration paths; [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) — JS/TS library; [Deployments](https://docs.mento.org/mento-v3/build/deployments) — addresses and verification.

## Mento V3: FPMM-based exchange

In V3, the main exchange is built from **FPMM** (Fixed-Price Market Maker) pools. The following pages give precise contract-level documentation:

| Contract / topic         | Doc                                                                                                | Role                                                                                                                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FPMM**                 | [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm)                                 | Pool: two-token reserves, swap at oracle rate (minus fee), value protection, mint/burn, rebalance by allowlisted strategies, TradingLimitsV2.                                                                       |
| **FPMMFactory**          | [FPMMFactory](https://docs.mento.org/mento-v3/build/smart-contracts/fpmmfactory)                   | Deploys FPMM proxies, token order, default params and caps, pool registry.                                                                                                                                          |
| **OracleAdapter**        | [OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter)               | Supplies the pool with a valid rate: `getFXRateIfValid(rateFeedID)`; combines SortedOracles, BreakerBox (trading mode), and FX market hours.                                                                        |
| **Router**               | [Router](https://docs.mento.org/mento-v3/build/smart-contracts/router)                             | Quoting (`getAmountsOut`) and executing swaps; multihop via pool `getAmountOut`; uses FactoryRegistry and default factory.                                                                                          |
| **Liquidity strategies** | [Liquidity strategies](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies) | Base + ReserveLiquidityStrategy + CDPLiquidityStrategy; who may call rebalance, callback flow, incentive split.                                                                                                     |
| **TradingLimitsV2**      | [TradingLimitsV2](https://docs.mento.org/mento-v3/build/smart-contracts/tradinglimits)             | Per-token 5-min and 1-day net-flow caps; applied after each swap.                                                                                                                                                   |
| **BreakerBox**           | [BreakerBox](https://docs.mento.org/mento-v3/build/smart-contracts/breakerbox)                     | Circuit breakers; OracleAdapter reads trading mode; FPMM reverts when rate invalid.                                                                                                                                 |
| **Reserve**              | [Reserve](https://docs.mento.org/mento-v3/build/smart-contracts/reserve)                           | Holds collateral for Reserve-backed stables; used by ReserveLiquidityStrategy.                                                                                                                                      |
| **StableToken**          | [StableToken](https://docs.mento.org/mento-v3/build/smart-contracts/stabletoken)                   | ERC-20 Mento stables (USDm, EURm, GBPm, …).                                                                                                                                                                         |
| **CDPs**                 | [CDPs](https://docs.mento.org/mento-v3/build/smart-contracts/cdps)                                 | Collateralized debt positions (troves): borrow stables against collateral. Mento CDPs are a **fork of Liquity v2** — see [Liquity v2 docs](https://docs.liquity.org/) for full contract and protocol documentation. |
| **Audits**               | [Audits](https://docs.mento.org/mento-v3/build/smart-contracts/audits)                             | ChainSecurity V3 and Liquity v2 fork; historical audits.                                                                                                                                                            |

**Contracts:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core)
