# 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**](/mento-v3/build/mento-sdk.md) 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](/mento-v3/build/integration.md) — integration paths; [Mento SDK](/mento-v3/build/mento-sdk.md) — JS/TS library; [Deployments](/mento-v3/build/deployments.md) — 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](/mento-v3/build/smart-contracts/fpmm.md)                                 | Pool: two-token reserves, swap at oracle rate (minus fee), value protection, mint/burn, rebalance by allowlisted strategies, TradingLimitsV2.                                                                       |
| **FPMMFactory**          | [FPMMFactory](/mento-v3/build/smart-contracts/fpmmfactory.md)                   | Deploys FPMM proxies, token order, default params and caps, pool registry.                                                                                                                                          |
| **OracleAdapter**        | [OracleAdapter](/mento-v3/build/smart-contracts/oracleadapter.md)               | Supplies the pool with a valid rate: `getFXRateIfValid(rateFeedID)`; combines SortedOracles, BreakerBox (trading mode), and FX market hours.                                                                        |
| **Router**               | [Router](/mento-v3/build/smart-contracts/router.md)                             | Quoting (`getAmountsOut`) and executing swaps; multihop via pool `getAmountOut`; uses FactoryRegistry and default factory.                                                                                          |
| **Liquidity strategies** | [Liquidity strategies](/mento-v3/build/smart-contracts/liquidity-strategies.md) | Base + ReserveLiquidityStrategy + CDPLiquidityStrategy; who may call rebalance, callback flow, incentive split.                                                                                                     |
| **TradingLimitsV2**      | [TradingLimitsV2](/mento-v3/build/smart-contracts/tradinglimits.md)             | Per-token 5-min and 1-day net-flow caps; applied after each swap.                                                                                                                                                   |
| **BreakerBox**           | [BreakerBox](/mento-v3/build/smart-contracts/breakerbox.md)                     | Circuit breakers; OracleAdapter reads trading mode; FPMM reverts when rate invalid.                                                                                                                                 |
| **Reserve**              | [Reserve](/mento-v3/build/smart-contracts/reserve.md)                           | Holds collateral for Reserve-backed stables; used by ReserveLiquidityStrategy.                                                                                                                                      |
| **StableToken**          | [StableToken](/mento-v3/build/smart-contracts/stabletoken.md)                   | ERC-20 Mento stables (USDm, EURm, GBPm, …).                                                                                                                                                                         |
| **CDPs**                 | [CDPs](/mento-v3/build/smart-contracts/cdps.md)                                 | 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](/mento-v3/build/smart-contracts/audits.md)                             | ChainSecurity V3 and Liquity v2 fork; historical audits.                                                                                                                                                            |

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


---

# Agent Instructions: 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.mento.org/mento-v3/build/smart-contracts.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.
