> Agents can also search and read this documentation through its [MCP server](https://docs.mento.org/mento-v3/~gitbook/mcp).

# 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
This site has an agentic ask interface you may use to query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mento.org/mento-v3/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

---

# Overview

Overview of Mento V3 and how these docs are organized. Start here to understand the protocol and find the right section for your goal.

***

## What is Mento V3?

**A decentralized exchange (DEX) for onchain foreign exchange (FX).** Users swap stablecoins at **FX rates** — e.g. USDC ↔ GBPm at USD/GBP, or USDC ↔ EURm at USD/EUR — so onchain execution can compete with off-chain spot FX. The **core innovation** of Mento V3 is **Fixed-Price Market Makers (FPMMs)**: pools that quote an oracle rate instead of deriving price from reserves.

### Why a different design?

Most DEXs use **curve-based automated market makers (AMMs)**: the swap price comes from the pool’s reserves and only changes when someone trades. That causes **slippage** (traders miss the true rate) and **loss-versus-rebalancing (LVR)** (arbitrageurs profit when the quote is stale).

For FX, the fair rate is already known off-chain. We don’t need the pool to *discover* the price — we need it to **use** it.

### Fixed-Price Market Makers (FPMMs) — the core of V3

Every Mento V3 swap pool is an FPMM. Each pool is tied to an **oracle** (external price feed) and **always quotes that rate** (minus a fee).

**Today, Chainlink is the only oracle source used in Mento V3.** In practice, that means Mento's FX-priced pools use a **Chainlink-backed rate path** through the `OracleAdapter`.

* No reserve-based curve → no curve-based slippage, no LVR from a stale pool price.
* When the oracle is accurate, traders get the FX rate and **liquidity providers (LPs)** aren’t drained by arbitrage.

This design relies on **high-quality stablecoins** that accurately reflect the underlying fiat currencies—something that should increasingly be the case as the stablecoin space matures. Mento’s **circuit breakers** trip when those stablecoins move too far off peg, so trading can be halted until conditions are safe again.

For **Mento v2**, **Chainlink** is also the primary oracle.

### One invariant for all operations

Every FPMM pool keeps one number constant: **value at the oracle per LP share**,

$$I = \frac{V}{S}$$

* **V** = pool value at the oracle price (reserves valued at the oracle rate).
* **S** = total LP share supply.
* **I** = value per share at the oracle.

**I** is preserved on **swap** (V, S unchanged), **mint/burn** (value in proportion), and **rebalance** (strategy returns the other token at oracle rate)—when we ignore fees and incentives. All operations happen at fair value as long as the oracle rate is precise.

That makes the design natural: the core is to enforce that all operations are conducted at fair value (assuming the oracle rate is precise) and to protect against cases where the oracle rate is imprecise through additional protocol layers.

→ Full mechanics: [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm).

### How the protocol is structured

Beyond the invariant, the protocol uses several building blocks—each with a different role. **Trading limits and the circuit breaker** protect the pool when the oracle is wrong, stale, or manipulated. **Today that oracle path is Chainlink-only.** **Liquidity strategies** address the fact that with no curve, reserves can become one-sided as users trade; they rebalance so the pool stays usable. **Fees and incentives** fund the protocol and reward different actors (LPs, keepers, governance); the swap spread in particular also adds a band where arbitrage is unprofitable if the oracle is slightly off.

| Piece                                  | Role                                                                                                                                                                                                                                                                              |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Trading limits & circuit breakers**  | Protect when the oracle is wrong, stale, or manipulated: limits cap flow per token over time; the circuit breakers trip (and halt trading) when stablecoins move too far off peg or when other safety thresholds are breached.                                                    |
| **Liquidity strategies (rebalancing)** | No curve → reserves can become one-sided. Allowlisted strategies rebalance: take surplus token from the pool, return the other at the oracle rate (capped incentive). Keeps the pool usable.                                                                                      |
| **Fees & incentives**                  | Fund the protocol and reward different actors: e.g. swap fees (LP and protocol), rebalance incentives for keepers and strategies, governance-driven revenue flows (MENTO). The swap spread in particular also provides additional arb protection when the oracle is slightly off. |

***

## How these docs are organized

The documentation is split into four sections. Use the one that matches your goal.

### [Get Started](https://docs.mento.org/mento-v3/get-started/quick-start-guides)

**For:** New users who want to do something with Mento V3 right away.

* **This page (Overview)** — What Mento V3 is and how the docs are organized (see above).
* [**Quick Start Guides**](https://docs.mento.org/mento-v3/get-started/quick-start-guides) — Step-by-step: your first swap, adding liquidity, borrowing a stable, earning in the Stability pool, or integrating.

### [Dive Deeper](https://docs.mento.org/mento-v3/dive-deeper/fpmm)

**For:** Readers who want to understand how the protocol works under the hood.

* [**FPMMs**](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — Why Mento uses oracle pricing (and why curve-based AMMs don’t work well for FX), how Fixed-Price Market Makers work, and how Mento currently relies on Chainlink as its oracle source. Subpages cover oracles & circuit breakers and TradingLimitsV2.
* [**CDPs**](https://docs.mento.org/mento-v3/dive-deeper/cdp) — How collateralized debt positions back synthetic Mento stables (e.g. GBPm).
* [**The Reserve**](https://docs.mento.org/mento-v3/dive-deeper/the-reserve) — How USDm and EURm are backed by the Reserve; two backing models (Reserve vs CDP).
* [**Protocol Economics**](https://docs.mento.org/mento-v3/dive-deeper/protocol-economics) — Value flows, fees, incentives, and revenue (FPMM, CDP, MENTO).
* [**Governance & MENTO**](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento) — How the protocol is governed, the MENTO token, tokenomics, and participation (voting, proposals, watchdogs).
* [**Security**](https://docs.mento.org/mento-v3/dive-deeper/security) — Risk overview and audit reports.

### [Build](https://docs.mento.org/mento-v3/build/repository-overview)

**For:** Developers and protocols integrating with Mento V3.

* [**Repository Overview**](https://docs.mento.org/mento-v3/build/repository-overview) — Mento repos and where to find code, contracts, and tooling.
* [**Integration**](https://docs.mento.org/mento-v3/build/integration) — How to add Mento stables, use Mento's Chainlink-backed oracle path, and find deployment addresses. Links to the SDK, smart contracts, and deployments.
* [**Mento SDK**](https://docs.mento.org/mento-v3/build/mento-sdk) — JavaScript/TypeScript library for quotes and swaps.
* [**Smart Contracts**](https://docs.mento.org/mento-v3/build/smart-contracts) — Contract reference (FPMM, oracles, limits, strategies).
* [**Deployments**](https://docs.mento.org/mento-v3/build/deployments) — Addresses, verification, and parameters.
* [**Troubleshooting**](https://docs.mento.org/mento-v3/build/troubleshooting) — Common integration issues (swap/quote reverts, Router vs pool, mint/burn, rebalancing, oracle/breakers, SDK).

### [Other](https://docs.mento.org/mento-v3/other/getting-mento-stables)

**For:** Getting stables, lookup, and supporting material.

* [**Getting Mento Stables**](https://docs.mento.org/mento-v3/other/getting-mento-stables) — Paths to obtain USDm, EURm, GBPm (app, Celo, mobile, other chains, CEX, on-ramp).
* [**Earn Merkl rewards on Monad (FPMMs)**](https://docs.mento.org/mento-v3/other/merkl-fpmm-rewards-monad) — Provide liquidity to USDC/USDm and GBPm/USDm on Monad and earn campaign rewards.
* [**Analytics & Dashboards**](https://docs.mento.org/mento-v3/other/analytics-and-dashboards) — Links to reserve and on-chain analytics.
* [**Glossary**](https://docs.mento.org/mento-v3/other/glossary) — Short definitions of terms (AMM, FPMM, LVR, oracle, rebalance, etc.).

***

*Previous protocol architecture (v2) is documented in Mento V2 docs.*


# Quick Start Guides

Do one thing now — swap at FX rates, add liquidity, or borrow a stable.

Choose what you want to do first — swap, add liquidity, borrow, or earn (Stability pool). For the big picture, see the [Overview](https://docs.mento.org/mento-v3).

***

## ✨ Your first on-chain FX swap — no slippage

1. Go to [**app.mento.org**](https://app.mento.org/?chain=42220) and **connect your wallet** (header; e.g. MetaMask, Valora) on a supported chain (e.g. Celo).
2. On the swap screen, click **Select** next to **From** and choose the token you’re selling (e.g. USDC). Click **Select** next to **To** and choose the token you’re buying (e.g. GBPm). Enter the amount — or click **MAX** to use your full balance.
3. Click **Swap**. If the app asks for token approval first, confirm **Approve …**, then click **Swap** again.
4. On the confirmation screen, check the rate and fees, then click **Confirm Swap**.

You get the same rate you’d see off-chain for GBP/USD. No curve, no slippage. 🎯

[Getting Mento stables →](https://docs.mento.org/mento-v3/other/getting-mento-stables)

***

## 💧 Add liquidity and earn fees

1. **Get both tokens** — Use the swap flow above to get each side of the pair (e.g. some GBPm and some USDm), or source them elsewhere (CEX, bridge).
2. Go to [**app.mento.org**](https://app.mento.org/pools?chain=42220) and **connect your wallet**.
3. Open **Pools** or **Liquidity**. Select a pool (e.g. **GBPm/USDm**).
4. Enter amounts for both tokens; the app shows the required ratio. Confirm. You’re now an LP and earn fees from swaps. 🎯

[Swap & liquidity →](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md#adding-liquidity-mint)

**On Monad:** Provide liquidity to **USDC/USDm** or **GBPm/USDm** and earn **Merkl campaign rewards**. See [Earn Merkl rewards on Monad (FPMMs)](https://docs.mento.org/mento-v3/other/merkl-fpmm-rewards-monad).

***

## 🏦 Borrow a stable (e.g. GBPm)

A **Trove** (CDP) lets you lock **USDm** as collateral and borrow another stable (e.g. GBPm) against it. You set your own interest rate; there’s no fixed repayment schedule. Keep your collateral ratio above the minimum or the position can be liquidated.

1. Go to [**app.mento.org**](https://app.mento.org/borrow?chain=42220) and **connect your wallet** (e.g. Celo).
2. Open **Borrow**. Select the asset to borrow (e.g. **GBPm**) in the **dropdown at the top right**, then click **+ Open Your First Trove**.
3. On the **Open a Trove** screen:
   * **COLLATERAL** — Enter how much USDm to deposit (or **MAX**). Your balance is shown next to the field.
   * **BORROW** — Enter how much GBPm to borrow. Minimum is **£1,000 GBPm**.
   * **LOAN-TO-VALUE** — The bar shows risk (SAFE → MODERATE → RISKY → LIQ). Liquidation happens when your collateral ratio drops below the minimum (**110%**); the app shows “Liquidation at …%”.
   * **ANNUAL INTEREST RATE** — This is the interest you pay on your borrowed amount. Set or pick a rate (minimum **0.2%**). In Liquity v2, anyone can **redeem**: they burn GBPm and receive USDm collateral from open troves. Troves are ordered by interest rate, and **the lowest-interest troves are redeemed first**. So a lower rate means cheaper borrowing but you’re first in line to be redeemed against; a higher rate costs more but reduces that risk.
   * Review the **loan summary** on the right, then confirm (**Enter collateral amount** / **Open Trove**). To earn from the Stability pool with your borrowed GBPm (or any CDP-based stable), switch to **Earn** (see below). 🎯

[CDP operations →](https://docs.mento.org/mento-v3/dive-deeper/cdp)

***

## 📈 Earn — Stability pool

The **Stability pool** is only available for **CDP-based stablecoins** (e.g. **GBPm**), not for Reserve-backed stables like USDm or EURm. Deposit into the pool to earn a share of **trove interest** (interest paid by borrowers) and **liquidation gains** (when liquidations occur, your deposit repays debt and you receive collateral at a discount). If the app shows additional claimable rewards, those are program-specific and may vary over time. No lock-up — withdraw anytime.

1. Go to [**app.mento.org**](https://app.mento.org/earn?chain=42220) and **connect your wallet**.
2. Switch to the **Earn** tab (top nav: Swap, Pool, Borrow, **Earn**).
3. Select the asset (e.g. **GBPm**) in the currency selector. You'll see the **Stability pool** for that asset: total deposits, pool APY, avg. borrow rate.
4. Under **Deposit**, enter an amount (or use **25%**, **50%**, **75%**, **MAX**). Optionally check **Claim rewards with deposit** to claim pending rewards when you deposit. Click **Enter amount to deposit** (or the active deposit button) to confirm. No lock-up — you can withdraw anytime. 🎯

[CDP operations →](https://docs.mento.org/mento-v3/dive-deeper/cdp)

***

**More:** [Overview](https://docs.mento.org/mento-v3) · [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) · [Earn Merkl rewards on Monad](https://docs.mento.org/mento-v3/other/merkl-fpmm-rewards-monad)


# FPMMs

This page is the **reference** for how FPMMs work in Mento V3: why Mento uses oracle pricing, the invariant, operations, rebalancing, and configuration. Today, the oracle source behind that pricing path is **Chainlink**.

Because **FX-priced FPMMs** read rates through `OracleAdapter.getFXRateIfValid(rateFeedID)`, they also inherit **FX market-hours restrictions** from `OracleAdapter -> MarketHoursBreaker`.

***

## Why oracle pricing? (and why not curve-based AMMs)

Most DEXs use **curve-based AMMs** (constant-function market makers, or CFMMs): the pool has a trading function of **reserves only**, and the **execution price** is derived from that — for example in a constant-product pool the spot price is the ratio of reserves and changes only when someone trades. So the pool *is* the price: the quoted rate comes from reserves and **moves only when someone trades**. Between trades, when the external market moves, the pool’s quote is **stale**. That creates two problems:

1. **LVR (loss-versus-rebalancing)** — Arbitrageurs trade against the stale quote at better-than-fair prices. LPs effectively “sell low and buy high”; the loss to LPs equals arbitrageur profit. It’s a structural cost of the design.
2. **Slippage** — Traders don’t get the market rate; they execute **along the curve**. Execution price depends on trade size (price impact), so even small trades can get a worse rate than the true FX rate.

In CFMMs, the **curvature** of the trading function governs both: a flatter curve gives lower slippage but higher LVR. You cannot tune a CFMM so that everyone gets the fair rate with no cost. For **FX and stablecoins**, the fair rate already exists off-chain (spot, CEX). So we don’t need the pool to *discover* the price — we need it to **use** it. That is what **oracle pricing** does: the pool quotes an external **oracle** rate (minus a fee). In Mento V3 today, that oracle source is **Chainlink**. No reserve-based curve, no curve-based slippage, no LVR from a stale pool price. Risks shift to **oracle** quality and **inventory**; the protocol addresses those with **TradingLimitsV2**, **circuit breakers**, and **rebalancing** by allowlisted strategies.

***

## The invariant: I = V / S

In Mento V3, every FPMM maintains a single **invariant** across all operations:

$$I = \frac{V}{S}$$

where the pool **value at the oracle price** is

$$V = p^\top R$$

(reserves $$R$$ weighted by oracle $$p$$; $$S$$ = total **LP share supply**). So $$I$$ is value at the oracle per LP share. **This holds under all operations only when we ignore fees and incentives**—i.e. we treat swap as at the oracle rate and rebalance as returning exactly the other token at the oracle; in practice, swap fees (LP and protocol) and the capped rebalance incentive mean the accounting is slightly more involved.

* **V** = pool **value at the oracle price** (the sum of reserve amounts weighted by the oracle). So V is “how much the reserves are worth at the oracle rate.”
* **S** = total **LP share supply** (the number of liquidity-provider tokens in existence).
* **I = V / S** = “value at the oracle per LP share.”

This **I** is preserved on (when fees and incentives are ignored):

* **Swap** — V and S do not change; only the composition of reserves changes. So I is unchanged. (In practice the pool keeps swap fees.)
* **Mint** (add liquidity) — You add both tokens in the **current reserve ratio**; you receive new shares in proportion to the value you add (at the pool’s implied price, which matches the oracle at equilibrium). The protocol is designed so I is preserved.
* **Burn** (remove liquidity) — You burn shares and withdraw a proportional share of reserves; I stays the same for everyone.
* **Rebalance** — The pool sends one token to a strategy and receives the other at the oracle rate (with a capped incentive). V and S do not change in the idealized case; in practice the strategy may keep a capped incentive, so the invariant holds only when we ignore that incentive.

So “value per LP share at the oracle” is the **single number** that the protocol keeps constant across swaps, mints, burns, and rebalances **when we abstract away fees and incentives**. That gives LPs a clear accounting: your share of the pool is always worth a well-defined amount at the oracle price.

**How the building blocks fit together:** **FPMMs** give you the swap rate at the oracle; the **invariant** (I = V/S) keeps accounting consistent when we ignore fees and incentives. **TradingLimitsV2** and the **circuit breaker** protect when the oracle is wrong, stale, or manipulated. **Liquidity strategies** rebalance inventory when reserves drift too far from the oracle, so the pool can keep serving trades. Fees and incentives align LPs, keepers, and governance.

***

## Pool mechanics in short

| Operation     | What happens                                                                                                                       | Invariant I = V/S |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| **Swap**      | You send token A, receive token B at oracle rate (minus fee). Reserves change; value at oracle (V) and share supply (S) unchanged. | Preserved         |
| **Mint**      | You add both tokens in current reserve ratio; receive LP tokens. V and S increase in proportion.                                   | Preserved         |
| **Burn**      | You burn LP tokens; receive proportional share of both reserves. V and S decrease.                                                 | Preserved         |
| **Rebalance** | Allowlisted strategy takes one token from pool, returns the other at oracle rate. V and S unchanged.                               | Preserved         |

*The “Preserved” column holds when we ignore fees and incentives; in practice, swap fees and the rebalance incentive affect the exact accounting.*

Every swap also satisfies **value protection**: after the swap, the pool’s reserve value at the oracle (in one chosen numéraire) must not be less than before (once fee value is credited). If the oracle is wrong and trading is not halted, value can still be extracted compared to a fair price.

***

## Weekend And Holiday Impact

FX-priced FPMMs use `OracleAdapter.getFXRateIfValid(rateFeedID)` for quotes, swaps, and rebalancing checks. As a result, those actions are only available when the FX market is considered open.

Under the current `MarketHoursBreaker`, FX is treated as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Dec 25** and **Jan 1**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

### Not Possible While FX Markets Are Closed

* **Quote or swap** on affected FX-priced pools such as **GBPm/USDm** or **EURm/USDm**
* **Rebalance** affected FX-priced pools, because the pool cannot read a valid FX rate
* **App or SDK flows** that depend on a live FX quote for those pools

### Still Possible While FX Markets Are Closed

* **Add liquidity** (`mint`) to an existing pool if you already hold both tokens in the required ratio
* **Remove liquidity** (`burn`) from an existing pool
* Use pools that do **not** rely on FX market-hours gating, such as **USDC/USDm**

So the weekend/holiday restriction does **not** shut down all FPMM activity. It specifically gates **FX-priced pool operations that require a live valid FX rate**.

***

## Rebalancing (V3)

When users trade one-sided (e.g. everyone sells token A for token B), the pool’s **reserves** become imbalanced: too much of one token, too little of the other. The pool does not automatically “rebalance” itself. Instead:

* The pool **monitors** how far its **reserve-implied price** is from the **oracle** price. When that deviation exceeds a **threshold** (separate for “above” and “below”), the pool becomes **eligible for rebalancing**.
* Only **allowlisted liquidity strategies** can call the pool’s rebalance function. The pool sends one token to the strategy and calls back into the strategy; the strategy returns the other token at the oracle rate. The strategy may keep a **capped rebalance incentive** (the pool enforces a **minimum repayment** so value loss is bounded).
* In V3, rebalancing moves the pool toward a **threshold boundary** (a band around the oracle), **not** to exact 50/50. That limits how much the pool moves in one rebalance and reduces attack surface.
* **Who triggers:** Anyone can call the **strategy’s** public `rebalance(pool)` (permissionless). The strategy enforces a **cooldown** and then calls the pool. So “keepers” can trigger rebalances and earn incentives without special permission.

See [Rebalancing & strategies](https://docs.mento.org/mento-v3/dive-deeper/fpmm/rebalancing-and-strategies) for more detail.

***

## Liquidity strategies

Different pools need different **sources** of liquidity for rebalancing. Mento V3 uses **liquidity strategies**: each is a contract allowlisted by one or more pools. When the pool calls the strategy during rebalance, the strategy must return the other token; it gets that token from somewhere (e.g. the protocol **Reserve**, or a **CDP** stability pool).

* **Reserve strategy** — For fully backed Mento stablecoins (e.g. USDm, EURm). The **Reserve** holds collateral; the strategy can mint or burn stablecoins and move collateral to rebalance the pool.
* **CDP strategy** — For synthetic stablecoins (e.g. GBPm) created by collateralized debt. The strategy interacts with the **stability pool** and borrowing/repayment to source or sink the stablecoin when rebalancing.
* **Third-party strategy** — External issuers can provide their own strategy contract (allowlisted by governance) for custom liquidity sources.

***

## Pool configuration

Each FPMM is configured with parameters such as:

* **LP fee** and **protocol fee** — Deducted from swaps; the remainder is the rate the user gets (oracle minus fee).
* **Rebalance incentive** — Maximum share of the rebalance amount the strategy may keep; the pool enforces a minimum repayment.
* **Rebalance thresholds** — How far the reserve price must deviate from the oracle (above/below) before rebalancing is allowed.
* **Oracle** — Which Chainlink-backed price feed (via `OracleAdapter` + rate feed ID) the pool uses, and whether to invert the rate.
* **Trading limits** — Per-token caps over 5-minute and 1-day windows (TradingLimitsV2).
* **Circuit breakers** — The pool uses the OracleAdapter/BreakerBox so that swaps can be halted when the oracle is invalid, stale, or when breakers trip.

These are set at deployment or by pool admin / governance. See [Trading limits](https://docs.mento.org/mento-v3/dive-deeper/fpmm/trading-limits) and [Oracles, price feeds & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers).

***

## Liquidity provision: what LPs get

Anyone can add liquidity by depositing **both** tokens in the **current reserve ratio** and receiving LP tokens. Unlike in many curve-based AMMs:

* There is **no LVR** from a stale curve (the pool quotes the oracle).
* **Value per share** at the oracle (I = V/S) is preserved on every operation.
* LPs earn **fees** from swap volume and may face **path-dependent** changes in composition when the oracle price moves between rebalances (so there can be “impermanent loss” in composition terms, but not from arbitrageurs picking off a stale quote).

See [Swap & liquidity](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md) for how to mint and burn in practice.

***

## Next steps

* [Oracles, price feeds & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers) — How the pool gets the rate and when trading is gated.
* [Rebalancing & strategies](https://docs.mento.org/mento-v3/dive-deeper/fpmm/rebalancing-and-strategies) — Who rebalances, thresholds, boundaries, incentives.
* [Trading limits](https://docs.mento.org/mento-v3/dive-deeper/fpmm/trading-limits) — Caps; [Oracles & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers) — halts.
* [The Reserve](https://docs.mento.org/mento-v3/dive-deeper/the-reserve) — Backing for fully backed Mento stables (used by the Reserve liquidity strategy).
* [Protocol Economics](https://docs.mento.org/mento-v3/dive-deeper/protocol-economics) — Value flows, fees, incentives, and revenue.


# Oracles, price feeds & circuit breakers

This page explains how **oracles** and **price feeds** work in Mento V3, and how **circuit breakers** gate trading. An **oracle** is an external source of price data that the protocol trusts. In V3, each FPMM pool uses an oracle to set the **swap rate**: every swap executes at that rate (minus fee), so oracle quality and validity are central to safety.

**Today, Chainlink is the only oracle source used in Mento V3.** The `OracleAdapter` is the protocol's validity-gated interface to that Chainlink-backed rate path.

For **FX-priced FPMMs**, this also means pool activity inherits **FX market-hours restrictions** from `OracleAdapter -> MarketHoursBreaker`. In practice, affected pools can be unavailable for quoting and swapping on weekends and certain holidays even if the last oracle price is still on-chain.

***

## Why oracles matter in Mento V3

In an **FPMM** (Fixed-Price Market Maker), the **execution price is the oracle rate** (minus fee). The pool does not derive the price from its reserves. So:

* **Correctness** — If the oracle is wrong, the pool can quote a bad rate and LPs or the pool can lose value.
* **Freshness** — If the oracle is stale (not updated), the quoted rate may lag the market; TradingLimitsV2 and circuit breakers help bound the damage.
* **Gating** — In V3, the pool will **revert** swaps when the oracle is invalid, stale, or when **circuit breakers** (e.g. trading mode, FX market hours) say not to trade.

So oracles are both the **source of the swap rate** and one of the **safety gates** for trading.

***

## How the pool gets the rate (V3)

In Mento V3, pools get the oracle rate through an **OracleAdapter**. The pool calls the adapter (e.g. `getFXRateIfValid`) with a **reference rate feed ID** (which pair to use, e.g. USDC/USD or EUR/USD). The adapter returns a rate only if it is **valid**. Validity typically includes:

* **Recency** — The feed has been updated within a configured time window (stale data is rejected).
* **Trading mode** — A **BreakerBox** (or similar) can put feeds into a state where "trading" is suspended (e.g. after a large price move or during certain hours). The adapter checks this and may return "invalid" so the pool reverts the swap.
* **FX market hours** (if configured) — For FX pairs, the adapter may only consider the rate valid during certain hours when reference markets are open.

So the **OracleAdapter** is the single interface the pool uses: it combines the current **Chainlink-backed** price feed with **validity** and **breaker** logic. If the adapter says the rate is invalid, the pool does not swap.

***

## Weekend And Holiday Impact

For FX-priced FPMMs, `OracleAdapter.getFXRateIfValid(rateFeedID)` checks not only recency and trading mode, but also whether the FX market is currently considered open.

Under the current `MarketHoursBreaker`, FX is treated as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Dec 25** and **Jan 1**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

### Not Possible While FX Markets Are Closed

* **Quote or swap** on affected FX-priced pools such as **GBPm/USDm** or **EURm/USDm**
* **Rebalance** affected FX-priced pools, because the pool cannot read a valid FX rate
* **App or SDK flows** that depend on a live FX quote for those pools

### Still Possible While FX Markets Are Closed

* **Add liquidity** (`mint`) to an existing pool if you already hold both tokens in the required ratio
* **Remove liquidity** (`burn`) from an existing pool
* Use pools that do **not** rely on FX market-hours gating, such as **USDC/USDm**

So the weekend/holiday restriction is not a generic shutdown of all FPMMs. It specifically affects **FX-priced pool operations that require a live valid FX rate**.

***

## BreakerBox and circuit breakers

The **BreakerBox** (or equivalent in V3) is a contract that monitors price feeds and can **trip** breakers when conditions are abnormal. When a breaker trips, the **trading mode** for that feed can change so that the OracleAdapter returns "invalid" for swaps.

* **Circuit breaker** — A rule that, when triggered, can **halt trading** for affected pools. In V3, this is typically integrated into the OracleAdapter: the pool asks "give me the rate if valid," and the adapter only returns a rate if breakers allow trading. Circuit breakers are **binary**: trading is either allowed or halted for that feed; they do not throttle.
* **Trading mode** — A state (e.g. "trading allowed" vs "trading suspended") that the BreakerBox sets per feed. The OracleAdapter reads this before returning a rate.
* **Trip conditions** — The BreakerBox can trip when, for example: the price moves too much vs a reference or exponential moving average (**MedianDeltaBreaker** for volatile pairs, **ValueDeltaBreaker** for stable pairs); the oracle is stale; or a deviation threshold is violated.
* **Cooldown** — After a breaker trips, a **cooldown** period (and normalization of conditions) must pass before the breaker can be reset and trading allowed again.

Different breaker types exist; governance configures thresholds and cooldowns. **If the oracle is invalid or breakers have halted trading, your swap will revert.**

***

## Current price source

Mento V3 currently uses **Chainlink as its only oracle source**.

* **Chainlink** — The economic price source for Mento V3 pools today. The adapter uses a Chainlink-backed rate path and enforces recency, trading-mode, and FX-market-hours checks before a pool can trade on that rate.
* **OracleAdapter validity layer** — The adapter does more than return a price: it also checks whether trading should be allowed right now. So the production oracle path is not just "read Chainlink," but "read the Chainlink-backed rate and apply Mento validity rules."

**Rate feed ID** — Each pool is configured with a **reference rate feed ID** (an identifier for the pair, e.g. USDC/USD). That ID is used when the pool asks the OracleAdapter for the rate. Governance or deployment config sets which feed each pool uses and whether to **invert** the rate.

***

## Summary

| Component           | Role                                                                                                                             |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Oracle**          | External source of price data; in Mento V3 today this is Chainlink, and the pool uses that rate as the swap rate (minus fee).    |
| **OracleAdapter**   | Contract the pool calls to get the rate; returns a rate only if **valid** (recent, trading allowed, breakers not tripped, etc.). |
| **BreakerBox**      | Monitors feeds and can set **trading mode** so the adapter refuses to return a rate (swaps revert).                              |
| **Circuit breaker** | Rule that, when triggered (e.g. price move too large), halts trading for that feed until cooldown and normalization.             |
| **Rate feed ID**    | Identifier for the pair (e.g. USDC/USD); configured per pool.                                                                    |

***

## Next steps

* [Trading limits](https://docs.mento.org/mento-v3/dive-deeper/fpmm/trading-limits) — Caps on net flow per token over time windows.
* [Fixed-Price Market Makers (FPMMs)](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — How the pool uses the oracle rate for swaps.


# TradingLimitsV2

Mento V3 protects pools with **TradingLimitsV2**: caps on how much can flow **per token** over fixed time windows. Even if the oracle is wrong or stale, an attacker cannot drain the pool without bound in one go. TradingLimitsV2 works alongside **circuit breakers** (which can halt trading entirely when conditions are abnormal); see [Oracles, price feeds & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers). (TradingLimits v1 applied to Mento V2; V3 uses TradingLimitsV2.)

***

## How TradingLimitsV2 works

**TradingLimitsV2** restricts how much **net flow** (in minus out) of each token can occur over specific **time windows**. In Mento V3, the **TradingLimitsV2** library is used:

* **Windows** — Typically two windows per token: a **short window** (e.g. 5 minutes) and a **long window** (e.g. 1 day). Each pool can configure limits for token0 and token1 separately.
* **Net flow** — The limit applies to **net** flow (inflow minus outflow) of that token over the window. So if the limit is 1M units per 5 minutes, you cannot have more than 1M units **net** flow in (or out) in any rolling 5-minute period. Inflow is often counted after deducting fees so that fee revenue does not consume the limit.
* **Enforcement** — After each swap, the pool (or a library it uses) updates the net flow for the relevant window(s) and **reverts** the swap if the new net flow would exceed the configured cap.

TradingLimitsV2 is **per-token, per-window** caps. It does not stop trading; it stops **unbounded** one-sided flow. Normal trading stays under the caps; only extreme or sustained one-sided flow hits them.

***

## Summary

| Term                | Meaning                                                                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **TradingLimitsV2** | The Mento V3 mechanism that enforces per-token, per-window limits on pool swaps (5-min and 1-day windows). Replaces TradingLimits v1 used in Mento V2. |
| **Limit / cap**     | A cap on **net flow** of a token over a **time window** (e.g. 5 min, 1 day). A swap that would exceed the cap reverts.                                 |

***

## Next steps

* [Oracles, price feeds & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers) — How the pool gets the rate and when trading is halted by breakers.
* [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — Value protection and how swaps use the oracle rate.


# Rebalancing & strategies

This page explains how **rebalancing** works in Mento V3 and what **liquidity strategies** are. It builds on [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm).

***

## Why rebalancing is needed

In an FPMM, every **swap** executes at the **oracle rate** (minus fee). The pool’s **reserves** (the two tokens it holds) change with each trade, but the pool **value at the oracle** (V) stays the same (minus fees). So if many users sell token A for token B, the pool ends up with **more A and less B**. The pool’s **reserve-implied price** (the ratio of reserves, in some numéraire) then **drifts** from the **oracle** price. If that drift gets too large, the pool is **out of balance**: it has too much of one asset and too little of the other, which can make it hard to serve further one-sided demand and can increase risk if the oracle is wrong or stale.

**Rebalancing** is the process of moving reserves back toward a target (in V3, toward a **threshold boundary**) by having a trusted contract take the surplus token from the pool and return the other token at the oracle rate.

***

## When is a pool eligible for rebalancing?

The pool compares its **reserve-implied price** to the **oracle** price. There are two **thresholds** (configured per pool):

* **Threshold above** — When the reserve price is **above** the oracle by at least this amount, the pool is eligible for a rebalance that brings the reserve price down (e.g. take token B out, return token A).
* **Threshold below** — When the reserve price is **below** the oracle by at least this amount, the pool is eligible for a rebalance that brings the reserve price up.

So rebalancing is only allowed when the **deviation** exceeds the relevant threshold. That avoids tiny, frequent rebalances and limits incentive gaming.

***

## Who can rebalance? (Allowlisted strategies)

The pool’s **rebalance** function can only be called by **allowlisted liquidity strategies**. A **liquidity strategy** is a separate smart contract that:

1. Is registered (allowlisted) on the pool by governance or pool admin.
2. Implements a **callback** that the pool invokes during rebalance: the pool sends one token to the strategy and calls back; the strategy must return the other token (at the oracle rate, minus an allowed incentive).

So the pool does **not** rebalance by itself. A **strategy contract** must call `rebalance(...)` on the pool; the pool then transfers one token to the strategy and calls the strategy’s callback; the strategy sources the other token (from a **Reserve**, a **CDP** stability pool, the **caller** in the case of OpenLiquidityStrategy, or another source) and returns it to the pool.

***

## Who can trigger a rebalance? (Permissionless keepers)

Although only a **strategy** can call the pool’s rebalance function, **anyone** can call the **strategy’s** public method (e.g. `rebalance(pool)`). So:

* **Keepers** (bots or users) can call the strategy’s `rebalance(pool)` permissionlessly when a pool is eligible.
* The strategy typically enforces a **cooldown** so that the same pool is not rebalanced too often.
* The strategy may pay part of the **rebalance incentive** to the caller or to the liquidity source; the **pool** only enforces a **minimum repayment** so that the pool never gives away more than the allowed incentive.

So rebalancing is **strategy-mediated** and **keeper-triggered**: the pool trusts only allowlisted strategies, but anyone can ask the strategy to run.

***

## Target: threshold boundary, not 50/50

In V3, when a rebalance runs, the strategy moves the pool toward a **boundary** defined by the threshold (e.g. the reserve-implied price at the edge of the “allowed” band), **not** to exact 50/50 by value. So:

* The **rebalance size** is limited: the pool does not jump from very imbalanced to perfectly balanced in one step. That caps how much value moves in one rebalance and reduces attack surface (e.g. someone triggering a huge rebalance with a small trade).
* The pool’s **acceptance checks** (in the contract) ensure: deviation improves, direction is preserved (e.g. “above oracle” stays above), the pool does not overshoot past the band, and the minimum repayment (incentive cap) is satisfied.

***

## Value and incentive cap

The pool does **not** require that rebalancing is perfectly “value-invariant” (V unchanged). It allows the strategy to keep a **rebalance incentive** (a fraction of the value moved), but it enforces a **minimum amount** that must be returned to the pool. So the **maximum value loss** to the pool in a rebalance is **capped** by the configured incentive. That way LPs are protected from unbounded value extraction while strategies (and keepers) can still earn a bounded reward.

***

## Types of liquidity strategies (V3)

Different pools use different **sources** of liquidity when rebalancing:

* **Reserve strategy** — Used for **fully backed** Mento stablecoins (e.g. USDm, EURm). The protocol **Reserve** holds collateral; the strategy can **mint** new stablecoins or **burn** stablecoins and release collateral to supply or absorb the token that the pool needs. So when the pool has too much USDC and too little USDm, the strategy might burn USDm and use the Reserve to provide USDC (conceptually); the exact flows depend on which token is “debt” and which is “collateral” in the strategy’s configuration.
* **CDP strategy** — Used for **synthetic** Mento stablecoins (e.g. GBPm) that are created by **collateralized debt positions (CDPs)**. The strategy interacts with the **stability pool** and borrowing/repayment: it can borrow or repay the stablecoin, or use the stability pool’s liquidity, to return the required token to the pool during rebalance.
* **Open strategy** — **OpenLiquidityStrategy** uses the **caller** of `rebalance(pool)` as the liquidity source: the caller must hold and approve the required token; the strategy pulls it via ERC20 `transferFrom` and returns the other token to the pool. No reserve or CDP. Used where there is no Reserve or CDP deployment (e.g. GBPm/USDm on Monad). See [Liquidity strategies](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies#openliquiditystrategy) and [mento-core#711](https://github.com/mento-protocol/mento-core/pull/711).
* **Third-party strategy** — For pools that pair with externally issued assets, the issuer (or another party) can deploy a custom strategy contract that is allowlisted on the pool. That strategy implements the same callback interface and sources the other token from its own liquidity or external venues.

***

## Summary

| Concept                    | Meaning                                                                                                                                       |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Rebalancing**            | Moving pool reserves back toward a target (threshold boundary) by sending one token to a strategy and receiving the other at the oracle rate. |
| **Eligibility**            | Pool is rebalanceable when reserve price deviates from oracle by at least the configured threshold (above or below).                          |
| **Allowlisted strategy**   | Only contracts registered on the pool can call the pool’s rebalance function.                                                                 |
| **Permissionless trigger** | Anyone can call the strategy’s `rebalance(pool)`; the strategy enforces cooldown and then calls the pool.                                     |
| **Target**                 | Threshold boundary (band), not exact 50/50.                                                                                                   |
| **Incentive**              | Strategy may keep a capped share of the rebalance; pool enforces minimum repayment.                                                           |

***

## Next steps

* [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — Invariant, pool mechanics.
* [The Reserve](https://docs.mento.org/mento-v3/dive-deeper/the-reserve) — How the Reserve backs stables and supports the Reserve strategy.
* [Swap & liquidity](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md) — How to swap and add/remove liquidity; triggering rebalances as a keeper.


# CDPs

On Mento V3, **CDP-backed stablecoins are FX stables**: they are created when users **borrow** against collateral. Mento’s CDP system uses **USDm as the collateral asset**: you lock USDm and **borrow** FX-pegged stables such as **GBPm**. This is a **stable-on-stable** setup rather than crypto collateral.

***

## What you can do

* **Borrow** — Deposit collateral (USDm) and borrow the stablecoin (e.g. GBPm). You open a **trove**, set your interest rate, and can run multiple troves per address.
* **Repay** — Return the borrowed stable to reduce or close your debt and free collateral.
* **Stability pool** — Deposit the debt token (e.g. GBPm) into a stability pool used in liquidations; you may earn rewards.

Troves can be **adjusted** (add/withdraw collateral, borrow more, repay) and **closed**. The system uses a **Stability Pool** and **liquidations** when troves become undercollateralized.

Because all Mento CDPs are **FX CDPs**, they also inherit **FX market-hours restrictions** from `FXPriceFeed -> OracleAdapter -> MarketHoursBreaker`.

***

## How to do it

**Via the Mento app:** Use the [**Mento app**](https://app.mento.org/borrow?chain=42220) for borrow, repay, and stability pool flows. Connect your wallet (e.g. on Celo), select the CDP product (e.g. GBPm), deposit USDm as collateral, and borrow the stable.

**Via the SDK:** For programmatic or integrator use, the [**Mento SDK**](https://docs.mento.org/mento-v3/build/mento-sdk) provides `mento.borrow`: open/adjust/close troves, read trove data and system params, and predict upfront fees. See [Borrow (CDP)](https://docs.mento.org/mento-v3/build/mento-sdk/guides/borrow). The SDK identifies each CDP system by the **debt token** (the stable you borrow, e.g. GBPm).

***

## Mento CDPs and Liquity v2

**Mento CDPs are a fork of** [**Liquity v2**](https://www.liquity.org/)**.** The CDP contracts live in a **separate repository**: [mento-protocol/bold](https://github.com/mento-protocol/bold). The core mechanics (troves, user-set interest rates, liquidations, Stability Pool, redemptions) follow the Liquity v2 design. Liquity v2 uses ETH/LSTs as collateral and BOLD as the debt token; Mento’s fork uses **USDm as collateral** and **FX-pegged stables (e.g. GBPm) as the debt token**, with **one independent instance per FX currency** (each with its own TroveManager, StabilityPool, and FX price feed).

For full protocol and contract documentation (state variables, liquidation thresholds, fee flows, redemption mechanics), use the **Liquity v2** documentation:

* [**Liquity v2 documentation**](https://docs.liquity.org/) — protocol overview, technical resources, and contract behavior.
* [**Liquity v2 whitepaper**](https://www.liquity.org/blog/liquity-v2-whitepaper) — design and economics.

For **Mento-specific** implementation (USDm collateral, FX oracles, multi-instance architecture, and FXPriceFeed), see the [**mento-protocol/bold README**](https://github.com/mento-protocol/bold).

***

## Weekend And Holiday Impact

Mento CDPs use `FXPriceFeed`, which reads the branch FX rate through `OracleAdapter.getFXRateIfValid(rateFeedID)`. As a result, normal price-dependent CDP actions are only available when the FX market is considered open.

Under the current `MarketHoursBreaker`, FX is treated as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Dec 25** and **Jan 1**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

### Not Possible While FX Markets Are Closed

* **Open a trove**
* **Adjust a trove**: add collateral, withdraw collateral, borrow more, repay, or make a combined adjustment
* **Close a trove**
* **Normal liquidations**
* **Normal redemptions**
* **Some advanced rate-management actions** if they require a fresh price for upfront-fee or collateral-ratio checks

### Still Possible While FX Markets Are Closed

* **Deposit to the Stability Pool**
* **Withdraw from the Stability Pool**
* **Claim existing Stability Pool collateral gains**

So the Stability Pool itself is **not shut down on weekends**. The important limitation is indirect: if liquidations are blocked, the Stability Pool will generally **not receive new liquidation-driven gains** until the FX market reopens.

### Emergency Shutdown Mode

If a branch has already entered **shutdown**, `FXPriceFeed` returns its `lastValidPrice` instead of reading the live FX oracle path. In that emergency mode, shutdown-specific operations such as **urgent redemption** are governed by shutdown logic rather than the ordinary market-hours gate.

***

## Critical risk considerations

Because Mento CDPs use **USDm as collateral** and **FX-pegged debt** (e.g. GBPm), the risk profile differs from crypto-collateralized systems like Liquity v2:

| Risk                        | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **USDm depeg risk**         | All FX instances use USDm as collateral. A USDm depeg would cause **correlated failure across all CDP instances** — every trove’s collateral would lose value at once.                                                                                                                                                                                                                      |
| **FX exposure**             | Unlike USD-pegged stablecoins, **borrowers and Stability Pool depositors** are exposed to **foreign exchange rate risk**: the debt token (e.g. GBPm) is pegged to GBP, which floats against USD.                                                                                                                                                                                            |
| **Stability Pool FX loss**  | When liquidations occur, SP depositors receive collateral (USDm) in exchange for burned debt (e.g. GBPm). Because of FX rate dynamics, **SP depositors may incur losses on liquidations** — the USD value of collateral received can be less than the USD value of the debt absorbed. See the [mento-protocol/bold README (Economics)](https://github.com/mento-protocol/bold) for details. |
| **Double liquidation risk** | Troves can become undercollateralized from **two directions**: (1) **FX rate movements** (e.g. GBP appreciates vs USD, so debt value in USD rises), and (2) **USDm depeg** (collateral value in USD falls). Both can trigger liquidations.                                                                                                                                                  |

Borrowers and SP depositors should understand these risks before opening troves or depositing to the Stability Pool. For full Mento-specific risk and economics analysis, see the [**mento-protocol/bold README**](https://github.com/mento-protocol/bold).

***

## Relation to FPMM liquidity

Mento uses **CDPLiquidityStrategy** to rebalance FPMM pools that hold the CDP-backed stable (e.g. GBPm). On **expansion**, the strategy draws debt from the Stability Pool; on **contraction**, it sources collateral (USDm) via redemptions. See [Rebalancing & strategies](https://docs.mento.org/mento-v3/dive-deeper/fpmm/rebalancing-and-strategies) and [Liquidity strategies](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies) in Smart Contracts.

***

**See also:** [Getting Mento stables](https://docs.mento.org/mento-v3/other/getting-mento-stables) · [Overview](https://docs.mento.org/mento-v3) · [CDP smart contracts](https://docs.mento.org/mento-v3/build/smart-contracts/cdps) (Build) · [Troubleshooting](https://docs.mento.org/mento-v3/build/troubleshooting)


# The Reserve

In Mento V3, **most Mento stablecoins are CDP-backed** (using Liquity v2–style CDPs). This page focuses on the **Reserve-backed** assets documented in these V3 docs: **USDm** and **EURm**. It explains why that split exists and how the Reserve works for those two stables.

***

## Two backing models in V3

| Backing model      | Stablecoins         | How it works                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Reserve-backed** | **USDm**, **EURm**  | The Reserve holds high-quality fiat-backed collateral (e.g. USDC, USDT, USDS for USDm; EUROC for EURm). These stables can be backed **1:1** by such assets because they have liquid, high-quality counterparts that can be integrated onchain.                                                                                                                                         |
| **CDP-backed**     | **GBPm** and others | No equivalent high-quality fiat-backed GBP (or other currency) stablecoin is integrated at scale yet. So these stables are minted via **Liquity v2–style CDPs**: users deposit **USDm** as collateral and borrow the synthetic stable (e.g. GBPm). When high-quality fiat-backed counterparts become available, governance can consider moving to Reserve-backed backing for them too. |

So, in the backing model documented here, the Reserve backs **USDm** and **EURm**. Other Mento stables are treated as **synthetic** and backed by CDPs (with USDm as collateral in the current design), until the ecosystem has suitable fiat-backed collateral to integrate.

***

## Why USDm and EURm are the documented Reserve-backed assets

USDm and EURm have **high-quality, fiat-backed counterparts** that are already integrated and liquid on the chains where Mento deploys:

* **USD**: USDC, USDT, USDS, and (on some chains) others trade at or near USD parity and are widely used. The Reserve can hold these and back USDm **1:1**.
* **EUR**: EUROC (and e.g. axlEUROC on Celo) provides a regulated euro-backed stablecoin. The Reserve can hold it and back EURm **1:1**.

For **GBP** (and some other currencies), there is currently **no integrated, high-quality fiat-backed stablecoin** at the same level of adoption and trust. So 1:1 Reserve backing with a single GBP collateral type is not feasible yet. CDPs allow those stables to exist anyway: users lock **USDm** (which is itself Reserve-backed) and mint e.g. GBPm. Once high-quality fiat-backed GBP (or other currency) counterparts are available and can be integrated, the protocol can consider Reserve-backed backing for those stables too.

***

## What the Reserve does (USDm and EURm)

For **USDm** and **EURm**, the Reserve:

* **Holds collateral** — Holds the fiat-backed assets (USDC, USDT, USDS for USDm; EUROC etc. for EURm) that back the circulating supply.
* **Enables rebalancing** — The **Reserve liquidity strategy** is allowlisted on the FPMM pools that pair USDm or EURm with those external stables. When a pool becomes imbalanced, the strategy can mint or burn the Mento stable and move collateral so the pool rebalances at the oracle rate (within configured incentives and caps).
* **Operates transparently** — Holdings and operations are onchain and verifiable.

The Reserve does **not** hold collateral for CDP-backed stables like GBPm; those are backed by user-deposited USDm in the Liquity v2 system.

***

## Reserve dashboard: [reserve.mento.org](https://reserve.mento.org/)

The **Reserve dashboard** at [reserve.mento.org](https://reserve.mento.org/) is the public view of the Mento Reserve. It shows:

* **Total stablecoin supply** — Combined supply of all Mento stables (USDm, EURm, GBPm, and others).
* **Reserve holdings** — The total value of collateral held in the Reserve (the diversified portfolio backing USDm and EURm).
* **Collateralization ratio** — Reserve holdings divided by the supply of Reserve-backed stables; a ratio above 1 indicates over-collateralization.
* **Supply by stablecoin** — Circulating supply per Mento stable (USDm, EURm, GBPm, etc.).

Use it to check Reserve health, verify backing, and see how supply and collateral evolve over time.

***

## Governance and risk

Reserve composition, which assets are accepted as collateral, and the parameters for the Reserve liquidity strategy are set by **governance** (MENTO token holders). Over-collateralization and risk management apply to the Reserve's backing of USDm and EURm; the goal is to keep those stables robustly backed while allowing efficient rebalancing and earning protocol revenue via yield income.

***

## Next steps

* [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — How pools use the oracle rate and rebalance.
* [Rebalancing & strategies](https://docs.mento.org/mento-v3/dive-deeper/fpmm/rebalancing-and-strategies) — Reserve liquidity strategy and other allowlisted strategies.
* [Protocol Economics](https://docs.mento.org/mento-v3/dive-deeper/protocol-economics) — Value flows, fees, incentives, and reserve management.


# Protocol Economics

Value flows, fees, incentives, and revenue in Mento V3. For the design rationale (why oracle pricing, no LVR), see [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm).

***

## Where value goes

Every swap pays a **fee** (split between **LP fee** and **protocol fee**). LPs earn from swap volume; the protocol earns a share of fees. When the pool's inventory drifts (e.g. too much of one token), only **allowlisted liquidity strategies** can **rebalance**: the pool sends one token to the strategy and receives the other at the oracle rate. The strategy may keep a **capped rebalance incentive** (the pool enforces a **minimum repayment**), so value loss to the pool is bounded and keepers/strategies can earn for providing rebalancing.

**Backing and rebalancing sources.** **USDm** and **EURm** are **Reserve-backed**: the protocol **Reserve** holds fiat-backed collateral (USDC, USDT, EUROC, etc.) and a **Reserve liquidity strategy** rebalances the relevant FPMM pools by minting/burning stables and moving collateral. **GBPm** and other synthetic stables are **CDP-backed** (Liquity v2–style): users deposit USDm as collateral and borrow the synthetic stable; a **CDP liquidity strategy** rebalances using the stability pool and borrowing/repayment. Governance sets Reserve composition, strategy parameters, and which strategies are allowlisted on each pool.

**Safety and governance.** TradingLimitsV2 (per-token net flow caps) and an **on-chain circuit breaker** (e.g. halt when the oracle is invalid or stale) protect pools when the oracle is wrong or manipulated. **Governance**—driven by **MENTO** token holders—controls protocol parameters (fees, rebalance incentives, TradingLimitsV2, circuit breaker thresholds), oracle and feed configuration, pool allowlists, and Reserve policy. See [Understanding Mento Governance](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/understanding-mento-governance) and [MENTO Tokenomics](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/mento-tokenomics).

**MENTO token.** MENTO is the protocol's **governance and value-accrual token**. Holders vote on parameter changes, oracle config, and treasury use. Locking MENTO as **veMENTO** (vote-escrowed) increases voting power (longer lock = more weight). Governance can direct **protocol revenue** (trading fees, reserve yield, CDP interest, rebalancing-related fees) toward uses such as **MENTO buybacks**, treasury growth, and liquidity programs. In the current design, value is expected to flow to MENTO holders **indirectly** through **protocol-driven MENTO token buybacks**, not through direct revenue sharing with veMENTO holders. See [MENTO Tokenomics](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/mento-tokenomics) and [veMENTO & Voting Power](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/participating-in-governance/vemento-and-voting-power).

***

## Incentive structure (V3)

Unless noted otherwise, the figures below are **examples of the mechanism**. For **current deployed values**, see [Parameters](https://docs.mento.org/mento-v3/build/deployments/parameters).

Incentives align five groups: **CDP borrowers**, **Stability Pool (SP) depositors**, **FPMM LPs**, **keepers/facilitators**, and **MENTO token holders**.

| Actor              | Role and incentives                                                                                                                                                                                                              |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CDP borrowers**  | Pay ongoing interest; can take a short position by selling the stable or earn by providing liquidity in the SP or FPMM.                                                                                                          |
| **Stability Pool** | Holds deposited stables to backstop liquidations; earns a **governable share** of borrower interest (`SP_YIELD_SPLIT`) plus **liquidation gains**. In the currently documented **GBPm/Celo** deployment, `SP_YIELD_SPLIT = 75%`. |
| **FPMM LPs**       | Earn trading fees at the oracle price; may receive MENTO emissions (governable). On CDP-backed pools they also fund the pool's capped rebalancing incentives.                                                                    |
| **Keepers**        | Earn bounties for triggering rebalances (e.g. block expansions, redemptions).                                                                                                                                                    |
| **MENTO holders**  | Govern parameters (fees, `sp_yield_split`, rebalance incentives, emissions) and treasury use (e.g. buy-backs, LP/SP incentives).                                                                                                 |

***

## Revenue overview (CDP-backed pools)

The table below uses the currently documented **GBPm on Celo** deployment as the concrete reference point where the docs provide one. Values may differ by pool and chain.

| Source                                  | Share / parameter                                                 | Recipient                                                 |
| --------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------- |
| Borrower interest                       | `SP_YIELD_SPLIT = 75%`                                            | Stability Pool depositors                                 |
| Borrower interest                       | `25%` treasury share                                              | Mento Protocol Treasury                                   |
| Liquidations                            | `LIQUIDATION_PENALTY_SP = 5%`                                     | Stability Pool depositors                                 |
| Redemption fees                         | `REDEMPTION_FEE_FLOOR = 0.5%`                                     | Redeemed CDPs                                             |
| FPMM trading fees                       | LP fee + optional protocol fee                                    | FPMM LPs; protocol                                        |
| CDP strategy liquidity-source incentive | `0.05%` on expansion; `0.05%` on contraction; protocol split `0%` | Liquidity source used by the strategy                     |
| MENTO emissions                         | Governable                                                        | LPs, keepers, partners (bootstrapping; expected to taper) |

Reserve-backed pools (USDm, EURm) do not have CDP interest or SP; rebalancing is via the Reserve strategy with a capped rebalance incentive.

***

## Risks

For protocol risks—oracle manipulation, reserve and inventory risk, smart contract and blockchain risk—see [Risk overview](https://docs.mento.org/mento-v3/dive-deeper/security/risk-overview).

***

## Next steps

* [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — Design rationale, invariant, operations.
* [Governance & MENTO](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento) — How the protocol is governed.
* [Security](https://docs.mento.org/mento-v3/dive-deeper/security) — Risk overview and audit reports.


# Governance & MENTO

Mento is community-governed through the MENTO token. Learn how governance works, explore tokenomics, distribution, discover how to participate in decisions, and understand safety mechanisms in place.

Mento V3 is **community-governed** through the **MENTO** token. Governance controls protocol parameters (fees, rebalance incentives, TradingLimitsV2, circuit breaker thresholds), oracle and feed configuration, pool allowlists, and Reserve policy. **veMENTO** (vote-escrowed MENTO) gives increased voting power for longer lock-ups. Protocol revenue is intended to flow to MENTO holders **indirectly** through governance-directed **MENTO token buybacks**, not through direct veMENTO revenue sharing.

**What is governed:** Protocol parameters (fee structures, risk parameters, pool configuration), oracle management (provider selection, feed configuration), and technical upgrades (contract updates, security patches, integration approvals). All decisions execute on-chain with timelocks and optional watchdog veto during the transition period.

**Next:** [Understanding Mento Governance](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/understanding-mento-governance) — how voting and proposals work. [MENTO Tokenomics](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/mento-tokenomics) — supply, distribution, and value accrual.


# Understanding Mento Governance

Mento governance empowers MENTO token holders to collectively shape the protocol's future. Through on-chain voting and community participation, governance ensures the protocol evolves to meet user needs while maintaining security and stability.

## Overview

Mento operates as a fully decentralized protocol governed by its community. Unlike traditional financial systems where central authorities make decisions, Mento distributes decision-making power among MENTO token holders who have a direct stake in the protocol's success.

The governance system builds on proven DeFi governance models while introducing unique features tailored to Mento's needs:

* **On-chain execution**: All governance decisions execute automatically through smart contracts
* **Transparent process**: Proposals, discussions, and votes are public and verifiable
* **Time-locked implementation**: Changes include delay periods for security review
* **Emergency safeguards**: Watchdog mechanisms protect against malicious proposals

This decentralized approach ensures no single entity controls the protocol, creating a resilient system that serves its users' collective interests.

## **Core Governance Principles**

Mento governance operates on several foundational principles:

**Community Ownership**: The protocol belongs to its users and stakeholders. Major decisions require community consensus through formal voting processes.

**Progressive Decentralization**: While fully decentralized at the protocol level, governance started with training wheels (like the watchdog multisig) that can be removed as the system matures.

**Informed Decision-Making**: Proposals include detailed specifications, risk assessments, and implementation plans to enable educated voting.

**Aligned Incentives**: The veMENTO (vote-escrowed MENTO) model rewards long-term thinking by giving more voting power to tokens locked for longer periods.

## **What Is Being Governed**

Mento governance controls all aspects of the protocol's operation and evolution:

#### **Protocol Parameters**

* **Fee structures**: Trading fees, rebalancing incentives, and in the future, protocol revenue distribution
* **Risk parameters**: Trading limits and circuit breaker thresholds
* **Pool configuration**: Adding new trading pairs, adjusting pool parameters

#### **Oracle Management**

* **Provider selection**: Approving and removing oracle data providers
* **Feed configuration**: Setting rate feed IDs and update thresholds
* **Quality standards**: Defining accuracy requirements and deviation limits

#### **Technical Upgrades**

* **Smart contract updates**: Implementing new features and optimizations
* **Security patches**: Addressing vulnerabilities through coordinated upgrades
* **Integration approvals**: Connecting with new chains, bridges, or protocols

#### **Economic Policy**

* **Emission target**: Managing MENTO token distribution
* **Liquidity programs**: Incentivizing pool participation and ecosystem growth

#### **Governance Evolution**

* **Process improvements**: Refining proposal and voting mechanisms
* **Parameter adjustments**: Modifying quorum requirements or voting periods
* **Delegation features**: Enabling more flexible participation models

## Governance Process

The typical governance flow follows these stages:

1. **Community Discussion**: Ideas emerge and refine through forum discussions
2. **Formal Proposal**: Detailed specifications submitted on-chain
3. **Voting Period**: Token holders cast votes over several days
4. **Timelock Delay**: Approved proposals wait before execution for security review
5. **Implementation**: Execution of approved changes can be triggered by anyone via the interface

Each stage includes safeguards and requirements to ensure high-quality decisions while maintaining efficiency.

## **Participation Levels**

Governance accommodates different levels of involvement:

**Passive Participants**: Can delegate voting power to active community members they trust.

**Active Voters**: Review proposals and vote directly on changes they care about.

**Proposal Authors**: Draft and submit governance proposals for community consideration.

**Core Contributors**: Provide technical analysis and implementation support for complex changes.

**Watchdog Members:** Serve as the final security layer, with veto power over proposals that are malicious or incorrectly implemented.

All participants benefit from the protocol's success, creating natural alignment between individual and collective interests.

## **Evolution and Maturity**

Mento governance is designed to evolve. Initial safeguards like the watchdog multisig provide security during early stages but can be removed or modified as the system demonstrates stability. This progressive decentralization ensures both immediate safety and long-term autonomy.

The governance system itself is governed, the community can vote to improve processes, adjust parameters, or implement new features that enhance participation and decision quality.


# Participating in Governance

## Introduction

Mento governance puts the protocol's future in the hands of its community. Through on-chain voting, MENTO token holders directly influence protocol parameters, treasury allocations, and strategic direction.

The governance process is designed to be transparent, secure, and accessible. By locking MENTO tokens to receive veMENTO (vote-escrowed MENTO), participants gain voting power proportional to their commitment to the protocol's long-term success.

## How Governance Works

Mento uses a decentralized governance model where:

* **veMENTO** holders vote on all protocol changes and propose new ones.
* **Proposals** follow a structured lifecycle from forum discussion to on-chain execution
* **Watchdogs** provide security oversight with veto power
* **Time delays** ensure transparency and allow for community review

Whether you want to vote on existing proposals or create your own, the governance system provides clear pathways for participation at every level.

## Getting Started

Your governance journey typically follows these steps:

1. **Acquire voting power** by locking MENTO for veMENTO
2. **Participate in discussions** on the governance forum
3. **Vote on proposals** that shape the protocol
4. **Create proposals** to implement your ideas

Each aspect of governance has its own guide to help you participate effectively.

## Governance Guides

### [veMENTO & Voting Power](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/participating-in-governance/vemento-and-voting-power)

Learn how to lock your MENTO tokens, understand voting power calculations and manage your position.

### [Creating Proposals](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/participating-in-governance/creating-proposals)

Step-by-step guide to crafting proposals, from initial forum discussions through technical specifications and on-chain submission.

### [Voting Process](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/participating-in-governance/voting-process)

Understand how to evaluate proposals, cast your vote, track results, and monitor the execution of passed proposals.

## Key Resources

* **Governance Interface**: [governance.mento.org](https://governance.mento.org/)
* **Forum Discussions**: [forum.mento.org](https://forum.mento.org/)

## Why Participate?

Active governance participation:

* **Shapes the protocol** according to community needs
* **Protects value** through careful parameter management
* **Drives innovation** by funding new developments
* **Builds community** through collaborative decision-making
* **Directs revenue** by deciding how protocol flows are distributed ($MENTO buybacks, liquidity incentives)

Your voice matters in Mento governance. Every vote contributes to the protocol's decentralized decision-making process.


# veMENTO & Voting Power

## Understanding veMENTO

veMENTO (vote-escrowed MENTO) is the cornerstone of Mento governance. When you lock MENTO tokens, you receive veMENTO, which represents your voting power in the protocol. This system ensures that governance participants are aligned with Mento's long-term success.

### How veMENTO Works

The veMENTO model rewards longer commitments with greater voting power:

* **Initial Balance**: veMENTO proportional to lock duration (maximum 1:1 ratio for 2-year locks)
* **Weekly Decay**: Your veMENTO decreases by a fixed amount each week until reaching zero
* **Non-transferable**: veMENTO is bound to your address
* **Underlying MENTO:** Unlocks gradually each week and can be withdrawn as it becomes available

The weekly decay rate = initial veMENTO ÷ lock period in weeks

**Example Scenarios**:

* **1-year lock (52 weeks)**: 1,000 MENTO → 500 veMENTO initially
  * Decays by \~9.62 veMENTO per week
  * After 6 months: \~250 veMENTO
  * After 1 year: 0 veMENTO
* **2-year lock (104 weeks)**: 1,000 MENTO → 1,000 veMENTO initially
  * Decays by \~9.62 veMENTO per week
  * After 6 months: \~750 veMENTO
  * After 1 year: \~500 veMENTO
  * After 2 years: 0 veMENTO

## Creating Your veMENTO Position

### Prerequisites

Before locking:

* Hold MENTO tokens in your wallet
* Have sufficient CELO for gas fees
* Understand the lock commitment: MENTO unlocks gradually over your chosen period and cannot be withdrawn faster than this schedule

#### Step 1: Access the Voting Power Interface

Navigate to [governance.mento.org/voting-power](https://governance.mento.org/voting-power) and connect your wallet.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FjsYvcmCuhTDf3NPNSjvg%2Fimage.png?alt=media&amp;token=80aaef03-533d-4ac1-b65c-0c4e57a2f27c" alt=""><figcaption></figcaption></figure>

The interface displays:

* Your current MENTO balance
* Existing veMENTO position (if any)
* Lock creation interface

#### Step 2: Choose Your Lock Parameters

**Select Lock Amount**

* Enter the amount of MENTO to lock
* Minimum lock amount: 1 MENTO (1e18 wei)
* The interface shows your maximum available MENTO balance

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F61n1si5BaIf0gm2BVUkf%2Fimage.png?alt=media&amp;token=37329789-8e18-48a0-84e5-e70b132cfafa" alt=""><figcaption></figcaption></figure>

**Select Lock Duration**

* Choose how long you want to lock your MENTO (up to \~2 years)
* Longer lock periods = slower veMENTO decay = more sustained voting power

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FK5SKKaLUbasIjn0cAwx3%2Fimage.png?alt=media&amp;token=c908d448-ce59-480d-8561-a928a90f638e" alt=""><figcaption></figcaption></figure>

#### Step 3: Review and Execute Transaction

Before confirming, review:

* **Lock Amount**: Verify the MENTO amount
* **Initial veMENTO**: Your starting voting power (proportional to lock duration)
* **Lock Until Date**: When your locked MENTO becomes fully withdrawable

Now:

1. Click "Create Lock"
2. Approve MENTO spending
3. Confirm lock transaction
4. Wait for transaction confirmation

You will be prompted to confirm the transaction in your wallet

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FCebRkJC8TeBF7kACcG5t%2Fimage.png?alt=media&amp;token=2c262132-6c53-47d6-a7b0-5e2b5474abd5" alt=""><figcaption></figcaption></figure>

Your veMENTO balance appears immediately after the transaction confirms.

## Managing Your Position

### Viewing Your Position

The voting power page displays:

* **Current veMENTO Balance**: Your active voting power
* **Locked MENTO:** The amount of MENTO that is locked and not withdrawable
* **Withdrawable MENTO:** The amount of MENTO that has unlocked and is withdrawable
* **Expires:** When the lock expires, all your MENTO will be withdrawable

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F1x5TubfLfhvhpfUq0HRf%2Fimage.png?alt=media&amp;token=d39e7114-329e-405f-8425-8bf3edceb1df" alt=""><figcaption></figcaption></figure>

### Modifying Your Lock

Once you have an active lock, you can strengthen your governance position via three options:

#### Top Up Your Lock

Add more MENTO to your existing lock without changing the unlock date:

1. Enter the amount of MENTO to add in the "MENTO to lock" field
2. Keep the lock duration slider at its current position
3. Your additional MENTO will adopt the same unlock date as your existing lock
4. Click "Top up lock" and confirm the transaction

This increases your veMENTO proportionally while maintaining your current unlock schedule.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fcu1GoTe1OKYrGq9Wc5dT%2Fimage.png?alt=media&amp;token=e3a0fd45-3a49-408b-8447-3198c76a8914" alt=""><figcaption></figcaption></figure>

#### Extend Your Lock

Extend your unlock date to slow decay and maintain voting power longer:

1. Keep the "MENTO to lock" field at 0
2. Move the lock duration slider to your desired new duration
3. This pushes your unlock date further into the future
4. Click "Extend lock" and confirm the transaction

Extending resets your veMENTO for your locked amount and restarts the decay from the new duration.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F4gjtmDCLSk3ZaEhkFrDi%2Fimage.png?alt=media&amp;token=bca2fc51-a62c-4ced-ba3d-0e72ba22520b" alt=""><figcaption></figcaption></figure>

#### Top Up and Extend

Combine both actions to add more MENTO and extend your lock period:

1. Enter the additional MENTO amount you want to lock
2. Adjust the duration slider to your new desired lock period
3. This both increases your locked MENTO and extends your unlock date
4. Click "Top up and extend lock" and confirm the transaction

This maximizes your voting power by increasing both the amount locked and the time commitment.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F5LaxeJmzWJ313eJclyFh%2Fimage.png?alt=media&amp;token=40dc8ffc-b581-417f-b2f9-46123aff42a3" alt=""><figcaption></figcaption></figure>

**Key Points**:

* All modifications are irreversible - you cannot reduce your locked amount or duration afterwards and will have to wait until your lock expires
* Extensions reset your veMENTO to the full locked amount
* Top-ups add veMENTO based on the remaining lock duration

#### Important Restrictions

You **cannot**:

* ❌ Reduce your lock amount or duration
* ❌ Transfer veMENTO to another address

## Common Questions

<details>

<summary><strong>What happens when my veMENTO reaches zero?</strong></summary>

Your MENTO becomes fully withdrawable. To regain voting power, withdraw and create a new lock, or relock before it reaches zero.

</details>

<details>

<summary><strong>Can I have multiple locks?</strong></summary>

No, each address can only have one active lock. You can add to your existing lock or relock with new parameters.

</details>

<details>

<summary><strong>What's the minimum lock amount?</strong></summary>

1 MENTO (1e18 wei). There's no maximum limit.

</details>

<details>

<summary><strong>Do I earn anything while locked?</strong></summary>

veMENTO holders do not earn direct revenue-sharing rewards. Their role is to control how protocol revenue is allocated, including **protocol-driven MENTO token buybacks** and liquidity incentives. In the current design, protocol revenue is intended to reach MENTO holders **indirectly** through buybacks rather than through direct distributions to veMENTO holders.

</details>

<details>

<summary><strong>Can I transfer my locked position?</strong></summary>

No, locked positions are non-transferable. The lock is permanently bound to your address.

</details>


# Creating Proposals

## Introduction

Creating a proposal is how you turn ideas into action within the Mento Protocol. Whether suggesting parameter adjustments, requesting treasury funding, or proposing technical upgrades, the governance system provides a clear path from concept to implementation. This guide walks you through the entire proposal creation process.

## Prerequisites

### Required veMENTO Balance

To create a proposal, you must meet the minimum voting power threshold:

* **Current threshold**: 10k veMENTO
* Your veMENTO must exceed this amount at proposal submission
* Locked MENTO after submission won't count toward existing proposals

### Forum Discussion

Before creating an on-chain proposal:

1. **Present your idea** in the [Mento Forum](https://forum.mento.org/)
2. **Gather feedback** for at least 3-7 days
3. **Build consensus** through constructive discussion
4. **Refine your proposal** based on community input

### Technical Preparation

For proposals requiring code execution:

* Prepare the exact contract calls needed
* Test execution on testnet when possible
* Validate all addresses and parameters
* Have execution code reviewed by technical community members

## Step-by-Step Guide

### Step 1: Access Proposal Creation

Navigate to [governance.mento.org](https://governance.mento.org/) and click "Create Proposal" in the header or the main proposal list.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fsw6vxijzmEkj3qUb0zvd%2Fimage.png?alt=media&amp;token=39c8cb09-a786-4242-81ff-bbd598f1e0f0" alt=""><figcaption></figcaption></figure>

### Step 2: Enter Proposal Details

The interface guides you through three steps:

Proposal Details → Execution Code → Review

**Title**

* Keep it clear and descriptive
* Maximum impact in minimum words
* Include proposal type, if possible (e.g., "Parameter Update:", "Treasury Request:")

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FBPAOSadapTRRRWhIWohu%2Fimage.png?alt=media&amp;token=35681157-c1b1-4e0b-9ed2-8b468c07934f" alt=""><figcaption></figcaption></figure>

**Description**

* Follow the [proposal template](#structure-template)
* Minimum 100 characters required
* Use the rich text editor for formatting
* Include problem statement, proposed solution, expected impact
* Link to forum discussion

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FBWT7vVIOqU4xwqIjanPS%2Fimage.png?alt=media&amp;token=6b59e241-9664-4b4d-b3fa-9b6c81d56a11" alt=""><figcaption></figcaption></figure>

**Preview Tab**

* Switch between Write/Preview modes
* Verify formatting appears correctly
* Check all links work properly

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FquqyakaLknjKTCQhnaup%2Fimage.png?alt=media&amp;token=8ec920a8-dcf8-4cf3-bc34-c049127a04e7" alt=""><figcaption></figcaption></figure>

### Step 3: Add Execution Code

Click "Next" to proceed to the Execution Code step.

**Does Your Proposal Need Execution Code?**

Not all proposals require execution code:

* **No code needed**: If your proposal is signaling intent, requesting off-chain actions, or doesn't call any contracts, leave this field empty
* **Code required**: If your proposal changes protocol parameters, moves funds, or updates contracts, you'll need to provide execution code

**For Proposals Requiring Execution Code**

**Understanding Execution Requirements**

* Must be valid JSON array
* Must contain at least one transaction object
* Each transaction needs: address, value, data

**Code Structure**:

json

```json
[
  {
    "address": "0x...", // Target contract address*
    "value": 0,         // CELO value (usually 0 unless requesting funds)*
    "data": "0x..."     // Encoded function call*
  }
]
```

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FCBnHA44DecdygwXsjKbf%2Fimage.png?alt=media&amp;token=b18e76da-9323-4330-9fee-6fa941884619" alt=""><figcaption></figcaption></figure>

**Common Actions**:

* **Parameter updates**: Owner only, setter function calls
* **Treasury transfers**: Transfer functions with recipient/amount
* **Contract upgrades**: Proxy upgrade calls
* **Multiple actions**: Array of transaction objects

**Review Checklist**:

* ✓ Title accurately describes the proposal
* ✓ Description includes all necessary context
* ✓ Execution code is properly formatted
* ✓ All addresses are correct
* ✓ Forum discussion linked

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F269t6axaJvTrD0QoeWry%2Fimage.png?alt=media&amp;token=21571f6e-59f4-4657-90d2-209e837e5c4c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FhZ67aQyfJOsun0l0gFUs%2Fimage.png?alt=media&amp;token=c2160abe-dce4-4a5c-989f-fd5fad04d6d4" alt=""><figcaption></figcaption></figure>

**Submit Transaction**:

1. Click "Create Proposal"
2. Confirm details in wallet
3. Wait for transaction confirmation

Your proposal immediately enters the voting period upon successful submission.

## Writing Effective Proposals

### Structure Template

<pre class="language-markdown"><code class="lang-markdown">Title: [Type] Brief Description

# Summary (1-2 sentences)
What this proposal does and why it matters.

<strong># Background 
</strong>Context and problem this addresses.

<strong># Proposal Details 
</strong>Specific changes and implementation plan.

# Expected Impact 
Benefits and potential risks.

# Technical Specification 
Exact parameters, addresses, and values.

# Timeline 
Implementation schedule post-execution.

References

- Forum discussion: [link]
- Related proposals: [links]
- Technical documentation: [links]
</code></pre>

### Best Practices

**Clarity Above All**

* Write for both technical and non-technical audiences
* Define acronyms and technical terms
* Use concrete examples

**Build Support Early**

* Engage key stakeholders before submission
* Address concerns in forum discussion
* Consider co-proposers for complex initiatives

**Be Specific**

* Exact parameter values, not ranges
* Precise implementation details
* Clear success metrics

**Show Your Work**

* Include calculations and reasoning
* Link to supporting data
* Provide simulation results if applicable

## Proposal Lifecycle

After submission, your proposal follows this path:

1. **Active** (8 days) - Voting period
2. **Succeeded/Defeated** - Based on results
3. **Queued** (2 days) - Timelock Veto period where a security council of community members can veto proposals deemed malicious
4. **Executed** - Changes go live, included code is executed onchain

Monitor each stage and be available to answer questions throughout.

## Common Mistakes to Avoid

**Technical Errors**

* ❌ Wrong contract addresses
* ❌ Incorrect function signatures
* ❌ Missing "0x" prefix on data
* ❌ Invalid JSON format

**Process Errors**

* ❌ Skipping forum discussion
* ❌ Insufficient proposal detail
* ❌ No impact analysis
* ❌ Missing technical review

**Strategic Errors**

* ❌ Bundling unrelated changes
* ❌ Ignoring community feedback
* ❌ Unrealistic timelines

## Resources and Tools

#### Encoding Tools - For composing execution code

* [Ethereum ABI Encoder](https://abi.hashex.org/)
* [Foundry cast commands](https://getfoundry.sh/cast/reference/cast/)

#### Contract References

* [Mento Contracts GitHub](https://github.com/mento-protocol)
* [Deployed addresses documentation](https://docs.mento.org/mento-v3/build/deployments/addresses)

#### Support Channels

* [Discord #general channel](https://discord.com/channels/966739027782955068/966739028256907368)


# Voting Process

## Introduction

Voting is how you shape Mento's future. Every proposal that affects the protocol, from parameter adjustments to treasury allocations, requires community approval through on-chain voting. This guide walks you through casting votes, understanding your influence, and tracking proposal outcomes.

## Finding Active Proposals

Navigate to [governance.mento.org](https://governance.mento.org/) to view all proposals.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FdhvCUtvIy2w47MVKPy37%2Fimage.png?alt=media&amp;token=459b8b2c-8010-4850-bcd5-48bfd35ceee9" alt=""><figcaption></figcaption></figure>

### Proposal List

The proposals section shows each proposal with:

* **Status Badge**: Active, Defeated, Executed, etc.
* **Title**: Clear description of the proposal
* **Vote Summary**: For/Against/Abstain counts
* **Participation**: Number of voters and addresses

Proposals are listed chronologically with the most recent first.

## How to Vote

### Step 1: Select a Proposal

Click any proposal from the list to view its details. Active proposals display "Active" while completed ones show their final status.

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FvrfDjVo0n76MQb0YUBK6%2Fimage.png?alt=media&amp;token=32f3eabd-a3b5-4ca3-8fce-33a10cde6f28" alt=""><figcaption></figcaption></figure>

### Step 2: Review Proposal Information

Each proposal page includes:

**Header Information**

* Proposer address
* Proposed date and voting deadline
* Current status (Active, Defeated, etc.)

**Voting Metrics**

* Time remaining
* Quorum status and requirement
* Your voting power for this proposal
* Total votes cast

**Proposal Content**

* Description and rationale
* Technical specifications
* Expected impacts
* Forum discussion link

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F4eu1nijzGq9j7jBfoyCF%2Fimage.png?alt=media&amp;token=99eab8cf-fd35-41cb-a046-51d35c14f795" alt=""><figcaption></figcaption></figure>

### Step 3: Cast Your Vote

For active proposals, three voting options appear:

* **Vote YES** - Support the proposal
* **Abstain** - Neutral
* **Vote NO** - Oppose the proposal

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fuy2SECyWhr77rcqqWL6R%2Fimage.png?alt=media&amp;token=9cd0633c-3c3c-44ba-9ae2-6411a3ca6a5c" alt=""><figcaption></figcaption></figure>

Click your choice to initiate the voting transaction.

***

### Step 4: Confirm Transaction

1. Review your vote choice in your wallet
2. Confirm the transaction
3. Wait for on-chain confirmation
4. The interface updates to show "Your vote: \[CHOICE]"

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FnV9ELQxwKy1xlxlyMtiw%2Fimage.png?alt=media&amp;token=9d205174-0c8e-42d4-939f-5afcd955d994" alt=""><figcaption></figcaption></figure>

Your vote is permanent and cannot be changed.

## Understanding Voting Power

### How Your Weight is Calculated

**Snapshot Mechanism**

* Each proposal captures veMENTO balances at proposal creation block
* Your voting power = your veMENTO balance at that specific block
* Later changes to veMENTO balances don't affect voting power for existing proposals

**Display Format**

* Individual voting power shown as "Your Voting Power: X veMENTO"
* Total participation shown as "Total Votes: Y veMENTO"
* Your contribution visible in the Participants section

### Quorum Requirements

Proposals must meet minimum participation thresholds:

**Quorum Display**

* "Quorum not reached" appears if threshold unmet
* "Quorum reached" shows once minimum veMENTO participates
* Exact requirement shown (e.g., "Min. 4.6M veMENTO")
* Quorum is dynamically calculated as a percentage of total veMENTO supply

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FQBe9WZndrtBktCn43epp%2Fimage.png?alt=media&amp;token=3f67caf3-ebeb-461a-bddc-095e9bd11cb3" alt=""><figcaption></figcaption></figure>

**Outcome Determination**

* Must reach quorum AND have majority support
* Failed quorum = automatic defeat regardless of vote ratio
* Successful proposals must then be queued in order to enter the timelock period

## Tracking Results

### Live Voting Progress

During active voting, the interface displays:

**Vote Distribution**

* Percentage breakdown (Yes/No/Abstain)
* Visual progress bar showing vote weight
* Real-time updates as votes are cast

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FZAwjNTXfvwpdZQIcnKYe%2Fimage.png?alt=media&amp;token=347890b8-8880-40f1-8a1c-8f0abc9b957a" alt=""><figcaption></figcaption></figure>

### **Participation Metrics**

* Number of unique voters
* Total veMENTO voted vs. available
* Individual voter addresses and weights

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FkYegJUkiS0ew0EuDg5yu%2Fimage.png?alt=media&amp;token=4da81791-e538-4c81-b72b-6f0f634c649e" alt=""><figcaption></figcaption></figure>

### Understanding Status Changes

**Active** → Voting period open\
**Cancelled** → Vetoed proposals\
**Success →** Approved (Majority yes & quorum reached)\
**Queued** → In timelock, awaiting execution\
**Executed** → Changes implemented on-chain\
**Defeated** → Failed (low support or no quorum)

### Post-Voting Timeline

1. **Voting Ends** - No new votes accepted
2. **Result Calculation** - Final tally determines outcome
3. **Timelock Period** (2 days) - Successful proposals wait
4. **Watchdog Review** - Safety check window
5. **Execution** - Changes go live on-chain

## Best Practices

### Effective Participation

**Before Voting**

* Read the complete proposal
* Check forum discussions
* Understand technical implications
* Consider long-term impacts

**When Voting**

* Vote early to avoid missing deadlines
* Ensure sufficient CELO for gas
* Verify transaction confirmation

**After Voting**

* Monitor proposal progress
* Participate in implementation discussions
* Share feedback for future proposals

### Building Governance Reputation

* Vote consistently on proposals
* Provide rationale in forums
* Support well-crafted proposals
* Help improve weak proposals
* Maintain long-term perspective

## Common Questions

<details>

<summary><strong>Can I change my vote?</strong></summary>

No, all votes are final once submitted.

</details>

<details>

<summary><strong>What if I miss the voting period?</strong></summary>

You cannot vote after the deadline. Set reminders for important proposals.

</details>

<details>

<summary><strong>Why don't I see my veMENTO balance?</strong></summary>

Your voting power is captured at proposal creation. Check if you locked MENTO after the proposal was submitted.

</details>

<details>

<summary><strong>How do I know if my vote counted?</strong></summary>

Look for "Your vote: \[CHOICE]" on the proposal page and your address in the Participants list.

</details>


# MENTO Tokenomics

The MENTO token serves as the governance and value accrual mechanism for the Mento Protocol. Through carefully designed tokenomics, MENTO aligns the interests of token holders, users, and the protocol's long-term sustainability.

## Token Overview

**Token Type**: ERC-20 governance token

**Total Supply**: 1,000,000,000 (1 billion) MENTO

**Initial Status**: Non-transferable (governance only)

**Transferability**: Subject to governance approval

MENTO launched as a non-transferable governance token, allowing holders to participate in protocol decisions while preventing speculative trading during the early stages. The community will decide when to enable transfers through an on-chain vote.

## Token Distribution

The initial allocation balances community ownership with sustainable development:

### Community Treasury (45% - 450M tokens)

The largest allocation goes to the Mento Community Treasury, ensuring resources for:

* Protocol development and maintenance
* Liquidity incentives and ecosystem growth
* Grants and community initiatives
* Long-term sustainability

**Emission Schedule**: 50M available at genesis, remainder emitted via exponential decay with 10-year half-life. This creates predictable, decreasing emissions that prevent sudden supply shocks.

### Team & Contributors (30% - 300M tokens)

Allocated to Mento Labs team, contributors, supporters, and advisors:

* **25% as veMENTO**: 1-year locked voting power for immediate governance participation
* **75% as MENTO**: 1-year cliff followed by 3-year linear vesting

This structure ensures core contributors remain aligned with long-term protocol success.

### Community Airdrops (10% - 100M tokens)

**CELO Holders & Mento Users (5% - 50M)**: Rewards early adopters and active users

* Distributed as 2-year locked veMENTO with linear unlock
* Recognizes historical contributions to the ecosystem

**Celo Community Treasury (5% - 50M)**: Strengthens cross-ecosystem alignment

* 2-year delay followed by 6-year linear vesting
* Fosters continued collaboration between protocols

### Reserve Safety Fund (5% - 50M tokens)

Emergency collateral backing for extreme scenarios:

* Acts as last-resort protection for stablecoin holders
* Can be deployed if primary collateral suffers losses
* Provides additional confidence in system stability

### Future Team & Advisors (10% - 100M tokens)

Reserved for attracting top talent:

* Enables competitive compensation packages
* Supports long-term team growth
* Maintains ability to bring in expert advisors

## Value Accrual Mechanisms

MENTO captures value from protocol operations through multiple streams:

### Protocol Revenue Sources

1. **Trading Fees**: Collected on every swap through the protocol
2. **Reserve Yield**: Returns from deployed reserve assets
3. **CDP Interest(V3)**: Interest paid by synthetic stablecoin borrowers
4. **Rebalancing-related Fees (V3)**: Revenue associated with inventory rebalancing operations

### Revenue Distribution

Governance controls how protocol revenue flows:

* **Protocol-driven MENTO buybacks**: Expected primary path for value to flow indirectly to MENTO holders
* **Stability Pools**: Share of revenue for providing liquidation backstop
* **Buyback & Burn**: Potential mechanism to reduce supply
* **Treasury Growth**: Funding ongoing operations

The exact distribution is governable, allowing the community to optimize for growth, sustainability, or value return as needed. In the current design, protocol revenue is not shared directly with veMENTO holders; instead, value is expected to flow to MENTO holders indirectly through protocol-driven buybacks. Not every mechanism listed above is necessarily live at all times; some require explicit governance activation.

## veMENTO: Vote-Escrowed Governance

Following the successful Curve model, MENTO can be locked for veMENTO to gain:

**Voting Power**: Longer locks (up to 4 years) receive proportionally more voting weight, encouraging long-term thinking.

**Indirect Value Accrual**: Protocol revenue is intended to flow to MENTO holders indirectly through governance-directed MENTO token buybacks, while veMENTO determines how that revenue is allocated.

**Governance Rights**: Participate in all protocol decisions including parameter changes, asset listings, and treasury management.

The vote-escrow model creates strong alignment—those with the most influence have the longest commitment to the protocol's success.

## Emission Schedule

MENTO follows a controlled emission model:

1. **Genesis**: Initial distribution to allocated recipients
2. **Treasury Emissions**: Exponential decay with 10-year half-life
3. **Liquidity Incentives**: Governance-controlled rewards for strategic pools
4. **Long-term Cap**: Hard cap at 1 billion tokens ensures no inflation

This schedule provides flexibility for growth while maintaining predictable supply dynamics.

## Utility and Demand Drivers

MENTO derives utility from several core functions:

**Governance Power**: Control over a growing multi-chain stablecoin ecosystem

**Revenue Rights**: Governance influence over how protocol income streams are allocated, including protocol-driven MENTO buybacks

**Liquidity Incentives**: Rewards for providing essential liquidity

**Safety Backstop**: Reserve fund creates additional stability demand

As Mento expands across chains and use cases, these utilities create natural demand for MENTO tokens.

## Economic Security

The tokenomics include several protective mechanisms:

* **Delayed Transferability**: Prevents early speculation and dumping
* **Vesting Schedules**: Large allocations unlock gradually
* **Governance Timelock**: Changes execute after delay period
* **Watchdog Oversight**: Additional safety during early stages

These features ensure orderly market development when transfers eventually enable.

## Future Considerations

The MENTO tokenomics can evolve through governance:

* **Cross-chain Expansion**: Deploy MENTO on multiple networks
* **New Revenue Streams**: Add income from additional products
* **Enhanced Staking**: Develop more sophisticated reward mechanisms
* **Partnership Tokens**: Strategic allocations for ecosystem growth

The community will guide these developments based on protocol needs and market conditions.

### Next Steps

To participate in the MENTO ecosystem:

* [Understanding Mento Governance](https://www.notion.so/learn-about-mento/governance-mento-token/understanding-mento-governance) - Learn how governance works
* [Participating in Governance](https://www.notion.so/learn-about-mento/governance-mento-token/participating-in-governance) - Start voting and proposing
* [Governance Forum](https://forum.mento.org/) - Join the community discussion


# Watchdogs & Safety

This applies to **Mento V3** governance. Mento implements multiple protection mechanisms to safeguard the protocol during its maturation. The watchdog system provides an additional security layer during the critical early stages of decentralized governance. For protocol-wide risk (oracle, reserve, smart contract), see [Risk overview](https://docs.mento.org/mento-v3/dive-deeper/security/risk-overview).

## What Are Watchdogs?

Watchdogs are trusted community members who oversee the Mento protocol by scrutinizing governance proposals. They pay close attention to the execution code of each proposal, identify malicious payloads, and can veto proposals via a 3-of-8 multisig if needed.

This mechanism serves as a "last-minute" defense against malicious actors. Ideally, suspicious proposals should be caught early and voted against by the community. However, the watchdog veto provides crucial protection against:

* Proposals with misleading descriptions
* Technical errors that could harm the protocol
* Governance attacks during low participation periods
* Actions that prioritize one stakeholder group over others

## Governance Proposal Lifecycle

Understanding when watchdogs can act requires knowing the proposal stages:

1. **Submission**: Proposal submitted on-chain
2. **Voting Period**: 7 days for community voting
3. **Queueing**: If passed, proposal enters 2-day timelock
4. **Execution**: Open-ended phase where proposal can be executed

**Veto Window**: Watchdogs can veto from the moment a proposal is queued until it's executed.

## The Watchdog Multisig

The watchdog system operates through a **3-of-8 multisignature Safe** with veto powers over governance proposals. This structure ensures:

* No single watchdog can block proposals
* Sufficient redundancy for availability
* Balance between security and efficiency
* Transparent on-chain operations

## What Watchdogs Veto

Watchdogs are expected to veto proposals that:

#### 1. Have Misleading Descriptions

The proposal description must accurately reflect the execution code. Any mismatch—whether intentional or accidental—warrants a veto to maintain governance integrity.

#### 2. Harm Protocol Stakeholders

Proposals with high probability of harming Mento stakeholders should be vetoed. Stakeholders include:

* **Mento stablecoin holders** (prioritized as risk-averse users)
* **MENTO token holders**
* **Projects and partners** relying on Mento infrastructure

**Priority Principle**: The safety of stablecoin holders takes precedence over risk-taking stakeholders like MENTO holders.

**Example**: A proposal to distribute all reserve collateral to MENTO holders would be vetoed as it undermines stablecoin holder safety, even if beneficial to token holders.

## How Monitoring Works

Watchdogs coordinate through multiple channels:

* **Private Telegram Group**: For watchdog coordination
* [**Public Discord Channel**](https://discord.com/channels/966739027782955068/1262714272476037212): Community discussion and flag raising
* **Automated Bot Notifications**: Alerts for new proposals with summaries
* **Self-Organization**: At least three reviews required before execution

Monitoring tools include:

* [Mento Governance UI](https://governance.mento.org/) - Human-readable proposal details
* [Governor Contract](https://celoscan.io/address/0x47036d78bB3169b4F5560dD77BF93f4412A59852) - Raw on-chain data
* [TimelockController](https://celoscan.io/address/0x890DB8A597940165901372Dd7DB61C9f246e2147) - Execution queue

### Current Watchdog Members

Initial watchdogs serve 12-month terms from governance activation:

1. **Bogdan Dumitru** - Mento Labs
2. **Bayo Sodimu** - Mento Labs
3. **Phillip Paetz** - Mento Labs
4. **Baransel Tekin** - Mento Labs
5. **Luuk Weber** - Kolektivo Labs
6. **Martin Chrzanowski** - cLabs
7. **Martin Volpe** - cLabs
8. **Silas Boyd-Wiziker** - Valora

The group can replace inactive members and elect a **Watchdog Secretary** responsible for:

* Rotating members annually
* Replacing non-responsive members
* Ensuring smooth process operation
* Implementing process improvements

## Technical Veto Process

To veto a proposal, watchdogs must:

1. **Identify the Timelock Operation ID** from bot notifications
2. **Initiate or sign a cancel transaction** in the Safe multisig
3. **Call the cancel function** on the TimelockController
4. **Notify other watchdogs** of the action

The technical steps involve interacting with the Safe interface and TimelockController contract detailed instructions are maintained in the watchdog operational guide.

## Guiding Principles

When evaluating proposals, watchdogs follow these principles:

* **Safety over timeliness**: Better to veto and request resubmission than risk harm
* **Transparency first**: All concerns should be communicated publicly
* **Technical accuracy**: Focus on code matching descriptions
* **Stakeholder protection**: Prioritize the most vulnerable users
* **Err on caution**: When in doubt, protect the protocol

## Progressive Decentralization

The watchdog system is explicitly temporary. The community will evaluate:

* **Participation rates**: Higher engagement reduces need for watchdogs
* **Proposal quality**: Better submissions require less oversight
* **Tool development**: Automated verification can replace manual review
* **Track record**: History of safe governance builds confidence

Through governance, the community can:

* Reduce required signers (e.g., from 3-of-8 to 2-of-5)
* Limit veto powers to specific proposal types
* Ultimately sunset the watchdog system entirely

## For Proposal Authors

To ensure smooth watchdog review:

1. **Match description to code exactly**
2. **Test thoroughly** and provide results
3. **Engage early** for complex proposals
4. **Document clearly** what each action does
5. **Allow time** for proper review

Well-prepared proposals pass review quickly, while unclear submissions face delays or vetoes.

## Accountability

Watchdog operations maintain transparency through:

* **Public identities** of all members
* **On-chain records** of all multisig actions
* **Open communication** channels
* **Performance accountability** to the community

This ensures watchdogs remain aligned with their protective mission while avoiding overreach.

## Next Steps

To understand Mento's complete governance framework:

* [Understanding Mento Governance](https://www.notion.so/learn-about-mento/governance-mento-token/understanding-mento-governance) - Core governance mechanics
* [Participating in Governance](https://www.notion.so/learn-about-mento/governance-mento-token/participating-in-governance) - How to propose and vote
* [Governance Forum](https://forum.mento.org/) - Join the discussion


# Security

Security is fundamental to Mento's design. This section covers the protocol's security architecture and provides access to third-party audit reports.

This section applies to **Mento** as a whole, including **Mento V3** (FPMM-based exchange, liquidity strategies, CDP integration). It describes the main risk categories, mitigations, and points to [risk overview](https://docs.mento.org/mento-v3/dive-deeper/security/risk-overview) and [audit reports](https://docs.mento.org/mento-v3/dive-deeper/security/audit-reports). For the canonical list of V3 and historical audits, see [Smart contracts → Audits](https://docs.mento.org/mento-v3/build/smart-contracts/audits).


# Risk overview

## Understanding Risk in Decentralized Stable Assets

Creating stable assets on a blockchain introduces unique challenges that traditional financial systems don't face. When you remove central authorities and replace them with smart contracts and algorithms, you gain transparency and accessibility but you also inherit new categories of risk that require sophisticated mitigation strategies.

The Mento Protocol operates in an adversarial environment where economic incentives, technical vulnerabilities, and market dynamics constantly interact. This overview explains the primary risks facing the protocol and the specific mechanisms we've built to address them. It applies to Mento as a whole, including **Mento V3** (FPMM pools, oracle adapter, liquidity strategies, and CDP integration).

## Economic Risks and Market Dynamics

### The Reserve Challenge

The fundamental challenge for any hybrid stable asset system is maintaining its peg during periods of market stress. Unlike purely algorithmic designs, Mento combines algorithmic supply adjustments with robust reserve backing. This hybrid approach provides multiple lines of defense, but still faces the core challenge: ensuring the Reserve can always honor redemptions when demand contracts sharply.

During market turmoil, users may rush to redeem their Mento stables for underlying collateral. The protocol must have sufficient reserves not just in nominal terms, but in liquid, accessible assets. This drives Mento's over-collateralization strategy, with the Reserve holding a diversified basket including USDC, DAI, and other stable collateral well above 100% of outstanding supply.

### Liquidity and Market Depth

Having adequate reserves means little if deploying them would cause excessive slippage. Mento addresses this through multiple liquidity venues, primarily the Fixed-Price Market Makers (FPMMs) that provide zero-slippage exchanges at oracle prices.

Trading limits provide another protection layer. Time-weighted caps spread large operations across multiple blocks or hours, preventing both market manipulation and cascade effects from large redemptions. These limits adjust based on market conditions and available liquidity depth.

## Technical Security Architecture

### Smart Contract Security

The Mento Protocol consists of dozens of interconnected smart contracts managing billions in value. Every major upgrade undergoes multiple independent audits from firms like Macro and Sherlock.

The architecture provides defense through modularity. Core contracts handling value storage are immutable and battle-tested. Peripheral contracts for governance and trading can be upgraded through time-locked procedures, giving the community time to review changes.

### Oracle Integrity

Price oracles represent a critical dependency. If an attacker manipulates the oracle price, they could extract value by trading at artificial rates. Mento addresses this through multiple defensive layers.

The protocol sources prices from multiple independent providers (e.g. Chainlink and on-chain median feeds such as SortedOracles), and in V3 the **OracleAdapter** applies validity and breaker checks before a pool uses a rate—ensuring no single provider can unilaterally influence prices and that stale or unsafe data is rejected. The BreakerBox system monitors these feeds in real-time, automatically halting trading if prices deviate beyond expected bounds or feeds go stale.

Different breaker types handle different scenarios. Median-Delta Breakers protect volatile pairs by comparing sequential updates. Value-Delta Breakers ensure stable pairs stay within tight bands. Even successful oracle manipulation would have limited impact—corrupted prices trigger circuit breakers before trades can execute.

### Operational Security

Beyond technical vulnerabilities, the protocol defends against operational attacks through the Watchdog multisig—a 3-of-8 group with veto power over any governance action within 48 hours. Watchdog members review every proposal's technical implementation to ensure code matches stated intent.

All privileged operations require multiple signatures and time delays. This transparency gives the community time to analyze changes and coordinate responses to potentially harmful actions.

## Governance and Systemic Risks

### Decentralization and Voting Power

Decentralized governance only provides security if voting power is actually distributed. Mento addresses this through veMENTO, requiring token holders to lock MENTO for periods up to four years to gain voting weight. This makes it expensive for attackers to accumulate power quickly—they must lock significant capital for extended periods.

The initial distribution supports decentralization: 45% to community treasury, 30% to contributors with vesting, plus ecosystem airdrops. No single entity controls a majority.

### Parameter Bounds

The protocol implements limits at the smart contract level. Governance can adjust parameters within reasonable ranges but cannot set clearly destructive values. These bounds themselves require special procedures with higher quorums and longer delays to modify.

## Learning from Past Failures

The DeFi space's history informs Mento's design. Iron Finance showed the dangers of reflexive tokens. Terra/Luna demonstrated how purely algorithmic stability can fail catastrophically. Oracle manipulations have extracted hundreds of millions from vulnerable protocols.

Mento's hybrid model combining algorithmic mechanisms with reserve backing provides resilience these systems lacked. Circuit breakers handle extreme events, and we assume all external data sources are potentially hostile.

## Ongoing Security Efforts

Security requires continuous effort. The protocol conducts regular reviews of both code and economic assumptions. Community members run independent monitoring infrastructure, providing distributed security no centralized team could match.

Public dashboards display real-time metrics, allowing anyone to monitor for anomalies. This transparency and community involvement create multiple detection layers for potential issues.

## Next Steps

To explore specific aspects of Mento's security architecture:

* [Audit Reports](https://docs.mento.org/mento-v3/dive-deeper/security/audit-reports) — Overview and links to audits; [Smart contracts → Audits](https://docs.mento.org/mento-v3/build/smart-contracts/audits) for the canonical V3 and historical list
* [Trading limits](https://docs.mento.org/mento-v3/dive-deeper/fpmm/trading-limits) · [Oracles & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers) - Protective mechanisms
* [Watchdogs & Safety](https://docs.mento.org/mento-v3/dive-deeper/governance-and-mento/watchdogs-and-safety) - Governance safeguards and veto powers
* [Analytics & Dashboards](https://docs.mento.org/mento-v3/other/analytics-and-dashboards) - Monitor metrics in real-time


# Audit Reports

Security is paramount to the Mento Protocol. All major protocol upgrades and new features undergo comprehensive security audits by leading blockchain security firms before deployment to mainnet.

### Audit Process

The Mento Protocol follows a rigorous security review process:

1. **Internal Review** - Core developers conduct thorough code reviews
2. **External Audit** - Independent security firms perform comprehensive audits
3. **Remediation** - All critical and high-severity findings are addressed
4. **Re-audit** - Fixed code is reviewed to ensure proper remediation
5. **Public Disclosure** - Final audit reports are published for transparency

## Mento V3 audits

**Mento V3** (FPMM-based exchange, OracleAdapter, liquidity strategies, CDP integration, TradingLimitsV2) is covered by **ChainSecurity**:

* [**Mento Core V3**](https://www.chainsecurity.com/security-audit/mento-core-v3) — FPMM, OracleAdapter, liquidity strategies, CDP integration, TradingLimitsV2
* [**Mento Liquity V2**](https://www.chainsecurity.com/security-audit/mento-liquity-v2) — Liquity v2 fork used for CDP-backed stables (e.g. GBPm)

For the full list of V3 and historical audits (with dates and version tags), see [Smart contracts → Audits](https://docs.mento.org/mento-v3/build/smart-contracts/audits).

## Completed Audits (overview)

<table data-view="cards"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center">Mento Liquity V2</td><td align="center">Feb 2026</td><td align="center"><a href="https://www.chainsecurity.com/security-audit/mento-liquity-v2">View</a></td><td data-object-fit="contain"><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FD4L4w69hLbxddDnUaiZE%2FScreenshot%20from%202026-03-16%2015-37-29.png?alt=media&amp;token=c78aec99-8510-4cc1-80b1-987658b46784">Screenshot from 2026-03-16 15-37-29.png</a></td></tr><tr><td align="center">Mento Core V3</td><td align="center">Feb 2026</td><td align="center"><a href="https://www.chainsecurity.com/security-audit/mento-core-v3">View</a></td><td data-object-fit="contain"><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FD4L4w69hLbxddDnUaiZE%2FScreenshot%20from%202026-03-16%2015-37-29.png?alt=media&amp;token=c78aec99-8510-4cc1-80b1-987658b46784">Screenshot from 2026-03-16 15-37-29.png</a></td></tr><tr><td align="center">veMento</td><td align="center">Jan 2025</td><td align="center"><a href="https://app.hats.finance/audit-competitions/mento-0x2a1b9b1f6fa7c2e73815a7dff0e1688767382694/scope">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fb9GxUGoHYNVg0uDffZy2%2Fhats-finance-new91139.logowik.com.webp?alt=media&amp;token=54b2d3d8-f2df-412e-afc3-7879a89dd1b0">hats-finance-new91139.logowik.com.webp</a></td></tr><tr><td align="center">Mento Governance</td><td align="center">Mar 2024</td><td align="center"><a href="https://audits.sherlock.xyz/contests/187?filter=results">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FUmPD4ihxlZvJtAHpSNwf%2F63af585b917c0c7c574c4a0f_sherlock-og.jpg?alt=media&amp;token=62efe73f-4e1d-47ad-9c15-81a5bcd25f4b">63af585b917c0c7c574c4a0f_sherlock-og.jpg</a></td></tr><tr><td align="center">Mento Governance</td><td align="center">Mar 2024</td><td align="center"><a href="https://0xmacro.com/library/audits/mento-3">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F9FxQXWfT4Ww0TZVTRlbD%2Fmacro.webp?alt=media&amp;token=094ee18e-7a08-4f94-befb-a7847575adf0">macro.webp</a></td></tr><tr><td align="center">Mento Governance</td><td align="center">Jan 2024</td><td align="center"><a href="https://0xmacro.com/library/audits/mento-2">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F9FxQXWfT4Ww0TZVTRlbD%2Fmacro.webp?alt=media&amp;token=094ee18e-7a08-4f94-befb-a7847575adf0">macro.webp</a></td></tr><tr><td align="center">Mento V2</td><td align="center">Aug 2023</td><td align="center"><a href="https://0xmacro.com/library/audits/mento-1">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2F9FxQXWfT4Ww0TZVTRlbD%2Fmacro.webp?alt=media&amp;token=094ee18e-7a08-4f94-befb-a7847575adf0">macro.webp</a></td></tr><tr><td align="center">Mento Protocol Audit</td><td align="center">Feb 2023</td><td align="center"><a href="https://www.verilog.solutions/audits/mento/">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2FuhtfADzdJFg8FErRwaXe%2Fverilog-logo.svg?alt=media&amp;token=58b19631-418b-48a3-9506-977408da7e50">verilog-logo.svg</a></td></tr><tr><td align="center">Celo Contracts Audit</td><td align="center">Feb 2021</td><td align="center"><a href="https://blog.openzeppelin.com/celo-contracts-audit#phase-3">View</a></td><td><a href="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fc0KbQH6ybEhngcNT9DeF%2Foz-nav.svg?alt=media&amp;token=5fea6028-c7c9-424f-bc85-e8e857f08721">oz-nav.svg</a></td></tr></tbody></table>


# Repository Overview

Overview of the main Mento GitHub repositories.

Overview of the main [Mento GitHub repositories](https://github.com/mento-protocol), in order of importance.

***

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

Core smart contracts for Mento V3: FPMM (Fixed-Price Market Maker) pools, OracleAdapter, liquidity strategies (Reserve, CDP, OpenLiquidityStrategy), TradingLimitsV2, BreakerBox integration, and related tooling. Built with [Foundry](https://book.getfoundry.sh/) for compilation and testing. This is the primary repo for the on-chain exchange and rebalancing logic.

***

## [bold](https://github.com/mento-protocol/bold) — CDP (Liquity v2 fork)

Fork of [Liquity v2](https://www.liquity.org/) used for Mento’s **CDP-backed stablecoins** (e.g. GBPm). Contains the contracts, subgraph, and frontend for the CDP system. Key differences from upstream: **USDm** as collateral (instead of WETH/LSTs), **FX-pegged stables** (e.g. mGBP) as debt tokens, **FX rate feeds** via Mento’s OracleAdapter, and **one independent instance per FX currency**. See the repo README for Mento-specific risks and architecture.

***

## [frontend-monorepo](https://github.com/mento-protocol/frontend-monorepo)

Monorepo for all Mento frontends. Built with **Turborepo**, **PNPM**, **Next.js**, and **Tailwind**; shared UI and web3 packages live under `packages/`. Main apps:

| App                      | Purpose                                  |
| ------------------------ | ---------------------------------------- |
| **app.mento.org**        | Mento Exchange UI (swap, liquidity, CDP) |
| **governance.mento.org** | Governance UI                            |
| **reserve.mento.org**    | Reserve dashboard                        |
| **minipay.mento.org**    | MiniPay DApp                             |
| **ui.mento.org**         | Component library showcase               |

See the repo README for setup, scripts, and development workflow.


# Integration

**Who this is for:** Developers and protocols that want to add Mento stables, use Mento's oracle path, or look up deployment addresses. Mento V3 is a DEX for on-chain FX: FPMM pools swap at the oracle rate. Today, that oracle source is **Chainlink**. This guide covers the main integration paths and points to the [SDK](https://docs.mento.org/mento-v3/build/mento-sdk), [Smart Contracts](https://docs.mento.org/mento-v3/build/smart-contracts), and [Deployments](https://docs.mento.org/mento-v3/build/deployments) for implementation details.

## Integration Guides

### [Integrate Stables](https://docs.mento.org/mento-v3/build/integration/integrate-stables)

Add support for Mento stable assets (USDm, EURm, GBPm, etc.) in your DeFi protocol, wallet, payment system, or exchange. Covers token contracts, metadata, and display values.

### [Integrate Oracles](https://docs.mento.org/mento-v3/build/integration/integrate-oracles)

Use Mento's Chainlink-backed oracle path for reliable FX rates in DeFi protocols, analytics, or risk management.

### [Deployments & addresses](https://github.com/mento-protocol/docs/blob/main/build/integration/integrate-mento-stables.md)

Contract addresses, deployment details per network, and links to FiatConnect and brand assets for exchanges.

## Technical Resources

* [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) — JavaScript/TypeScript library for swaps and integration
* [Smart Contracts](https://docs.mento.org/mento-v3/build/smart-contracts) — Contract reference and deployment addresses

## Getting Help

* **Discord**: #general for questions
* **Forum**: [forum.mento.org](https://forum.mento.org/)
* **GitHub**: [mento-protocol](https://github.com/mento-protocol) for issues and feature requests


# Integrate Stables

This guide walks through adding support for Mento stable assets in your application. Mento stables are ERC-20 tokens that track the value of fiat currencies. In **Mento V3**, stables are either **reserve-backed** (e.g. USDm, EURm), backed by collateral in the Reserve, or **CDP-backed** (e.g. GBPm), minted via the Liquity v2–style CDP system. For integration purposes they are standard ERC-20s; the backing model does not change how you read balances, transfer, or display values.

## Available Stable Assets

Mento supports a growing ecosystem of stable assets that track various fiat currencies, including USD, EUR, BRL, KES, GBP, and many more. Each stable asset is an ERC-20 token that maintains a peg to its respective fiat currency.

For the complete list of available stables and their contract addresses, see:

* [**Mento Reserve**](https://reserve.mento.org/) — Live view of all supported stables with supply information
* [**Deployments > Addresses**](https://docs.mento.org/mento-v3/build/deployments/addresses) — Smart contract addresses per chain

## Common Use Cases

### DeFi Protocols

Accept Mento stables as collateral, enable lending/borrowing, or create liquidity pools with stable pairs.

### Wallets

Display balances, enable transfers, and show accurate fiat values for Mento stable assets.

### Payment Applications

Process merchant payments, remittances, or payroll using region-specific stable currencies.

### Exchanges & Aggregators

List Mento stable pairs for spot trading or include in routing algorithms.

## Integration Steps

### Step 1: Add Token Contracts

Add the contract addresses for the stables you want to support:

```jsx
// Example addresses (USDm and EURm on mainnet)
const STABLE_ADDRESSES = {
  USDm: "0x765DE816845861e75A25fCA122bb6898B8B1282a",
  EURm: "0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73",
  // ... add other stables as needed
};
```

For the complete list of stable addresses across all networks, see [Deployments > Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses).

### Step 2: Configure Token Metadata

Add token symbols, decimals, and display information:

```tsx
const TOKEN_CONFIG = {
  USDm: {
    symbol: "USDm",
    decimals: 18,
    name: "Mento Dollar",
    icon: "path/to/usdm-icon.svg"
  },
  // ... other tokens*
};
```

> **Note**: All token metadata can be read from the smart contract using standard ERC-20 metadata functions (`name()`, `symbol()`, `decimals()`). Token icons are available in the [frontend monorepo](https://github.com/mento-protocol/frontend-monorepo/tree/main/apps/app.mento.org/public/tokens).

### Step 3: Implement Standard ERC-20 Operations

Use your existing ERC-20 handling for:

* Reading balances: `balanceOf(address)`
* Transfers: `transfer(to, amount)`
* Approvals: `approve(spender, amount)`
* Allowances: `allowance(owner, spender)`

### Step 4: Handle Fiat Display Values

Mento stables maintain a peg with their respective fiat currencies under normal conditions (e.g., 1 USDm ≈ 1 USD, 1 EURm ≈ 1 EUR).

For precise exchange rates, use the pool’s oracle (see [Oracles, price feeds & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers)) or the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) for quotes.

### Step 5: Enable cross-stable swaps (optional)

If your application needs to swap between Mento stables, use the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) to get quotes and build swap transactions against Mento V3 FPMM pools. Swaps execute at the oracle rate (minus fee). See the SDK [Guides](https://docs.mento.org/mento-v3/build/mento-sdk/guides) for getting exchange pairs and initiating a swap, and [Swap & liquidity](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md) for the user-facing flow.

## Working Examples

For complete, runnable examples of integrating Mento stables and swaps, check out the [Mento SDK Examples repository](https://github.com/mento-protocol/mento-sdk-examples). It includes:

* Pair discovery queries
* Swap implementations
* TypeScript examples

## Best Practices

### Decimal Handling

All Mento stables use 18 decimals. Always use appropriate libraries for decimal math to avoid precision errors.

### Gas Optimization

When supporting multiple operations, consider batching transactions or using multicall patterns.

### User Experience

* Show both token amounts and fiat values
* Use familiar currency symbols ($, €, R$, CFA)

### Network Support

Mento stables are deployed on Celo and other supported chains. For cross-chain use cases, work with official bridges:

* Wormhole (USDm)
* Portal Bridge

## Testing

1. Get testnet CELO from the [Celo Faucet](https://faucet.celo.org/), then swap for your desired token on the [Mento App](https://app.mento.org/?chain=42220)
2. Use Alfajores testnet addresses for development
3. Test all ERC-20 operations (transfer, approve, etc.)
4. Verify fiat value display matches user expectations

## Support

* **Discord**: #general for any questions
* **Token Icons**: Available in the [frontend monorepo](https://github.com/mento-protocol/frontend-monorepo)

## Next steps

* For swap functionality, see [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) and [Swap & liquidity](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md)
* For oracle-backed price feeds (V3 OracleAdapter), see [Integrate Oracles](https://docs.mento.org/mento-v3/build/integration/integrate-oracles)
* For contract addresses and ABIs, see [Deployments](https://docs.mento.org/mento-v3/build/deployments) and [Smart Contracts](https://docs.mento.org/mento-v3/build/smart-contracts)


# Integrate Oracles

This guide describes how to use Mento V3’s **oracle** layer for FX rates in your application. In V3, FPMM pools get their swap rate from the **OracleAdapter**, which returns a rate only when it is **valid** (recent, trading not suspended, and for FX pairs, market hours open). Integrating with the **OracleAdapter** gives you the same rate and validity rules the pools use.

**Today, Chainlink is the only oracle source used in Mento V3.** If you integrate Mento's oracle path, you are integrating a Chainlink-backed rate plus Mento's validity checks.

This is important for fiat FX integrations because the reference markets are not 24/7: Chainlink FX feeds generally stop updating on weekends and certain holidays, and Mento’s FX-validity path intentionally mirrors those closures.

**Contract reference:** [Smart Contracts > OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter)

***

## Why the OracleAdapter (V3)

The **OracleAdapter** is the single interface FPMM pools use for the swap rate. It:

* Reads the current **Chainlink-backed** rate from the underlying feed path used by Mento.
* Checks **recency** (report not older than the configured expiry).
* Checks **trading mode** from **BreakerBox** (e.g. trading suspended when a circuit breaker has tripped).
* For FX pairs, checks **FX market hours** (optional; can restrict trading to reference market hours).

If any check fails, the adapter **reverts**. So when you use the adapter, you get a rate that is valid for trading at that moment: the same guarantee the pool uses. Directly reading lower-level feed contracts does not include these validity checks.

***

## Common use cases

* **DeFi protocols** — Real-time FX rates for collateral valuation, liquidation thresholds, or cross-currency logic.
* **Price feed aggregators** — Combine Mento’s validity-gated Chainlink-backed rates with other sources.
* **Cross-border applications** — Remittance calculators, multi-currency wallets, or international payment systems.
* **Stable asset pricing** — Understand and replicate how Mento FPMM pools price swaps (oracle rate minus fee).

***

## Integration steps

### Step 1: Use the OracleAdapter contract

You need the **OracleAdapter** address for your chain (see [Deployments](https://docs.mento.org/mento-v3/build/deployments/addresses)). The pool’s `oracleAdapter()` and `referenceRateFeedID()` tell you which adapter and feed ID that pool uses; for a custom integration you may have a fixed adapter and feed ID per pair.

```solidity
// Example: get the rate the pool uses (validity-gated)
IOracleAdapter adapter = IOracleAdapter(adapterAddress);
address rateFeedID = 0x...; // e.g. pool.referenceRateFeedID() for that pair

(uint256 numerator, uint256 denominator) = adapter.getFXRateIfValid(rateFeedID);
// Rate = numerator / denominator (1e18 scale). Reverts if invalid.
```

### Step 2: Get a valid rate (for swaps or quoting)

Use **getFXRateIfValid(rateFeedID)** when you need the same rate the FPMM would use. It reverts if:

* FX market is closed (when FX market hours are enforced).
* Trading is suspended (BreakerBox).
* There is no recent rate (stale).

In the current `MarketHoursBreaker`, FX is treated as closed from **Friday 21:00 UTC** until **Sunday 23:00 UTC**, on **Dec 25** and **Jan 1**, and after **22:00 UTC** on **Dec 24** and **Dec 31**.

```solidity
try adapter.getFXRateIfValid(rateFeedID) returns (uint256 num, uint256 denom) {
    // Use num/denom for pricing or display
} catch (bytes memory reason) {
    // FXMarketClosed, TradingSuspended, or NoRecentRate
}
```

For flows that don’t need FX market hours (e.g. non-FX or 24/7 markets), use **getRateIfValid(rateFeedID)** — same as above but without the FX market hours check.

### Step 3: Check validity without using the rate

To show “trading available” vs “market closed / suspended” without using the rate:

```solidity
try adapter.ensureRateValid(rateFeedID) {
    // Rate is valid; safe to show quote or execute
} catch {
    // Invalid: trading suspended, no recent rate, or FX market closed
}
```

### Step 4: Inspect rate and status (no revert)

For dashboards or conditional logic where you don’t want a revert:

```solidity
IOracleAdapter.RateInfo memory info = adapter.getRate(rateFeedID);

// info.numerator, info.denominator  — rate (1e18 scale)
// info.tradingMode  — 0 = bidirectional (trading allowed)
// info.isRecent     — true if within report expiry
// info.isFXMarketOpen
```

You can then decide locally whether to treat the rate as valid (e.g. only when `tradingMode == 0` and `isRecent` and, for FX, `isFXMarketOpen`).

### Step 5: Rate feed IDs

Each feed is identified by a **rateFeedID** (address). The FPMM pool stores a `referenceRateFeedID` for its pair. Common patterns:

* Legacy CELO/cStable: rate feed ID can be the stable token address.
* Other pairs: often derived, e.g. `address(uint160(uint256(keccak256(abi.encodePacked("USDCUSD")))))`.
* Relayed Chainlink feeds: often prefixed (e.g. `"relayed:NGNUSD"`).

Use the pool’s `referenceRateFeedID()` for the same feed the pool uses, or your deployment docs for the correct ID per pair.

### Step 6: Rate format

* From **OracleAdapter**: rates are returned with **1e18** denominator (adapter normalizes from the underlying 1e24).
* `rate = numerator / denominator` (e.g. token1 per token0, or quote per base depending on the feed).
* For **getRate()**, the same scale applies; use `numerator` and `denominator` from the `RateInfo` struct.

***

## Best practices

* **Use the adapter for swap-related logic** — So your validity rules match the pool (recency, breakers, FX hours).
* **Handle reverts** — `getFXRateIfValid` and `ensureRateValid` revert on invalid; use try/catch or call `getRate()` when you need non-reverting behavior.
* **Cache within a transaction** — If you use the same rate multiple times in one tx, read once and reuse.
* **Circuit breakers** — BreakerBox already gates trading; for extra safety you can enforce bounds on the rate in your application.

***

## JavaScript / TypeScript

Use the OracleAdapter ABI and the same flow: **getFXRateIfValid** for a valid rate (catch errors), or **getRate** for inspection without revert.

```ts
import { createPublicClient, http } from 'viem';
import { celo } from 'viem/chains';

const client = createPublicClient({
  chain: celo,
  transport: http(RPC_URL),
});

// Get rate (validity-gated; will throw if invalid)
const [numerator, denominator] = await client.readContract({
  address: oracleAdapterAddress,
  abi: oracleAdapterABI,
  functionName: 'getFXRateIfValid',
  args: [rateFeedID],
});
const rate = Number(numerator) / Number(denominator);

// Or inspect without revert
const rateInfo = await client.readContract({
  address: oracleAdapterAddress,
  abi: oracleAdapterABI,
  functionName: 'getRate',
  args: [rateFeedID],
});
// rateInfo.numerator, rateInfo.denominator, rateInfo.tradingMode, rateInfo.isRecent, rateInfo.isFXMarketOpen
```

For swap quoting and execution, the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) uses the pool’s `getAmountOut`, which already goes through the adapter; you typically don’t need to call the adapter from JS unless you’re building custom oracle UIs or risk tools.

***

## Next steps

* [Smart Contracts > OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter) — Full contract reference and Solidity snippets.
* [Smart Contracts > FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) — How the pool uses the adapter for quotes and swaps.
* [Dive Deeper: Oracles & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers) — Design and safety.
* [Deployments](https://docs.mento.org/mento-v3/build/deployments/addresses) — OracleAdapter and pool addresses per chain.


# Mento SDK

The **Mento SDK** is a TypeScript library for integrating applications with the Mento Protocol. **SDK v3** is a complete rewrite for **Mento V3**: service-based design, **viem-native** (no ethers.js), first-class **FPMM pool** support, **liquidity management**, **CDP borrow** (trove operations), enriched **pool details**, and **route caching** for fast quote lookups.

**Repository:** [mento-protocol/mento-sdk](https://github.com/mento-protocol/mento-sdk)

**Who this is for:** JavaScript/TypeScript developers who want to swap, add/remove liquidity, borrow against collateral, discover pools and routes, get quotes, and check trading status—without calling the smart contracts directly.

***

## What’s new in SDK v3

| Capability                     | Description                                                                                                                                   |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Service-based architecture** | Replaces the monolithic `Mento` class with focused services: `pools`, `routes`, `quotes`, `swap`, `liquidity`, `borrow`, `tokens`, `trading`. |
| **viem-native**                | Drops ethers.js in favor of **viem** as a peer dependency; use any viem wallet/client for signing and sending transactions.                   |
| **FPMM pool support**          | First-class support for V3 Fixed Product Market Maker pools alongside legacy Virtual (BiPoolManager) pools.                                   |
| **Liquidity management**       | Add/remove liquidity and **zap in/out** for FPMM pools (single-token entry/exit with configurable split).                                     |
| **Borrow (CDP)**               | **Trove management** via the Mento CDP system: open, close, adjust, repay; predict upfront fees and read system params.                       |
| **Pool details**               | Enriched pool data: pricing, fees, rebalancing state, and trading limits so you can build UIs and risk checks.                                |
| **Route caching**              | Pre-computed route cache for faster quote lookups; optional fresh route generation from the chain.                                            |
| **Dual CJS/ESM**               | Proper dual-format package with exports map for Node and bundlers.                                                                            |
| **Packaging & audit**          | Pre-release audit: missing exports, README accuracy, error handling, and packaging best practices addressed.                                  |

***

## Services at a glance

After `Mento.create(ChainId.CELO)` (or custom RPC / viem client), you get a client with these namespaces:

| Service             | What you can do                                                                                                                              |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **mento.tokens**    | List Mento stable tokens and collateral assets.                                                                                              |
| **mento.pools**     | Discover and inspect pools (FPMM + legacy). Get addresses, token info, **pricing**, **fees**, **rebalancing state**, and **trading limits**. |
| **mento.routes**    | Find trading routes between any two tokens (direct and multi-hop). Use **cached** routes for speed or **fresh** from chain.                  |
| **mento.quotes**    | Get expected swap output (or amount in for exact out). Oracle-priced, fee-adjusted.                                                          |
| **mento.swap**      | Build swap transactions with optional approval; returns params you send with any viem wallet client.                                         |
| **mento.trading**   | Check **circuit breaker** and **trading limit** status: is a pair tradable? Full pool tradability status.                                    |
| **mento.liquidity** | **Add/remove liquidity** to FPMM pools; **zap in** (single token → LP) and **zap out** (LP → single token). Get LP token balance.            |
| **mento.borrow**    | **Open, adjust, close** troves; **repay**; read trove data and system params; **predict upfront fee** before opening.                        |

***

## Quick start

```typescript
import { Mento, ChainId, deadlineFromMinutes } from '@mento-protocol/mento-sdk'
import { parseUnits } from 'viem'

// Default public RPC
const mento = await Mento.create(ChainId.CELO)

// Or with custom RPC
const mento = await Mento.create(ChainId.CELO, 'https://your-rpc-url.com')

// Or with an existing viem PublicClient
const mento = await Mento.create(ChainId.CELO, yourPublicClient)
```

**Supported chains:** Celo Mainnet (`ChainId.CELO`, 42220), Celo Sepolia (`ChainId.CELO_SEPOLIA`, 11142220).

***

## Documentation in this section

* [Installation](https://docs.mento.org/mento-v3/build/mento-sdk/installation) — Install `@mento-protocol/mento-sdk` and the **viem** peer dependency (Node 18+).
* [Guides](https://docs.mento.org/mento-v3/build/mento-sdk/guides) — Step-by-step: tokens & pools, routes, quotes, swaps, **trading status**, **liquidity**, and **borrow**.

**See also:** [Integration](https://docs.mento.org/mento-v3/build/integration), [Smart Contracts](https://docs.mento.org/mento-v3/build/smart-contracts), [Deployments](https://docs.mento.org/mento-v3/build/deployments).


# Installation

The Mento SDK v3 requires **Node.js 18+** and **viem** as a peer dependency (ethers.js is no longer used). The package is published in **dual CJS/ESM** format with an exports map for Node and bundlers.

```bash
npm install @mento-protocol/mento-sdk viem
# or
pnpm add @mento-protocol/mento-sdk viem
# or
yarn add @mento-protocol/mento-sdk viem
```

**Peer dependency:** `viem ^2.21.44` (or compatible v2.x). The SDK uses viem for chain config, encoding, and wallet interactions.

***

## Create the client

```typescript
import { Mento, ChainId } from '@mento-protocol/mento-sdk'

// Use default public RPC for the chain
const mento = await Mento.create(ChainId.CELO)

// Or pass a custom RPC URL
const mento = await Mento.create(ChainId.CELO, 'https://your-rpc-url.com')

// Or pass an existing viem PublicClient (e.g. for custom transport or chain)
const mento = await Mento.create(ChainId.CELO, yourPublicClient)
```

***

## What you can do next

| Area          | Guides                                                                                                                                                                                   |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Discovery** | [Discovering tokens, pools and routes](https://docs.mento.org/mento-v3/build/mento-sdk/guides/getting-exchange-pairs) — tokens, pools, routes, trading status                            |
| **Trading**   | [Getting a quote](https://docs.mento.org/mento-v3/build/mento-sdk/guides/getting-a-quote), [Initiating a swap](https://docs.mento.org/mento-v3/build/mento-sdk/guides/initiating-a-swap) |
| **Liquidity** | [Liquidity management](https://docs.mento.org/mento-v3/build/mento-sdk/guides/liquidity) — add/remove liquidity, zap in/out for FPMM pools                                               |
| **Borrow**    | [Borrow (CDP)](https://docs.mento.org/mento-v3/build/mento-sdk/guides/borrow) — open/adjust/close troves, fees, system params                                                            |

Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# Guides

These guides show how to use the **Mento SDK v3** for Mento V3: FPMM pools, oracles, route caching, liquidity, and CDP borrowing. The SDK is **service-based**: after `Mento.create(ChainId.CELO)` you use `mento.tokens`, `mento.pools`, `mento.routes`, `mento.quotes`, `mento.swap`, `mento.trading`, `mento.liquidity`, and `mento.borrow`.

***

## Discovery & trading status

| Guide                                                                                                                 | What you’ll do                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Discovering tokens, pools and routes](https://docs.mento.org/mento-v3/build/mento-sdk/guides/getting-exchange-pairs) | Discover tokens, **pools** (with pricing, fees, rebalancing, limits), **routes** (cached or fresh), and **trading status** (circuit breaker, limits). |
| [Getting a quote](https://docs.mento.org/mento-v3/build/mento-sdk/guides/getting-a-quote)                             | Get expected swap output with `mento.quotes.getAmountOut` (or amount in for exact out).                                                               |
| [Initiating a swap](https://docs.mento.org/mento-v3/build/mento-sdk/guides/initiating-a-swap)                         | Build swap and approval transactions with `mento.swap.buildSwapTransaction` and send with a viem wallet.                                              |

***

## Liquidity (FPMM pools)

| Guide                                                                                    | What you’ll do                                                                                                                    |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [Liquidity management](https://docs.mento.org/mento-v3/build/mento-sdk/guides/liquidity) | **Add/remove liquidity** to FPMM pools; **zap in** (single token → LP) and **zap out** (LP → single token); get LP token balance. |

***

## Borrow (CDP)

| Guide                                                                         | What you’ll do                                                                                                                                      |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Borrow (CDP)](https://docs.mento.org/mento-v3/build/mento-sdk/guides/borrow) | **Open, adjust, close** troves; read trove data and system params; **predict upfront fee** before opening; build transactions for your viem wallet. |

***

All guides assume you have created a client as in [Installation](https://docs.mento.org/mento-v3/build/mento-sdk/installation). For runnable code, see [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# Discovering tokens, pools and routes

This guide shows how to use the Mento SDK v3 to discover tradable tokens, FPMM pools, and routes between tokens. The SDK uses a **route cache** by default for fast lookups; you can also fetch fresh data from the chain.

***

## Create the client

```typescript
import { Mento, ChainId } from '@mento-protocol/mento-sdk'

// Celo Mainnet (use ChainId.CELO_SEPOLIA for testnet)
const mento = await Mento.create(ChainId.CELO)
```

***

## Tokens

Get Mento stable tokens and collateral assets:

```typescript
const stableTokens = await mento.tokens.getStableTokens()
const collateral = await mento.tokens.getCollateralAssets()
```

***

## Pools

List all pools (FPMM and legacy Virtual/BiPoolManager):

```typescript
const pools = await mento.pools.getPools()
```

The SDK returns **enriched pool data**: addresses, token info, **pricing**, **fees**, **rebalancing state**, and **trading limits**. Use this when you need full pool details for UIs or risk checks, not just a path between two tokens.

***

## Routes

The SDK uses a **pre-computed route cache** by default for fast quote and swap lookups. You can also fetch routes fresh from the chain.

Find a **route** between two tokens (for quoting and swapping):

```typescript
const USDm = '0x765DE816845861e75A25fCA122bb6898B8B1282a'
const CELO = '0x471EcE3750Da237f93B8E339c536989b8978a438'

const route = await mento.routes.findRoute(USDm, CELO)
console.log(`Hops: ${route.path.length}`)
```

Get **all tradable routes** (from the pre-generated cache by default):

```typescript
const routes = await mento.routes.getRoutes()
```

Force a **fresh** route set from the blockchain:

```typescript
const freshRoutes = await mento.routes.getRoutes({ cached: false })
```

***

## Trading status

Check whether a pair is tradable (circuit breaker and trading limits):

```typescript
const isTradable = await mento.trading.isPairTradable(USDm, CELO)
```

For a specific pool, get full tradability status:

```typescript
const pools = await mento.pools.getPools()
const status = await mento.trading.getPoolTradabilityStatus(pools[0])

if (!status.circuitBreakerOk) {
  console.log('Trading suspended by circuit breaker')
} else if (!status.limitsOk) {
  console.log('Trading limit reached')
}
```

***

Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# Getting a Quote

This guide shows how to get a **swap quote** with the Mento SDK v3. Quotes use **FPMM pools** and the router (oracle-priced, fee-adjusted). You can quote “amount out” for a given “amount in,” or “amount in” for a desired “amount out.”

***

## Create the client

```typescript
import { Mento, ChainId } from '@mento-protocol/mento-sdk'
import { parseUnits, formatUnits } from 'viem'

const mento = await Mento.create(ChainId.CELO)
```

***

## Quote: amount out (given amount in)

You have an **amount in** and want to know how much of the other token you will receive:

```typescript
const USDm = '0x765DE816845861e75A25fCA122bb6898B8B1282a'
const CELO = '0x471EcE3750Da237f93B8E339c536989b8978a438'

const amountIn = parseUnits('100', 18)
const expectedOut = await mento.quotes.getAmountOut(USDm, CELO, amountIn)

console.log(`Expected out: ~${formatUnits(expectedOut, 18)} CELO for 100 USDm`)
```

Parameter order is **tokenIn, tokenOut, amountIn**. The SDK resolves the route (including multi-hop if needed) and returns the expected amount out.

***

## Quote: amount in (for exact amount out)

You want a specific **amount out** and need to know how much to send in:

```typescript
const amountOut = parseUnits('1', 18)
const amountInNeeded = await mento.quotes.getAmountIn(USDm, CELO, amountOut)

console.log(`Amount in needed: ~${formatUnits(amountInNeeded, 18)} USDm to get 1 CELO`)
```

Use this when the user specifies “I want exactly X of token B”; then use the returned amount (or a slightly higher value for slippage) as the input for building the swap.

***

## Trading status (optional)

Before quoting or swapping, you can check if the pair is tradable (circuit breaker and trading limits):

```typescript
const isTradable = await mento.trading.isPairTradable(USDm, CELO)
if (!isTradable) {
  console.log('Pair is not tradable (circuit breaker or limits)')
}
```

***

Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples). Next: [Initiating a swap](https://docs.mento.org/mento-v3/build/mento-sdk/guides/initiating-a-swap).


# Initiating a Swap

This guide shows how to **build and send a swap** with the Mento SDK v3. The SDK returns transaction parameters (including an approval transaction if needed); you submit them with any **viem** wallet client.

***

## Create the client and get a quote

Read-only operations (quotes, routes) only need a **public client**. For building swap transactions you still use `Mento.create`; the SDK returns **transaction parameters** that you send with your own wallet:

```typescript
import { Mento, ChainId, deadlineFromMinutes } from '@mento-protocol/mento-sdk'
import { parseUnits } from 'viem'

const mento = await Mento.create(ChainId.CELO)

const USDm = '0x765DE816845861e75A25fCA122bb6898B8B1282a'
const CELO = '0x471EcE3750Da237f93B8E339c536989b8978a438'
const amountIn = parseUnits('100', 18)

const expectedOut = await mento.quotes.getAmountOut(USDm, CELO, amountIn)
```

***

## Build swap transaction (approval + swap)

`buildSwapTransaction` returns both an **approval** (if the token needs an allowance) and the **swap** transaction. All public APIs use **object-based parameters**:

```typescript
const recipientAddress = '0x...'  // address that receives the output tokens
const ownerAddress = '0x...'     // address that holds tokenIn and signs the tx

const { approval, swap } = await mento.swap.buildSwapTransaction(
  USDm,
  CELO,
  amountIn,
  recipientAddress,
  ownerAddress,
  {
    slippageTolerance: 0.5,           // 0.5%
    deadline: deadlineFromMinutes(5),
  }
)
```

* **slippageTolerance** — percentage (e.g. `0.5` = 0.5%). The SDK caps this (e.g. at 50%) to reduce sandwich risk.
* **deadline** — use `deadlineFromMinutes(minutes)` or pass a Unix timestamp.

***

## Send with a viem wallet client

Execute the approval first (if present), then the swap:

```typescript
import { createWalletClient, custom } from 'viem'
import { celo } from 'viem/chains'

const walletClient = createWalletClient({
  chain: celo,
  transport: custom(window.ethereum),
})

if (approval) {
  await walletClient.sendTransaction(approval)
}
await walletClient.sendTransaction(swap.params)
```

The SDK returns **transaction request** objects; you are responsible for sending them and handling receipts (e.g. waiting for confirmation).

***

## Summary

1. **Quote** — `mento.quotes.getAmountOut(tokenIn, tokenOut, amountIn)` (or `getAmountIn` for exact amount out).
2. **Build** — `mento.swap.buildSwapTransaction(tokenIn, tokenOut, amountIn, recipient, owner, { slippageTolerance, deadline })`.
3. **Send** — If `approval` is set, send it first; then send `swap.params` with your viem wallet client.

Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# Liquidity Management

The Mento SDK v3 lets you **add liquidity**, **remove liquidity**, and **zap in/out** for **FPMM pools**. You get transaction parameters to send with any viem wallet client.

***

## Create the client

```typescript
import { Mento, ChainId, deadlineFromMinutes } from '@mento-protocol/mento-sdk'
import { parseUnits } from 'viem'

const mento = await Mento.create(ChainId.CELO)
```

***

## Add liquidity (two tokens)

Add both sides of a pool in the desired ratio. You need the pool address, token addresses, amounts, recipient, and owner:

```typescript
const addTx = await mento.liquidity.buildAddLiquidityTransaction(
  poolAddress,
  tokenA,
  amountA,
  tokenB,
  amountB,
  recipient,
  owner,
  { slippageTolerance: 0.5, deadline: deadlineFromMinutes(5) }
)
```

Send the returned transaction(s) with your viem wallet (approval first if present, then the add-liquidity tx).

***

## Zap in (single token → LP)

Deposit a **single token** and the SDK splits it into the two pool assets according to a **split ratio** (e.g. 0.5 = 50/50):

```typescript
const zapTx = await mento.liquidity.buildZapInTransaction(
  poolAddress,
  tokenIn,
  amountIn,
  0.5,   // split ratio (e.g. 50/50)
  recipient,
  owner,
  { slippageTolerance: 0.5, deadline: deadlineFromMinutes(5) }
)
```

Use this when users want to provide liquidity with one token only.

***

## Zap out (LP → single token)

Remove liquidity and receive a **single token** (the other side is swapped internally). Build the transaction with the pool, LP amount, desired output token, and options:

```typescript
const zapOutTx = await mento.liquidity.buildZapOutTransaction(
  poolAddress,
  lpAmount,
  tokenOut,
  recipient,
  owner,
  { slippageTolerance: 0.5, deadline: deadlineFromMinutes(5) }
)
```

***

## Remove liquidity (LP → two tokens)

Standard removal: burn LP and receive both pool tokens in proportion to the pool’s reserves. Use the SDK’s remove-liquidity builder (method name may be `buildRemoveLiquidityTransaction` or similar—check the package exports) with pool address, LP amount, recipient, owner, and slippage/deadline.

***

## LP token balance

Read a user’s LP token balance for a given pool:

```typescript
const balance = await mento.liquidity.getLPTokenBalance(poolAddress, owner)
```

Use this to show users their position size or to build remove/zap-out amounts.

***

## Summary

| Operation                   | Service method                                          |
| --------------------------- | ------------------------------------------------------- |
| Add liquidity (two tokens)  | `mento.liquidity.buildAddLiquidityTransaction(...)`     |
| Zap in (single token → LP)  | `mento.liquidity.buildZapInTransaction(...)`            |
| Zap out (LP → single token) | `mento.liquidity.buildZapOutTransaction(...)`           |
| LP balance                  | `mento.liquidity.getLPTokenBalance(poolAddress, owner)` |

All builders return transaction params (and optional approval) for you to send with a viem wallet. Use **slippage tolerance** and **deadline** to protect users. Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# Borrow (CDP)

The Mento SDK v3 supports **trove management** via the Mento CDP system (Liquity v2 fork): open, adjust, and close troves; repay debt; read trove data and system params; and **predict upfront fees** before opening.

In Mento CDPs, **USDm is the collateral**: you lock USDm and **borrow** another stable (e.g. **GBPm**). The SDK identifies each CDP system by the **debt token** (the stable you borrow). See [CDPs](https://docs.mento.org/mento-v3/build/smart-contracts/cdps) in Smart Contracts for an overview and the Liquity v2 docs for full mechanics.

***

## Create the client

```typescript
import { Mento, ChainId } from '@mento-protocol/mento-sdk'
import { parseUnits } from 'viem'

const mento = await Mento.create(ChainId.CELO)
```

***

## Open a trove

Lock **USDm** as collateral and borrow the debt stable (e.g. **GBPm**). Pass the **debt token** symbol (the stable you borrow) to identify the CDP system. You specify owner, collateral amount (USDm), debt amount (e.g. GBPm), interest rate, and max upfront fee:

```typescript
// Borrow GBPm against USDm collateral (debt token = GBPm)
const openTx = await mento.borrow.buildOpenTroveTransaction('GBPm', {
  owner: ownerAddress,
  ownerIndex: 0,
  collAmount: parseUnits('10000', 18),   // USDm collateral
  boldAmount: parseUnits('1000', 18),    // GBPm to borrow
  annualInterestRate: parseUnits('0.05', 18),   // 5%
  maxUpfrontFee: parseUnits('100', 18),
})
```

Send the returned transaction(s) with your viem wallet (approvals first if needed, then the open-trove tx).

***

## Predict upfront fee (before opening)

Estimate the upfront fee for a given borrow amount and interest rate so users can see cost before committing. Pass the **debt token** (e.g. GBPm) and the amount to borrow:

```typescript
const fee = await mento.borrow.predictOpenTroveUpfrontFee(
  'GBPm',
  parseUnits('1000', 18),
  parseUnits('0.05', 18)
)
```

***

## Get trove data

Read a specific trove’s state (collateral, debt, etc.). Pass the debt token (e.g. GBPm):

```typescript
const trove = await mento.borrow.getTroveData('GBPm', troveId)
```

***

## Get system parameters

Read CDP system params (e.g. min/max collateral, rates, caps) for a CDP system. Pass the debt token (e.g. GBPm):

```typescript
const params = await mento.borrow.getSystemParams('GBPm')
```

Use this to validate user inputs or display protocol limits in your UI.

***

## Adjust and close troves

The SDK also supports **adjusting** an existing trove (add/remove collateral, borrow more, repay) and **closing** a trove. Use the corresponding `mento.borrow` methods (e.g. `buildAdjustTroveTransaction`, `buildCloseTroveTransaction`—check the package exports for exact names) with the same pattern: they return transaction params you send with your viem wallet.

***

## Summary

| Operation              | Service method                                                                                   |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| Open trove             | `mento.borrow.buildOpenTroveTransaction('GBPm', { ... })` — debt token = what you borrow         |
| Predict upfront fee    | `mento.borrow.predictOpenTroveUpfrontFee('GBPm', boldAmount, rate)`                              |
| Trove data             | `mento.borrow.getTroveData('GBPm', troveId)`                                                     |
| System params          | `mento.borrow.getSystemParams('GBPm')`                                                           |
| Adjust / close / repay | See `mento.borrow` exports for `buildAdjustTroveTransaction`, `buildCloseTroveTransaction`, etc. |

All builders return transaction (and optional approval) params; you send them with a viem wallet. Runnable examples: [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples).


# 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)


# FPMM

The **FPMM** contract is the core pool of Mento V3. Each instance holds two ERC-20 tokens (reserves), executes swaps at the **oracle rate** (minus fees), and allows **rebalancing** only by allowlisted liquidity strategies when the reserve-implied price deviates from the oracle by at least a configured threshold.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/swap/FPMM.sol`

***

## Interacting with the pool (code examples)

The snippets below show how to use the FPMM from Solidity. You need the **pool address** (from the factory or deployments) and the **token addresses** (pool uses sorted order: `token0` < `token1`). For most app flows, the [Router](https://docs.mento.org/mento-v3/build/smart-contracts/router) or the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) simplify quoting and execution.

### Finding the pool

Get the pool for a token pair from the factory (tokens are sorted by address):

```solidity
IFPMMFactory factory = IFPMMFactory(factoryAddress);
(address token0, address token1) = factory.sortTokens(usdc, usdm);
address pool = factory.getPool(token0, token1);
// pool == address(0) if not deployed yet
```

### Quoting a swap

Get the expected amount of output token for a given amount in. The quote uses the **oracle rate** minus fees. Reverts if the oracle is invalid (e.g. market closed, breaker tripped, stale).

```solidity
IFPMM pool = IFPMM(poolAddress);
uint256 amountIn = 1_000_000; // 1 USDC (6 decimals)
uint256 amountOut = pool.getAmountOut(amountIn, usdc);
// amountOut is in output token decimals (e.g. USDm)
```

### Executing a swap (via Router)

The Router handles token transfers and calls the pool’s `swap` with the correct output amount. **Approve the router** to spend `amountIn` of the input token, then:

```solidity
IRouter router = IRouter(routerAddress);
IRouter.Route[] memory routes = new IRouter.Route[](1);
routes[0] = IRouter.Route({ from: usdc, to: usdm, factory: address(0) });

uint256[] memory amounts = router.swapExactTokensForTokens(
    amountIn,
    amountOutMin,   // slippage: minimum amount out (e.g. amountOut * 99 / 100)
    routes,
    msg.sender,
    block.timestamp + 300
);
// amounts[0] == amountIn, amounts[1] == actual amount out
```

### Executing a swap (direct pool call)

The pool’s `swap(amount0Out, amount1Out, to, data)` is **output-specified**. The caller must ensure the pool receives the **input** tokens (e.g. by implementing `IFPMMCallee` and passing `data` so the pool calls back into your contract, which then transfers the input tokens). For simple EOA flows, use the Router instead.

### Checking rebalance state

Useful for keepers or UIs to see if the pool is eligible for rebalance and the current deviation:

```solidity
IFPMM pool = IFPMM(poolAddress);
(
    uint256 oraclePriceNumerator,
    uint256 oraclePriceDenominator,
    uint256 reservePriceNumerator,
    uint256 reservePriceDenominator,
    bool reservePriceAboveOraclePrice,
    uint16 rebalanceThreshold,
    uint256 priceDifference
) = pool.getRebalancingState();
// Rebalance is allowed only when priceDifference >= rebalanceThreshold
```

### Adding and removing liquidity

Mint: transfer **both** tokens to the pool in the **current reserve ratio**, then call `mint(to)`. Burn: transfer LP tokens to the pool, then call `burn(to)`.

```solidity
// Mint: ensure pool has received token0 and token1 in correct ratio
IERC20(pool.token0()).transfer(pool, amount0);
IERC20(pool.token1()).transfer(pool, amount1);
uint256 liquidity = pool.mint(msg.sender);

// Burn: transfer LP tokens to pool first
IERC20(pool).transfer(pool, liquidity);
(uint256 amount0, uint256 amount1) = pool.burn(msg.sender);
```

***

## Invariants (design)

The contract enforces:

1. **Swap** does not decrease the total value of the pool (value at oracle, after crediting fees).
2. **Rebalance** reduces the price difference and keeps the same direction (above oracle stays above, below stays below).
3. **Rebalance** keeps the post-rebalance price difference at or above the configured threshold (no overshoot past the band).
4. **Rebalance** does not decrease reserve value more than the rebalance incentive (minimum repayment / incentive cap).

***

## State (FPMMStorage)

| Field                                                | Meaning                                                                                                                           |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `token0`, `token1`                                   | Pool tokens, ordered by address (token0 < token1).                                                                                |
| `decimals0`, `decimals1`                             | Scaling: `10^decimals` for each token (capped at 18).                                                                             |
| `reserve0`, `reserve1`                               | Last known reserve balances (updated after swap/mint/burn/rebalance).                                                             |
| `oracleAdapter`                                      | Contract used for the oracle rate; pool calls `getFXRateIfValid(referenceRateFeedID)`.                                            |
| `referenceRateFeedID`                                | Rate feed ID passed to the oracle adapter (e.g. address derived from pair identifier).                                            |
| `invertRateFeed`                                     | If true, the adapter rate is inverted (denominator/numerator) for quoting.                                                        |
| `lpFee`, `protocolFee`                               | Swap fees in basis points (BPS, denominator 10,000). Combined max 200 (2%).                                                       |
| `protocolFeeRecipient`                               | Receives protocol fee.                                                                                                            |
| `feeSetter`                                          | Address (with owner) allowed to set fees.                                                                                         |
| `rebalanceIncentive`                                 | Max incentive in BPS (max 100 = 1%) for rebalance; enforces minimum token-in.                                                     |
| `rebalanceThresholdAbove`, `rebalanceThresholdBelow` | Min price difference (BPS) to allow rebalance when reserve price > oracle or < oracle. Above max 10,000 bps; below max 5,000 bps. |
| `liquidityStrategy[addr]`                            | If true, `addr` may call `rebalance`.                                                                                             |
| `tradingLimits[token]`                               | Per-token TradingLimitsV2 config and state (5-min and 1-day net-flow caps).                                                       |

***

## Initialization

`initialize(token0, token1, oracleAdapter, referenceRateFeedID, invertRateFeed, initialOwner, params)` sets tokens, oracle adapter, rate feed ID, invert flag, owner, and `FPMMParams` (fees, fee recipient, fee setter, rebalance incentive, rebalance thresholds). Tokens are **not** re-sorted in `initialize`; the factory passes them already sorted. Token decimals must be ≤ 18.

***

## Oracle rate

The pool uses **oracle rate** for all swap quotes and value checks. It does **not** use a reserve-based curve.

* **Source:** `_getRateFeed()` calls `oracleAdapter.getFXRateIfValid(referenceRateFeedID)`. If the adapter reverts (e.g. `FXMarketClosed`, `TradingSuspended`, `NoRecentRate`), the pool reverts.
* **Invert:** If `invertRateFeed` is true, the rate is swapped to (denominator, numerator) so that the pool’s quote direction matches the intended token pair (e.g. token1/token0).

***

## Swap

* **Quote:** `getAmountOut(amountIn, tokenIn)` returns the amount of the other token at the **oracle rate** minus combined fee:\
  `rate × amountIn × (BPS - lpFee - protocolFee) / BPS`, with decimal scaling.\
  Reverts if the adapter’s `getFXRateIfValid` fails.
* **Execution:** `swap(amount0Out, amount1Out, to, data)` is **output-specified**: exactly one of `amount0Out` or `amount1Out` must be > 0. The pool transfers the output to `to`, then, if `data.length > 0`, calls `IFPMMCallee(to).hook(...)` so the caller can supply the input tokens. The pool infers `amount0In` and `amount1In` from balance deltas.
* **Checks:**
  1. **Value protection:** `_swapCheck`: reserve value at oracle (in token1, 1e18-scaled) after the swap must be ≥ initial value + fee value; otherwise `ReserveValueDecreased`.
  2. **TradingLimitsV2:** After the swap, `_applyTradingLimits` is called for each token (fee is deducted from inflow before net flow). If a limit is exceeded, the swap reverts.
* **Fees:** Protocol fee is transferred to `protocolFeeRecipient`; LP fee remains in the pool (increases reserve value). Reserves are synced with `_update()`.

***

## Mint and burn

* **Mint:** `mint(to)` — Caller must have transferred token0 and token1 to the pool in the **current reserve ratio**. Liquidity is computed: first mint `sqrt(amount0*amount1) - MINIMUM_LIQUIDITY` (with `MINIMUM_LIQUIDITY` locked at `address(1)`); subsequent mints proportional to reserves. Shares are minted to `to`.
* **Burn:** `burn(to)` — Caller must have transferred LP tokens to the pool. Burn is pro-rata: amounts out = (liquidity / totalSupply) × reserves; tokens sent to `to`, reserves updated.

***

## Rebalance

* **Entrypoint:** `rebalance(amount0Out, amount1Out, data)`. Only callable by an address with `liquidityStrategy[msg.sender] == true`.
* **Preconditions:**
  * Exactly one of `amount0Out`, `amount1Out` > 0.
  * Reserve price deviation from oracle ≥ threshold (above or below depending on direction).
  * Pool has sufficient liquidity for the requested output.
* **Flow:**
  1. Pool transfers the requested token(s) to `msg.sender` (the strategy).
  2. Pool calls `ILiquidityStrategy(msg.sender).onRebalance(msg.sender, amount0Out, amount1Out, data)`.
  3. Strategy must send back the **other** token (and optionally keep an incentive within the cap).
  4. Pool infers `amount0In`, `amount1In` from balance deltas.
  5. `_rebalanceCheck(swapData)` enforces: price difference **improves**, **direction preserved**, no overshoot (new difference ≥ threshold), and minimum repayment (incentive cap).
* **Rebalancing state:** `getRebalancingState()` returns oracle price, reserve price, whether reserve price is above oracle, the applicable threshold, and current price difference in BPS. Off-chain or strategy logic can use this to decide rebalance size.

***

## TradingLimitsV2

* **Config:** `configureTradingLimit(token, config)` (owner) sets the TradingLimitsV2 config for that token (e.g. 5-min and 1-day limits).
* **Application:** After every swap, `_applyTradingLimits(token0, ...)` and `_applyTradingLimits(token1, ...)` update state and revert if a limit is exceeded. Fee is deducted from inflow before net flow.
* **View:** `getTradingLimits(token)` returns config and state for the token.

***

## Admin

| Function                                                          | Restriction     | Effect                                 |
| ----------------------------------------------------------------- | --------------- | -------------------------------------- |
| `setLPFee`, `setProtocolFee`                                      | `onlyFeeSetter` | Combined with the other fee ≤ 200 bps. |
| `setProtocolFeeRecipient`                                         | owner           |                                        |
| `setFeeSetter`                                                    | owner           |                                        |
| `setRebalanceIncentive`                                           | `onlyFeeSetter` | Max 100 bps.                           |
| `setRebalanceThresholds(above, below)`                            | owner           | Above ≤ 10,000 bps; below ≤ 5,000 bps. |
| `setOracleAdapter`, `setReferenceRateFeedID`, `setInvertRateFeed` | owner           |                                        |
| `setLiquidityStrategy(addr, allowed)`                             | owner           | Allowlist for `rebalance`.             |
| `configureTradingLimit(token, config)`                            | owner           | TradingLimitsV2 per token.             |

***

## Key errors

* `ReserveValueDecreased` — Swap would decrease pool value at oracle after fees.
* `NotLiquidityStrategy` — Caller of `rebalance` not allowlisted.
* `PriceDifferenceTooSmall` — Rebalance called but deviation below threshold.
* `PriceDifferenceNotImproved`, `PriceDifferenceMovedInWrongDirection`, `PriceDifferenceMovedTooFarFromThresholds` — Rebalance acceptance failed.
* `InsufficientAmount0In` / `InsufficientAmount1In` — Strategy did not return enough of the other token (incentive cap).
* `TradingSuspended`, `NoRecentRate`, `FXMarketClosed` — From oracle adapter when rate is invalid.

***

## See also

* [FPMMFactory](https://docs.mento.org/mento-v3/build/smart-contracts/fpmmfactory) — Deployment and default params.
* [OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter) — How the pool gets the rate.
* [TradingLimitsV2](https://docs.mento.org/mento-v3/build/smart-contracts/tradinglimits) — Net-flow caps.
* [Liquidity strategies](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies) — Who can call rebalance and how.
* [Dive Deeper: FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — Design and invariant.


# FPMMFactory

**FPMMFactory** deploys and tracks FPMM pool proxies. Each pool is created via a **proxy** (FPMMProxy) pointing to a registered implementation. The factory stores default parameters (fees, rebalance incentive, thresholds) and enforces caps on deployment defaults; individual pools can later be reconfigured within pool-level limits.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/swap/FPMMFactory.sol`

***

## Interacting with the factory (code examples)

### Finding a pool for a token pair

Tokens are ordered by address. Use `sortTokens` so you pass the pair in the order the factory expects:

```solidity
IFPMMFactory factory = IFPMMFactory(factoryAddress);

(address token0, address token1) = factory.sortTokens(tokenA, tokenB);
address pool = factory.getPool(token0, token1);

if (pool != address(0)) {
    // Pool exists; use it for getAmountOut, swap, etc.
}
```

### Precomputing the pool address (before deployment)

If the pool is not deployed yet, you can compute the proxy address that will be used when the owner deploys it. Useful for integrators that need to show a “future” pool address or for CREATE2-style flows:

```solidity
address poolOrFuture = factory.getOrPrecomputeProxyAddress(token0, token1);
// If pool exists, returns deployed address; else returns precomputed proxy address
```

### Listing all deployed pools

```solidity
address[] memory pools = factory.deployedFPMMAddresses();
for (uint256 i = 0; i < pools.length; i++) {
    address pool = pools[i];
    // Use pool with IFPMM(pool).tokens(), getAmountOut, etc.
}
```

***

## State

| Field                              | Meaning                                                                                                    |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `oracleAdapter`                    | Default oracle adapter address used when deploying a pool (can be overridden per deployment).              |
| `proxyAdmin`                       | Admin for the FPMM proxy (upgrade authority).                                                              |
| `deployedFPMMs[token0][token1]`    | Address of the deployed pool for the token pair (tokens sorted by address).                                |
| `isPool[pool]`                     | True if the address is a pool deployed by this factory.                                                    |
| `deployedFPMMAddresses[]`          | List of all deployed pool addresses.                                                                       |
| `isRegisteredImplementation[impl]` | True if `impl` is an allowed FPMM implementation for deployment.                                           |
| `registeredImplementations[]`      | List of registered implementations.                                                                        |
| `defaultParams`                    | Default `FPMMParams` (fees, rebalance incentive, thresholds) applied when deploying with factory defaults. |

***

## Token order

* **sortTokens(tokenA, tokenB)** — Returns `(token0, token1)` with `token0 < token1` by address. Reverts if `tokenA == tokenB` or zero. All pool lookups use this order.
* **getPool(token0, token1)** — Returns the pool address for that pair. Caller must pass tokens in the same order as `sortTokens` (or use `getPool` with sorted pair).

***

## Deployment

* **deployFPMM(...)** — `onlyOwner`. Parameters: `fpmmImplementation`, `customOracleAdapter`, `customProxyAdmin`, `customOwner`, `token0`, `token1`, `referenceRateFeedID`, `invertRateFeed`, `customParams`.
  * Tokens are sorted; pair must not already exist.
  * Deploys an **FPMMProxy** (CreateX) with the given implementation, then initializes the proxy with the provided oracle adapter, rate feed ID, invert flag, owner, and params.
  * Registers the new pool in `deployedFPMMs` and `isPool`.
* **getOrPrecomputeProxyAddress(token0, token1)** — Returns the deployed pool address if it exists, otherwise the **precomputed** CreateX address for that pair (so integrators can compute the pool address before deployment).

***

## Default params and caps

`defaultParams` is an `IFPMM.FPMMParams` struct. When setting defaults via **setDefaultParams**:

* `protocolFee + lpFee` ≤ **200** (2% combined).
* `protocolFeeRecipient != address(0)`.
* `rebalanceIncentive` ≤ **100** (1%).
* `rebalanceThresholdAbove` ≤ **10,000** bps.
* `rebalanceThresholdBelow` ≤ **5,000** bps.

Pool-level setters (on FPMM) allow the same threshold caps; the factory only restricts **default** values at deployment.

***

## Admin

| Function                                    | Effect                                                                                 |
| ------------------------------------------- | -------------------------------------------------------------------------------------- |
| `setOracleAdapter(addr)`                    | Set default oracle adapter.                                                            |
| `setProxyAdmin(addr)`                       | Set proxy admin.                                                                       |
| `setDefaultParams(params)`                  | Set default FPMM params (subject to caps above).                                       |
| `registerFPMMImplementation(impl)`          | Allow an implementation for deployment.                                                |
| `unregisterFPMMImplementation(impl, index)` | Remove implementation; `index` must match its position in `registeredImplementations`. |

***

## See also

* [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) — Pool contract.
* [Deployments](https://docs.mento.org/mento-v3/build/deployments) — Addresses and verification.


# OracleAdapter

The **OracleAdapter** is the single interface the FPMM pool uses to obtain the swap rate. It returns a rate only when it is **valid**; otherwise it reverts. Validity combines: **recency** of the feed, **trading mode** from BreakerBox (e.g. trading suspended when a breaker has tripped), and, for FX pairs, **FX market hours**. The pool calls `getFXRateIfValid(rateFeedID)` on every quote and swap; if the adapter reverts, the swap path reverts.

This matters for fiat FX feeds because the reference markets are not 24/7: Chainlink FX rates typically stop updating on weekends and certain holidays, and Mento mirrors that by rejecting FX-priced swaps when the configured market-hours breaker says the market is closed.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/oracles/OracleAdapter.sol`

***

## Using the OracleAdapter (code examples)

Most integrations **do not** call the OracleAdapter directly: the [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) pool calls it for every `getAmountOut` and `swap`. Use the adapter directly when you need to **check rate validity** (e.g. before showing a quote in a UI) or **read the current rate** for off-chain logic.

### Getting a valid rate (for swaps / quoting)

If you are implementing custom swap logic and need the same rate the pool would use, call the same method the pool uses. Reverts if FX market is closed, trading is suspended, or the rate is stale:

```solidity
IOracleAdapter adapter = IOracleAdapter(adapterAddress);
address rateFeedID = referenceRateFeedID; // e.g. pool’s referenceRateFeedID

(uint256 numerator, uint256 denominator) = adapter.getFXRateIfValid(rateFeedID);
// Rate = numerator / denominator (e.g. token1 per token0, 1e18 scale)
```

### Checking validity without using the rate

Useful to decide whether to show “trading available” or “market closed / suspended”:

```solidity
try adapter.ensureRateValid(rateFeedID) {
    // Rate is valid; safe to quote/swap
} catch {
    // TradingSuspended, NoRecentRate, or (for getFXRateIfValid) FXMarketClosed
}
```

### Inspecting rate and status (no revert)

Get the raw rate and flags without reverting. Use for dashboards or conditional logic:

```solidity
IOracleAdapter.RateInfo memory info = adapter.getRate(rateFeedID);
// info.numerator, info.denominator
// info.tradingMode  == 0 means bidirectional (trading allowed)
// info.isRecent     == true if within report expiry
// info.isFXMarketOpen
```

***

## State

| Field                   | Meaning                                                                                                                |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `sortedOracles`         | Source contract from which the adapter reads the current Chainlink-backed rate and timestamp for a given `rateFeedID`. |
| `breakerBox`            | Provides **trading mode** per rate feed (e.g. bidirectional vs suspended).                                             |
| `marketHoursBreaker`    | Provides **FX market open/closed** for the current block timestamp.                                                    |
| `l2SequencerUptimeFeed` | Optional Chainlink L2 sequencer feed; if set, can be used to gate on sequencer uptime.                                 |

***

## Rate feed ID

Each price feed is identified by a **rateFeedID** (an address). For CELO/cStable the ID is the stable token address. For other pairs (e.g. USDC/USD, EUR/USD) the ID is typically derived as `address(uint160(uint256(keccak256(abi.encodePacked(asset0, asset1)))))`. Relayed Chainlink feeds often use a prefix (e.g. `"relayed:PHPUSD"`). The FPMM pool stores a `referenceRateFeedID` and passes it to the adapter.

***

## Main entrypoints (for the pool)

* **getFXRateIfValid(rateFeedID)** — Returns `(numerator, denominator)` only if:

  1. **FX market is open** (`marketHoursBreaker.isFXMarketOpen(block.timestamp)`).
  2. **Trading mode** for this feed is bidirectional (`breakerBox.getRateFeedTradingMode(rateFeedID) == TRADING_MODE_BIDIRECTIONAL`).
  3. **Recent rate:** `medianTimestamp(rateFeedID) >= block.timestamp - reportExpiry` (report expiry comes from `sortedOracles.getTokenReportExpirySeconds(rateFeedID)`).\
     Otherwise reverts with `FXMarketClosed`, `TradingSuspended`, or `NoRecentRate`.

  In the current `MarketHoursBreaker`, FX is treated as closed from **Friday 21:00 UTC** until **Sunday 23:00 UTC**, on **Dec 25** and **Jan 1**, and after **22:00 UTC** on **Dec 24** and **Dec 31**.
* **getRateIfValid(rateFeedID)** — Same as above but **does not** check FX market hours. Used when market-hours gating is not required.
* **ensureRateValid(rateFeedID)** — View that reverts if the rate would not be valid (trading mode or recency); does not return the rate. Useful for pre-checks.

***

## Rate source

* **getRate(rateFeedID)** — Returns a **RateInfo** struct: `(numerator, denominator, tradingMode, isRecent, isFXMarketOpen)` without reverting. The actual rate comes from `sortedOracles.medianRate(rateFeedID)`. In current Mento V3 deployments, that path is Chainlink-backed. The adapter normalizes the denominator (SortedOracles uses 1e24; the adapter exposes 1e18 after scaling).\
  So the pool always gets the rate via the **validity-gated** path (`getFXRateIfValid`), not the raw median.

***

## L2 sequencer

* **isL2SequencerUp(since)** — If `l2SequencerUptimeFeed` is set, returns whether the sequencer has been up for at least `since` seconds (and answer is 0). If the feed is not set, returns true. Used on L2s to avoid using stale rates right after sequencer recovery.

***

## Errors

* `FXMarketClosed` — `getFXRateIfValid` called when FX market hours say closed.
* `TradingSuspended` — BreakerBox trading mode is not bidirectional for this feed.
* `NoRecentRate` — Median timestamp is older than `block.timestamp - reportExpiry`.
* `InvalidRate` — Median rate numerator or denominator is zero.

***

## See also

* [BreakerBox](https://docs.mento.org/mento-v3/build/smart-contracts/breakerbox) — Circuit breakers and trading mode.
* [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) — Pool calls `getFXRateIfValid`.
* [Dive Deeper: Oracles & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers).


# Router

The **Router** provides a convenience layer for **quoting** and **executing** swaps across Mento FPMM pools. It uses a **FactoryRegistry** to resolve which factory owns a given pair and supports **multihop** routes (e.g. A → B → C) by chaining `getAmountOut` on each pool. The router is a fork of Aerodrome/Velodrome’s Router, adapted for Mento.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/swap/router/Router.sol`

***

## Interacting with the Router (code examples)

Use the Router when you want a single contract to handle token transfers and pool calls. **Approve the router** to spend the input token(s) before calling swap. For discovery and quoting from off-chain or JS, the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) is often simpler.

### Getting the pool for a pair

```solidity
IRouter router = IRouter(routerAddress);
address pool = router.poolFor(tokenA, tokenB, address(0));
// address(0) for factory means use router.defaultFactory()
```

### Quoting a single-hop swap

```solidity
IRouter.Route[] memory routes = new IRouter.Route[](1);
routes[0] = IRouter.Route({
    from: usdc,      // token in
    to: usdm,        // token out
    factory: address(0)
});

uint256[] memory amounts = router.getAmountsOut(amountIn, routes);
// amounts[0] == amountIn, amounts[1] == expected amount out (at oracle rate minus fee)
```

### Quoting a multihop swap

Chain two or more pools. Each step’s output is the next step’s input:

```solidity
IRouter.Route[] memory routes = new IRouter.Route[](2);
routes[0] = IRouter.Route({ from: tokenA, to: tokenB, factory: address(0) });
routes[1] = IRouter.Route({ from: tokenB, to: tokenC, factory: address(0) });

uint256[] memory amounts = router.getAmountsOut(amountIn, routes);
// amounts[0] = amountIn, amounts[1] = amount after first hop, amounts[2] = final amount out
```

### Executing a swap (exact input)

User sends `amountIn` of the first token and receives at least `amountOutMin` of the last token (slippage protection). Reverts if the pool oracle is invalid or trading limits are hit.

```solidity
IERC20(usdc).approve(routerAddress, amountIn);

uint256[] memory amounts = router.swapExactTokensForTokens(
    amountIn,
    amountOutMin,   // e.g. (expectedOut * 99) / 100
    routes,
    msg.sender,     // recipient of output tokens
    block.timestamp + 300  // deadline
);
```

### Adding liquidity

Quote first with `quoteAddLiquidity`, then add. You must approve the router for both tokens:

```solidity
(uint256 amountA, uint256 amountB, uint256 liquidity) = router.quoteAddLiquidity(
    tokenA, tokenB, address(0), amountADesired, amountBDesired
);

IERC20(tokenA).approve(routerAddress, amountA);
IERC20(tokenB).approve(routerAddress, amountB);

(,, liquidity) = router.addLiquidity(
    tokenA, tokenB,
    amountADesired, amountBDesired,
    amountAMin, amountBMin,
    msg.sender,
    block.timestamp + 300
);
```

***

## Immutable configuration

* **factoryRegistry** — Contract that maps (tokenA, tokenB) or factory to an approved pool factory. Used to ensure the pool comes from an approved factory.
* **defaultFactory** — Factory used when a route does not specify a custom factory (e.g. the Mento FPMMFactory).

***

## Token order

* **sortTokens(tokenA, tokenB)** — Returns `(token0, token1)` with `token0 < token1` by address. Reverts if same address or zero. Matches the FPMM pool’s token order.

***

## Pool resolution

* **poolFor(tokenA, tokenB, factory)** — Returns the pool address for the pair. If `factory` is `address(0)`, uses `defaultFactory`. Reverts if the factory is not approved in `factoryRegistry` (`PoolFactoryDoesNotExist`). The pool address is obtained via `IRPoolFactory(factory).getOrPrecomputeProxyAddress(tokenA, tokenB)`.

***

## Quoting

* **getAmountsOut(amountIn, routes)** — Given an initial `amountIn` and an array of **Route** structs (each has `from`, `to`, and optional `factory`), returns an array of amounts: `amounts[0] = amountIn`, then for each route `amounts[i+1] = pool.getAmountOut(amounts[i], routes[i].from)`. So each step uses the **oracle-priced** quote from the FPMM. Reverts if the path is invalid or a pool does not exist.
* **getReserves(tokenA, tokenB, factory)** — Returns reserve amounts for the pair (in the order tokenA, tokenB) from the pool’s `getReserves()`.

***

## Swap execution

The router’s swap functions (e.g. `swapExactTokensForTokens`, `swapTokensForExactTokens`, and variants with deadline) encode the user’s intent and then:

1. Resolve the pool(s) via `poolFor` (and optionally multihop routes).
2. Transfer tokens from the user to the pool (or to the router then to the pool).
3. Call the pool’s **swap(amount0Out, amount1Out, to, data)** with output amounts. For a single-hop swap, the output amount is computed from `getAmountOut`; the user must have approved the router (or the pool) to pull the input amount.
4. Enforce a **deadline** (e.g. `block.timestamp <= deadline`) when the function uses the `ensure(deadline)` modifier.

Exact signatures and encoding depend on the router interface (e.g. `IRouter`). The important point for integrators: the pool’s **swap** is output-specified and uses a callback only when `data.length > 0`; the router typically uses the callback to supply the input tokens in the same transaction.

***

## Add / remove liquidity

* **quoteAddLiquidity(...)** — View that returns suggested `amountA`, `amountB`, and `liquidity` for adding liquidity to a pool (at current reserve ratio for existing pools, or arbitrary for new pools).
* **addLiquidity**, **removeLiquidity** (and variants) — Execute mint or burn on the pool after transferring tokens or LP shares. Exact parameters (e.g. min amounts, deadline) are on the interface.

***

## See also

* [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) — Pool’s `getAmountOut` and `swap`.
* [FPMMFactory](https://docs.mento.org/mento-v3/build/smart-contracts/fpmmfactory) — `getPool` and `getOrPrecomputeProxyAddress`.
* [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) — JS/TS integration and quoting.


# Liquidity strategies

In Mento V3, **rebalancing** is performed only by **allowlisted** contracts called **liquidity strategies**. The FPMM pool does not pull liquidity itself; it transfers one token to the strategy and calls back **onRebalance**; the strategy must return the other token (within the pool’s incentive cap). Strategies are permissionless to **trigger** (anyone can call `strategy.rebalance(pool)`), but subject to a **per-pool cooldown** and the pool’s **rebalance threshold** (deviation from oracle). Three concrete implementations exist: **ReserveLiquidityStrategy** (Reserve-backed stables), **CDPLiquidityStrategy** (CDP-backed stables; Mento’s Liquity v2 fork), and **OpenLiquidityStrategy** (caller-supplied liquidity via ERC20 transfers; no reserve or CDP).

**Contracts:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/liquidityStrategies/LiquidityStrategy.sol`, `ReserveLiquidityStrategy.sol`, `CDPLiquidityStrategy.sol`, `OpenLiquidityStrategy.sol`

***

## Interacting with liquidity strategies (code examples)

Strategies are typically triggered by **keepers** or off-chain bots when a pool is rebalanceable. Discovery (which pools a strategy serves) is usually done off-chain or via the [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk). The snippets below show how to call the strategy from Solidity.

### Checking if a pool is registered

```solidity
ILiquidityStrategy strategy = ILiquidityStrategy(strategyAddress);
bool registered = strategy.isPoolRegistered(poolAddress);
```

### Listing pools served by a strategy

```solidity
address[] memory pools = strategy.getPools();
```

### Previewing the rebalance action (view)

Use this to see whether a rebalance would run and what direction/amounts the strategy would use. Does not execute.

```solidity
(
    LiquidityStrategyTypes.Context memory ctx,
    LiquidityStrategyTypes.Action memory action
) = strategy.determineAction(poolAddress);

// action.direction  => Expand or Contract
// action.amount0Out, action.amount1Out => what the strategy would request from the pool
// ctx.priceDifference, ctx.rebalanceThreshold => eligibility
```

### Triggering a rebalance

Anyone can call this. The call will revert if the pool is not registered, cooldown has not elapsed, or the pool’s price difference is below threshold. The strategy then calls `pool.rebalance(...)` and implements `onRebalance` to source/sink the other token.

```solidity
strategy.rebalance(poolAddress);
// Reverts with LS_COOLDOWN_ACTIVE or LS_POOL_NOT_REBALANCEABLE if not eligible
```

***

## Base: LiquidityStrategy

The base contract maintains **per-pool configuration** and implements the **rebalance(pool)** entrypoint and the **onRebalance** callback interface expected by the FPMM.

### Pool configuration (PoolConfig)

For each registered pool, the strategy stores:

* **isToken0Debt** — Whether token0 is the “debt” token (the one the strategy sources for **expansion**: pool price above oracle) and token1 is “collateral,” or the reverse. This determines which token the strategy gives to the pool and which it takes.
* **lastRebalance** — Timestamp of the last rebalance for this pool.
* **rebalanceCooldown** — Minimum seconds between rebalances (enforced in `rebalance(pool)`).
* **protocolFeeRecipient** — Receives the protocol share of the rebalance incentive.
* **liquiditySourceIncentiveExpansion**, **protocolIncentiveExpansion** — Incentive split (expansion: strategy gives debt token to pool, takes collateral).
* **liquiditySourceIncentiveContraction**, **protocolIncentiveContraction** — Incentive split (contraction: strategy gives collateral to pool, takes debt token).

Incentives are in 18-decimal fixed-point (denominator 1e18). The **combined** incentive per direction must stay within the pool’s **rebalanceIncentive** cap (pool enforces minimum token-in via `_rebalanceCheck`).

### Rebalance flow

1. **Anyone** calls `LiquidityStrategy.rebalance(pool)`.
2. Strategy checks **cooldown** (`block.timestamp >= lastRebalance + rebalanceCooldown`); else `LS_COOLDOWN_ACTIVE`.
3. Strategy builds a **context** (oracle rate, pool state, thresholds, pool config) and computes the desired **action**: direction (expand/contract) and **target boundary** (e.g. move reserve-implied price to the threshold boundary, not 50/50). Logic uses the pool’s `getRebalancingState()` and the configured thresholds.
4. Strategy calls **IFPMM(pool).rebalance(amount0Out, amount1Out, data)**. So the **strategy** is the only caller of `pool.rebalance`; the pool’s allowlist must include the strategy’s address.
5. Pool transfers one token out to the strategy and calls **strategy.onRebalance(strategy, amount0Out, amount1Out, data)**.
6. Strategy’s **onRebalance** validates that the caller is the pool and that the sender is the strategy itself (transient storage / reentrancy guard). Then it calls an internal **\_handleCallback** (implemented per strategy):
   * **ReserveLiquidityStrategy:** Sources or sinks the other token via the **Reserve** (mint/burn stable, move collateral).
   * **CDPLiquidityStrategy:** Sources debt token from the **Stability Pool** (expansion) or returns debt and receives collateral via **redemptions** (contraction).
   * **OpenLiquidityStrategy:** Pulls the required token from the **rebalancer** (the address that called `rebalance`) via `transferFrom`; no reserve or CDP.
7. Strategy transfers the required token **to the pool** so that the pool’s balance delta satisfies the minimum repayment (incentive cap). Strategy may keep the remainder as protocol and liquidity-source incentive.
8. Pool’s **\_rebalanceCheck** runs: price difference improved, direction preserved, no overshoot, minimum amount in satisfied.

### Target boundary

The base strategy does **not** target 50/50 reserve value; it targets the **threshold boundary** (e.g. if reserve price is above oracle, it rebalances until the reserve-implied price is at `oracle × (1 + thresholdAbove)` in value terms). This avoids overshooting and keeps the pool within the allowed band. See `LiquidityStrategy.sol` (e.g. `targetNumerator = oracleNum * (1 + threshold)` for the above-oracle case).

### Fee composition

Incentives are **combined** from liquidity-source and protocol components (e.g. `combineFees` in LiquidityStrategyTypes). The composed fee is used to compute how much of the other token the strategy must return (minimum) and how much it can keep. Pool enforces only the **cap** (minimum in); strategy splits the rest.

***

## ReserveLiquidityStrategy

* **Backing:** Uses the **Reserve** contract. For Reserve-backed Mento stables (e.g. USDm, EURm), the Reserve holds the collateral (e.g. USDC, EUROC); the strategy **mints** the Mento stable to give to the pool (expansion) or **burns** it when taking it from the pool (contraction) and moves collateral accordingly.
* **Contraction clamp:** `_clampContraction` can limit how much the strategy will take from the pool in a single rebalance (e.g. to avoid over-burning or to respect Reserve capacity). Callback flow and incentive handling: `ReserveLiquidityStrategy.sol` (e.g. L125–L169).
* **Use case:** Pools that pair USDm or EURm with an external stable (e.g. USDC/USDm, axlEUROC/EURm).

***

## CDPLiquidityStrategy

* **Backing:** Uses the Mento **Liquity v2** fork (CDP system). Expansion: strategy pulls **debt** token (e.g. GBPm) from the **Stability Pool** and gives it to the pool, receiving **collateral** (e.g. USDm) from the pool. Contraction: strategy **redeems** debt (pays GBPm, receives USDm from troves) and gives USDm to the pool, taking GBPm from the pool. See [Liquity v2 documentation](https://docs.liquity.org/) for Trove, Stability Pool, and redemptions.
* **Expansion clamp:** `_clampExpansion` limits how much debt can be taken from the Stability Pool in one rebalance (e.g. percentage of SP balance, minimum BOLD left in SP). Contraction uses redemption logic with iteration bounds and shortfall tolerance. `CDPLiquidityStrategy.sol` (e.g. L89–L112, L138–L190).
* **Use case:** Pools that pair a CDP-backed stable (e.g. GBPm) with USDm (e.g. GBPm/USDm).

***

## OpenLiquidityStrategy

* **Backing:** No reserve or CDP. The **caller** of `rebalance(pool)` acts as the liquidity source: they must have approved the strategy to spend the required token and transfer it in before/during the rebalance. The strategy uses **ERC20 transfers** only (no minting or burning). Introduced in [mento-protocol/mento-core#711](https://github.com/mento-protocol/mento-core/pull/711).
* **Mechanics:** The strategy uses **EIP-1153 transient storage** (`tstore`/`tload`) to record the rebalancer address for the duration of the transaction, so that `onRebalance` can pull tokens from the correct account and send the protocol incentive to `protocolFeeRecipient` and the remainder (liquidity-source incentive) back to the rebalancer.
* **Clamps:** `_clampExpansion` and `_clampContraction` overrides check the rebalancer’s token balance and cap the rebalance amounts so the strategy never attempts to transfer more than the caller holds.
* **Use case:** Deployments where there is no Reserve or CDP (e.g. GBPm/USDm on Monad). A keeper or relayer holds the tokens and calls `rebalance`; the strategy pulls from the caller and returns the other side to the pool. Deployed parameters (e.g. Monad address) are in [Parameters](https://docs.mento.org/mento-v3/build/deployments/parameters).

***

## Pool registration

* **addPool(params)** — Adds a pool with `AddPoolParams`: pool address, debt token, cooldown, protocol fee recipient, and the four incentive values. Sets `isToken0Debt` from the debt token. Reverts if pool already exists, debt token not in pool, or protocol fee recipient zero. The **pool owner** must then call `FPMM.setLiquidityStrategy(strategy, true)` to allowlist the strategy.
* **removePool(pool)** — Removes the pool from the strategy’s registry. Does not automatically remove the strategy from the pool’s allowlist (owner must do that on the pool).

***

## View

* **determineAction(pool)** — Returns the current **context** and the **action** (direction, amounts) the strategy would take if `rebalance(pool)` were called. Useful for off-chain or UI to preview rebalance.
* **isPoolRegistered(pool)**, **getPools()** — Registry queries.

***

## Errors (selection)

* `LS_COOLDOWN_ACTIVE` — Rebalance called before cooldown elapsed.
* `LS_POOL_NOT_FOUND` — Pool not in strategy registry.
* `LS_HOOK_NOT_CALLED` — `onRebalance` invoked outside a rebalance from the FPMM.
* `LS_CAN_ONLY_REBALANCE_ONCE(pool)` — Same pool rebalanced twice in one transaction (transient storage guard).

***

## See also

* [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) — `rebalance`, allowlist, `getRebalancingState`, `_rebalanceCheck`.
* [Reserve](https://docs.mento.org/mento-v3/build/smart-contracts/reserve) — Used by ReserveLiquidityStrategy.
* [The Reserve](https://docs.mento.org/mento-v3/dive-deeper/the-reserve) — Protocol role.
* [Liquity v2 docs](https://docs.liquity.org/) — CDP mechanism for CDPLiquidityStrategy.
* [Parameters](https://docs.mento.org/mento-v3/build/deployments/parameters) — Deployed strategy addresses (e.g. OpenLiquidityStrategy on Monad).
* [Rebalancing & strategies](https://docs.mento.org/mento-v3/dive-deeper/fpmm/rebalancing-and-strategies).


# TradingLimitsV2

In **Mento V3**, FPMM pools enforce **per-token net-flow limits** to bound adverse flow over time. The **TradingLimitsV2** library is used by the pool to apply these limits after each swap. (TradingLimits v1 applied to Mento V2; V3 uses TradingLimitsV2.)

***

## Checking limits (code example)

You do not call TradingLimitsV2 directly; the [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) applies it after every swap. To **inspect** the current config and state for a token (e.g. for a UI or to debug a reverted swap), use the pool’s view:

```solidity
IFPMM pool = IFPMM(poolAddress);
(address token0, address token1) = pool.tokens();

(
    ITradingLimitsV2.Config memory config,
    ITradingLimitsV2.State memory state
) = pool.getTradingLimits(token0);  // or token1

// config.limit0, config.limit1 => caps (e.g. 5-min and 1-day)
// state.netflow0, state.netflow1 => current net flow in the windows
// If a swap would push netflow over the limit, the swap reverts
```

***

## Behavior

* **L0** — Short-term limit over a **5-minute** rolling window: net flow of the token in that window must stay within the configured bounds (e.g. `-limit0 <= netflow0 <= limit0`).
* **L1** — Medium-term limit over a **1-day** rolling window: net flow over the day must stay within the configured bounds.

Each pool token can have its own config (limit0, limit1). If a swap would cause either limit to be exceeded, the swap reverts. Limits are applied after the swap amounts are determined; fee is deducted from inflow before updating net flow.

This protects the pool and the protocol from large one-sided flow in a short period (e.g. oracle lag or manipulation) while still allowing normal trading.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/libraries/TradingLimitsV2.sol`

For how TradingLimitsV2 is configured and used on a pool, see [TradingLimitsV2](https://docs.mento.org/mento-v3/dive-deeper/fpmm/trading-limits) in Dive Deeper.


# BreakerBox

**BreakerBox** is an on-chain circuit breaker for oracle feeds. It maintains a state per price feed (e.g. trading allowed or suspended) and supports modular addition of price feeds and breaker logic. In **Mento V3**, the **OracleAdapter** reads from BreakerBox when supplying the FPMM pool with a valid rate; if a breaker has tripped, the adapter returns invalid and swaps revert. This protects pools from trading on stale or out-of-bounds oracle data.

For **FX pairs**, Mento also uses a **MarketHoursBreaker**. This aligns on-chain trading with reference FX market hours: Chainlink FX feeds typically stop updating on weekends and certain holidays, so Mento can reject FX trading even if the last reported rate is still recent enough by timestamp.

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/oracles/BreakerBox.sol`

Integrators typically **do not** call BreakerBox directly; the [OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter) uses it. If you need to check trading mode (e.g. for a status UI), use the adapter’s `getRate(rateFeedID)` and inspect `tradingMode`, or call `getTradingMode(rateFeedID)` on the adapter if exposed.

### MedianDeltaBreaker

**MedianDeltaBreaker** is a circuit breaker that trips when the current median oracle rate compared to an exponential moving average over previous median rates exceeds a configured relative threshold.

{% embed url="<https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/breakers/MedianDeltaBreaker.sol>" %}
MedianDeltaBreaker.sol
{% endembed %}

### ValueDeltaBreaker

**ValueDeltaBreaker** is a circuit breaker that trips when the current median oracle rate compared to a fixed reference rate exceeds a configured relative threshold.

{% embed url="<https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/breakers/ValueDeltaBreaker.sol>" %}
ValueDeltaBreaker.sol
{% endembed %}

### MarketHoursBreaker

**MarketHoursBreaker** is a special breaker for **FX market-hours gating**. Instead of comparing prices, it checks whether the current block timestamp falls inside the configured FX trading window. The current implementation treats the FX market as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Christmas Day (Dec 25)** and **New Year's Day (Jan 1)**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

When this breaker says the FX market is closed, `OracleAdapter.getFXRateIfValid()` reverts and FX-priced FPMM swaps revert too. This is especially relevant for GBP/USD, EUR/USD, and similar fiat FX feeds, whose Chainlink rates generally do not update during those closure windows.

{% embed url="<https://github.com/mento-protocol/mento-core/blob/main/contracts/oracles/breakers/MarketHoursBreaker.sol>" %}
MarketHoursBreaker.sol
{% endembed %}


# Reserve

**Reserve** stores and manages ERC-20 collateral backing **Reserve-backed Mento stables** (USDm, EURm) on supported chains (e.g. Celo). The Reserve holds the fiat-backed assets (e.g. USDC, USDT, EUROC) that back circulating supply. In V3, the **ReserveLiquidityStrategy** is allowlisted on FPMM pools that pair USDm or EURm with those external stables; when a pool rebalances, the strategy mints or burns the Mento stable and moves collateral via the Reserve.

For the protocol role of the Reserve, see [The Reserve](https://docs.mento.org/mento-v3/dive-deeper/the-reserve).

**Contract:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/swap/Reserve.sol`


# StableToken

**StableToken** contracts implement the ERC-20 Mento stable assets (USDm, EURm, GBPm, etc.). Each stable has its own implementation or proxy (e.g. **StableTokenV2** / **StableTokenV3** in mento-core). In **Mento V3**, Reserve-backed stables (USDm, EURm) are minted and burned by the **ReserveLiquidityStrategy** when FPMM pools rebalance; CDP-backed stables (e.g. GBPm) are minted via the Liquity v2–style CDP system.

**Contracts:** [mento-protocol/mento-core](https://github.com/mento-protocol/mento-core) — `contracts/tokens/` (e.g. StableTokenV2.sol, StableTokenV3.sol, and per-currency proxies).


# CDPs

Mento’s CDP system is a **fork of** [**Liquity v2**](https://www.liquity.org/) maintained in a **separate repository**: [**mento-protocol/bold**](https://github.com/mento-protocol/bold). Same contract architecture and mechanics as Liquity v2, with **USDm as collateral** and **FX-pegged Mento stables** as the debt token; Mento deploys **one independent instance per FX currency**, each with its own TroveManager, StabilityPool, and FX price feed. In practice, **all Mento CDP deployments are FX CDPs**: borrow `XXXm`, post `USDm`, and price the branch from an FX feed via `FXPriceFeed -> OracleAdapter`. For a protocol-level overview (what you can do, collateral vs debt, Stability Pool, app/SDK usage), see [**CDPs**](https://docs.mento.org/mento-v3/dive-deeper/cdp) in Dive Deeper.

***

## Contract overview

The CDP system is implemented by the Liquity v2 contract suite. Mento’s fork lives in [mento-protocol/bold](https://github.com/mento-protocol/bold) (not in mento-core):

| Role                   | Purpose                                                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **BorrowerOperations** | Open, adjust, and close troves; add/withdraw collateral, borrow, repay.                                                                            |
| **TroveManager**       | Trove state, collateralization checks, liquidations, redemption order.                                                                             |
| **Stability Pool**     | Holds debt-token deposits; absorbs debt from liquidated troves in exchange for collateral; used by CDPLiquidityStrategy for expansion rebalancing. |
| **Collateral / Debt**  | In Mento’s fork: collateral is **USDm**; debt is the FX-pegged stable (e.g. GBPm) for that instance.                                               |
| **FXPriceFeed**        | Mento-specific: fetches FX rates (e.g. GBP/USD) from Mento’s OracleAdapter; supports watchdog-triggered shutdown.                                  |
| **SystemParams**       | Minimum debt, liquidation penalties, CCR/MCR/BCR, redemption fee floor, gas compensation, etc.                                                     |

Liquidations, redemptions, gas compensation, and fee flows follow Liquity v2; Mento’s fork differs in **collateral (USDm)**, **debt (FX-pegged tokens)**, **oracles (FXPriceFeed)**, and **multi-instance deployment**.

## FX Market Hours

Because Mento CDPs use `FXPriceFeed`, and `FXPriceFeed.fetchPrice()` calls `OracleAdapter.getFXRateIfValid(rateFeedID)`, **all Mento CDP branches inherit FX market-hours gating**. When the FX market is closed, price-dependent CDP operations revert instead of using a stale weekend price.

Under the current `MarketHoursBreaker`, FX is treated as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Dec 25** and **Jan 1**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

### Blocked While FX Markets Are Closed

These operations depend on `priceFeed.fetchPrice()` and therefore are **not available** during weekend / holiday FX closures:

* **Open trove**
* **Adjust trove**: add collateral, withdraw collateral, borrow more, repay, combined adjustments
* **Close trove**
* **Zombie trove adjustment / reactivation**
* **Standard liquidations**
* **Standard redemptions**
* **Some interest-rate / batch-manager operations** when they require a price-dependent upfront-fee or TCR check

### Still Available

These user-facing Stability Pool operations do **not** call `fetchPrice()` and therefore are **still available** during FX closures:

* **Deposit to Stability Pool**
* **Withdraw from Stability Pool**
* **Claim accumulated Stability Pool collateral gains**

The indirect effect is that the Stability Pool usually will **not** receive new liquidation-driven offsets while the FX market is closed, because standard liquidations are themselves blocked.

### Shutdown Exception

If a CDP branch has already entered **shutdown**, `FXPriceFeed` returns `lastValidPrice` instead of calling the live oracle path. In that emergency mode, the branch follows shutdown-specific logic such as **urgent redemption**, rather than the normal market-hours-gated flow.

**Critical risk considerations** (USDm depeg risk, FX exposure for borrowers and SP depositors, Stability Pool FX loss on liquidations, and double liquidation risk from both FX moves and USDm depeg) are summarized in [**CDPs (Dive Deeper)**](https://docs.mento.org/mento-v3/dive-deeper/cdp#critical-risk-considerations) and discussed in depth in the [mento-protocol/bold README](https://github.com/mento-protocol/bold).

***

## Where to find full contract documentation

Contract-level behavior, state variables, and all protocol rules are not re-documented here.

* [**Liquity v2 documentation**](https://docs.liquity.org/) — technical resources and contract behavior.
* [**Liquity v2 whitepaper**](https://www.liquity.org/blog/liquity-v2-whitepaper) — design and economics.

**Mento fork:** The [**mento-protocol/bold** README](https://github.com/mento-protocol/bold) describes key differences (USDm collateral, FX-pegged stables, FXPriceFeed, multi-instance architecture) and Mento-specific risks and economics. For deployment addresses, parameter choices, and integration with [CDPLiquidityStrategy](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies), see [mento-core](https://github.com/mento-protocol/mento-core) and the [Deployments](https://docs.mento.org/mento-v3/build/deployments) section.


# Audits

**Mento V3** is covered by two **ChainSecurity** audits:

1. **Mento Core V3** — FPMM-based exchange, OracleAdapter, liquidity strategies, CDP integration, and TradingLimitsV2. The report covers functional correctness, oracle implementation and operational implications, rounding, and documentation.\
   [ChainSecurity — Mento Core V3](https://www.chainsecurity.com/security-audit/mento-core-v3)
2. **Mento Liquity V2** — The Liquity v2 fork that underpins **CDP-backed stables** (e.g. GBPm). Users deposit USDm and mint non-USD stables against it; the system includes governance-controlled SystemParams, an upgradable Stability Pool used for rebalancing, and an FX price feed.\
   [ChainSecurity — Mento Liquity V2](https://www.chainsecurity.com/security-audit/mento-liquity-v2)

***

## Historical audits (earlier versions)

The following audits refer to earlier protocol versions (V2 / V1) and are kept for reference. They do not cover the current V3 FPMM layer.

<table><thead><tr><th width="143">Date</th><th>Link</th><th>Auditor</th><th width="100">Version</th></tr></thead><tbody><tr><td>03/2024</td><td><a href="https://0xmacro.com/library/audits/mento-3">Macro audit 3</a></td><td>Macro</td><td>V2.3.0</td></tr><tr><td>03/2024</td><td><a href="https://audits.sherlock.xyz/dashboard/404ec017225af69f6deff9b722393a44">Sherlock contest</a></td><td>Sherlock</td><td>V2.3.0</td></tr><tr><td>01/2024</td><td><a href="https://0xmacro.com/library/audits/mento-2">Macro audit 2</a></td><td>Macro</td><td>V2.3.0</td></tr><tr><td>08/2023</td><td><a href="https://0xmacro.com/library/audits/mento-1">Macro audit 1</a></td><td>Macro</td><td>V2.2.0</td></tr><tr><td>05/2023</td><td><a href="https://www.verilog.solutions/audits/mento/">Verilog (extended)</a></td><td>Verilog</td><td>v2.1.0</td></tr><tr><td>02/2023</td><td><a href="https://www.verilog.solutions/audits/mento/">Verilog</a></td><td>Verilog</td><td>v2.0.0</td></tr><tr><td>2020-2021</td><td><a href="https://blog.openzeppelin.com/celo-contracts-audit/#phase-3">OpenZeppelin</a></td><td>OpenZeppelin</td><td>v1.0.0</td></tr></tbody></table>


# Deployments

**Who this is for:** Integrators and deployers who need contract addresses, deployment parameters, and verification steps for Mento V3 on supported chains. The pages in this section cover deployment addresses, parameters, and how to verify on-chain bytecode.

**See also:** [Integration](https://docs.mento.org/mento-v3/build/integration) · [Smart Contracts](https://docs.mento.org/mento-v3/build/smart-contracts) · [Integrate Oracles](https://docs.mento.org/mento-v3/build/integration/integrate-oracles).


# Addresses

### Externally Owned Accounts (EOAs) and MultiSigs

| Label                 | Address                                    | Notes                                                         |
| --------------------- | ------------------------------------------ | ------------------------------------------------------------- |
| Mento Reserve Spender | 0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1 | Used with the Reserve to move funds between reserve addresses |

## Shared (Mento v2 & v3)

Contracts below are shared across Mento v2 and v3 deployments (same addresses on a given chain). Implementation addresses are from EIP-1967 proxy slot where applicable.

{% tabs %}
{% tab title="Celo Mainnet" %}

<table><thead><tr><th width="199.1953125">Contract</th><th width="242">Address</th><th>Implementation</th></tr></thead><tbody><tr><td>BreakerBox</td><td><a href="https://celoscan.io/address/0x303ED1df62Fa067659B586EbEe8De0EcE824Ab39">0x303ED1df62Fa067659B586EbEe8De0EcE824Ab39</a></td><td>❌ Non-upgradable</td></tr><tr><td>Reserve</td><td><a href="https://celoscan.io/address/0x9380fA34Fd9e4Fd14c06305fd7B6199089eD4eb9">0x9380fA34Fd9e4Fd14c06305fd7B6199089eD4eb9</a></td><td><a href="https://celoscan.io/address/0xfD9651862Bc1965349E92073152112289393b57d">0xfD9651862Bc1965349E92073152112289393b57d</a></td></tr><tr><td>Chainlink Relayer Factory</td><td><a href="https://celoscan.io/address/0x247cb6ecf21bdd2bc29d726cccc8d2f066211663">0x247cb6ecf21bdd2bc29d726cccc8d2f066211663</a></td><td><a href="https://celoscan.io/address/0xcf7031937f49f348c55930353fd3bc3aa15b4ced">0xcf7031937f49f348c55930353fd3bc3aa15b4ced</a></td></tr><tr><td><p>ConstantSum</p><p>PricingModule</p></td><td><a href="https://celoscan.io/address/0xDebED1F6f6ce9F6e73AA25F95acBFFE2397550Fb">0xDebED1F6f6ce9F6e73AA25F95acBFFE2397550Fb</a></td><td>❌ Non-upgradable</td></tr><tr><td><p>ConstantProduct</p><p>PricingModule</p></td><td><a href="https://celoscan.io/address/0x0c07126d0CB30E66eF7553Cc7C37143B4f06DddB">0x0c07126d0CB30E66eF7553Cc7C37143B4f06DddB</a></td><td>❌ Non-upgradable</td></tr><tr><td>MedianDeltaBreaker</td><td><a href="https://celoscan.io/address/0x49349F92D2B17d491e42C8fdB02D19f072F9B5D9">0x49349F92D2B17d491e42C8fdB02D19f072F9B5D9</a></td><td>❌ Non-upgradable</td></tr><tr><td>ValueDeltaBreaker</td><td><a href="https://celoscan.io/address/0x4DBC33B3abA78475A5AA4BC7A5B11445d387BF68">0x4DBC33B3abA78475A5AA4BC7A5B11445d387BF68</a></td><td>❌ Non-upgradable</td></tr><tr><td>StableTokenUSD</td><td><a href="https://celoscan.io/address/0x765de816845861e75a25fca122bb6898b8b1282a">0x765de816845861e75a25fca122bb6898b8b1282a</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenEUR</td><td><a href="https://celoscan.io/address/0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73">0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenBRL</td><td><a href="https://celoscan.io/address/0xe8537a3d056da446677b9e9d6c5db704eaab4787">0xe8537a3d056da446677b9e9d6c5db704eaab4787</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenXOF</td><td><a href="https://celoscan.io/address/0x73F93dcc49cB8A239e2032663e9475dd5ef29A08">0x73F93dcc49cB8A239e2032663e9475dd5ef29A08</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenKES</td><td><a href="https://celoscan.io/address/0x456a3D042C0DbD3db53D5489e98dFb038553B0d0">0x456a3D042C0DbD3db53D5489e98dFb038553B0d0</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenPHP</td><td><a href="https://celoscan.io/address/0x105d4A9306D2E55a71d2Eb95B81553AE1dC20d7B">0x105d4A9306D2E55a71d2Eb95B81553AE1dC20d7B</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenCOP</td><td><a href="https://celoscan.io/address/0x8a567e2ae79ca692bd748ab832081c45de4041ea">0x8a567e2ae79ca692bd748ab832081c45de4041ea</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenGHS</td><td><a href="https://celoscan.io/address/0xfAeA5F3404bbA20D3cc2f8C4B0A888F55a3c7313">0xfAeA5F3404bbA20D3cc2f8C4B0A888F55a3c7313</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenGBP</td><td><a href="https://celoscan.io/address/0xCCF663b1fF11028f0b19058d0f7B674004a40746">0xCCF663b1fF11028f0b19058d0f7B674004a40746</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenZAR</td><td><a href="https://celoscan.io/address/0x4c35853A3B4e647fD266f4de678dCc8fEC410BF6">0x4c35853A3B4e647fD266f4de678dCc8fEC410BF6</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenCAD</td><td><a href="https://celoscan.io/address/0xff4Ab19391af240c311c54200a492233052B6325">0xff4Ab19391af240c311c54200a492233052B6325</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenAUD</td><td><a href="https://celoscan.io/address/0x7175504C455076F15c04A2F90a8e352281F492F9">0x7175504C455076F15c04A2F90a8e352281F492F9</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenCHF</td><td><a href="https://celoscan.io/address/0xb55a79F398E759E43C95b979163f30eC87Ee131D">0xb55a79F398E759E43C95b979163f30eC87Ee131D</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenJPY</td><td><a href="https://celoscan.io/address/0xc45eCF20f3CD864B32D9794d6f76814aE8892e20">0xc45eCF20f3CD864B32D9794d6f76814aE8892e20</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>StableTokenNGN</td><td><a href="https://celoscan.io/address/0xE2702Bd97ee33c88c8f6f92DA3B733608aa76F71">0xE2702Bd97ee33c88c8f6f92DA3B733608aa76F71</a></td><td><a href="https://celoscan.io/address/0x434563B0604BE100F04B7Ae485BcafE3c9D8850E">0x434563B0604BE100F04B7Ae485BcafE3c9D8850E</a></td></tr><tr><td>SortedOracles</td><td><a href="https://celoscan.io/address/0xefb84935239dacdecf7c5ba76d8de40b077b7b33">0xefb84935239dacdecf7c5ba76d8de40b077b7b33</a></td><td><a href="https://celoscan.io/address/0x4B621443c1c749ef5252e8AEE158A52B5eCe304A">0x4B621443c1c749ef5252e8AEE158A52B5eCe304A</a></td></tr><tr><td>MENTO token</td><td><a href="https://celoscan.io/address/0x7FF62f59e3e89EA34163EA1458EEBCc81177Cfb6">0x7FF62f59e3e89EA34163EA1458EEBCc81177Cfb6</a></td><td>❌ Non-upgradable</td></tr><tr><td>veMENTO</td><td><a href="https://celoscan.io/token/0x001Bb66636dCd149A1A2bA8C50E408BdDd80279C">0x001Bb66636dCd149A1A2bA8C50E408BdDd80279C</a></td><td><a href="https://celoscan.io/address/0x34c5bb4113cd6ff681a82a8e8cffb3b587485d73">0x34C5BB4113Cd6FF681A82A8E8CffB3b587485D73</a></td></tr><tr><td>Governor</td><td><a href="https://celoscan.io/address/0x47036d78bB3169b4F5560dD77BF93f4412A59852">0x47036d78bB3169b4F5560dD77BF93f4412A59852</a></td><td><a href="https://celoscan.io/address/0xb910a75f9a96f1f0fafeb2e3f823b3e030671cdf">0xB910a75f9A96f1F0FAfEb2E3F823B3e030671CDf</a></td></tr><tr><td>Timelock</td><td><a href="https://celoscan.io/address/0x890DB8A597940165901372Dd7DB61C9f246e2147">0x890DB8A597940165901372Dd7DB61C9f246e2147</a></td><td><a href="https://celoscan.io/address/0x3efad8f997f705675924470ec84677db68c5a2d0">0x3eFAD8F997F705675924470Ec84677DB68c5A2d0</a></td></tr></tbody></table>
{% endtab %}

{% tab title="Celo Sepolia" %}

<table><thead><tr><th width="194.75">Contract</th><th width="232.2421875">Address</th><th>Implementation</th></tr></thead><tbody><tr><td>BreakerBox</td><td><a href="https://sepolia.celoscan.io/address/0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE">0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE</a></td><td>❌ Non-upgradable</td></tr><tr><td>Reserve</td><td><a href="https://sepolia.celoscan.io/address/0x2bC2D48735842924C508468C5A02580aD4F6d99A">0x2bC2D48735842924C508468C5A02580aD4F6d99A</a></td><td><a href="https://sepolia.celoscan.io/address/0xC09D3009De5849E6673c3150c10F0eDD9eb86158">0xC09D3009De5849E6673c3150c10F0eDD9eb86158</a></td></tr><tr><td>Chainlink Relayer Factory</td><td><a href="https://sepolia.celoscan.io/address/0xd96f786f5a294fb7cbb0847307293b7A871B9d5a">0xd96f786f5a294fb7cbb0847307293b7A871B9d5a</a></td><td><a href="https://sepolia.celoscan.io/address/0x436a0eC7f23533E4aD109ECAb4AcF325d2173c28">0x436a0eC7f23533E4aD109ECAb4AcF325d2173c28</a></td></tr><tr><td><p>ConstantSum</p><p>PricingModule</p></td><td><a href="https://sepolia.celoscan.io/address/0x3b199d9EbEbe509bb711BfFb455c2d79102A9602">0x3b199d9EbEbe509bb711BfFb455c2d79102A9602</a></td><td>❌ Non-upgradable</td></tr><tr><td><p>ConstantProduct</p><p>PricingModule</p></td><td><a href="https://sepolia.celoscan.io/address/0x2584a5835e3aE7E901e6462E1de06920c2C68028">0x2584a5835e3aE7E901e6462E1de06920c2C68028</a></td><td>❌ Non-upgradable</td></tr><tr><td>MedianDeltaBreaker</td><td><a href="https://sepolia.celoscan.io/address/0xd29B4e743F7B84D63fBF9149B6D983DF2eF5C952">0xd29B4e743F7B84D63fBF9149B6D983DF2eF5C952</a></td><td>❌ Non-upgradable</td></tr><tr><td>ValueDeltaBreaker</td><td><a href="https://sepolia.celoscan.io/address/0x03CDf2966185Eb0b980f2481Ad386B8aFdAB4534">0x03CDf2966185Eb0b980f2481Ad386B8aFdAB4534</a></td><td>❌ Non-upgradable</td></tr><tr><td>StableTokenUSD</td><td><a href="https://sepolia.celoscan.io/address/0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b">0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenEUR</td><td><a href="https://sepolia.celoscan.io/address/0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a">0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenBRL</td><td><a href="https://sepolia.celoscan.io/address/0x2294298942fdc79417DE9E0D740A4957E0e7783a">0x2294298942fdc79417DE9E0D740A4957E0e7783a</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenXOF</td><td><a href="https://sepolia.celoscan.io/address/0x5505b70207aE3B826c1A7607F19F3Bf73444A082">0x5505b70207aE3B826c1A7607F19F3Bf73444A082</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenKES</td><td><a href="https://sepolia.celoscan.io/address/0xC7e4635651E3e3Af82b61d3E23c159438daE3BbF">0xC7e4635651E3e3Af82b61d3E23c159438daE3BbF</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenPHP</td><td><a href="https://sepolia.celoscan.io/address/0x0352976d940a2C3FBa0C3623198947Ee1d17869E">0x0352976d940a2C3FBa0C3623198947Ee1d17869E</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenCOP</td><td><a href="https://sepolia.celoscan.io/address/0x5F8d55c3627d2dc0a2B4afa798f877242F382F67">0x5F8d55c3627d2dc0a2B4afa798f877242F382F67</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenGHS</td><td><a href="https://sepolia.celoscan.io/address/0x5e94B8C872bD47BC4255E60ECBF44D5E66e7401C">0x5e94B8C872bD47BC4255E60ECBF44D5E66e7401C</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenGBP</td><td><a href="https://sepolia.celoscan.io/address/0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3">0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenZAR</td><td><a href="https://sepolia.celoscan.io/address/0x10CCfB235b0E1Ed394bACE4560C3ed016697687e">0x10CCfB235b0E1Ed394bACE4560C3ed016697687e</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenCAD</td><td><a href="https://sepolia.celoscan.io/address/0xF151c9a13b78C84f93f50B8b3bC689fedc134F60">0xF151c9a13b78C84f93f50B8b3bC689fedc134F60</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenAUD</td><td><a href="https://sepolia.celoscan.io/address/0x5873Faeb42F3563dcD77F0fbbdA818E6d6DA3139">0x5873Faeb42F3563dcD77F0fbbdA818E6d6DA3139</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenCHF</td><td><a href="https://sepolia.celoscan.io/address/0x284E9b7B623eAE866914b7FA0eB720C2Bb3C2980">0x284E9b7B623eAE866914b7FA0eB720C2Bb3C2980</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenJPY</td><td><a href="https://sepolia.celoscan.io/address/0x85Bee67D435A39f7467a8a9DE34a5B73D25Df426">0x85Bee67D435A39f7467a8a9DE34a5B73D25Df426</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>StableTokenNGN</td><td><a href="https://sepolia.celoscan.io/address/0x3d5ae86F34E2a82771496D140daFAEf3789dF888">0x3d5ae86F34E2a82771496D140daFAEf3789dF888</a></td><td><a href="https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0">0xEd9A3541f06E45E3d92E937AA74eD878127318E0</a></td></tr><tr><td>SortedOracles</td><td><a href="https://sepolia.celoscan.io/address/0xfaa7Ca2B056E60F6733aE75AA0709140a6eAfD20">0xfaa7Ca2B056E60F6733aE75AA0709140a6eAfD20</a></td><td><a href="https://sepolia.celoscan.io/address/0x0514884378460D86528658543bc8093D8178D7b1">0x0514884378460D86528658543bc8093D8178D7b1</a></td></tr><tr><td>BridgedUSDC*</td><td><a href="https://sepolia.celoscan.io/address/0x6285De9DA7C1d329C0451628638908915002d9d1">0x6285De9DA7C1d329C0451628638908915002d9d1</a></td><td>❌ Non-upgradable</td></tr><tr><td>BridgedEUROC*</td><td><a href="https://sepolia.celoscan.io/address/0x9883d788d40F1C7595a780ed881Ea833C7743B4B">0x9883d788d40F1C7595a780ed881Ea833C7743B4B</a></td><td>❌ Non-upgradable</td></tr><tr><td>MockNativeUSDT*</td><td><a href="https://sepolia.celoscan.io/address/0xCA53d9b72646B254d29EBeEb4c5cde7BB4bb59e0">0xCA53d9b72646B254d29EBeEb4c5cde7BB4bb59e0</a></td><td>❌ Non-upgradable</td></tr><tr><td>MENTO token</td><td><a href="https://sepolia.celoscan.io/address/0x07867fd40EB56b4380bE39c88D0a7EA59Aa99A20">0x07867fd40EB56b4380bE39c88D0a7EA59Aa99A20</a></td><td>❌ Non-upgradable</td></tr><tr><td>veMENTO</td><td><a href="https://sepolia.celoscan.io/address/0xB72320fC501cb30E55bAF0DA48c20b11fAc9f79D">0xB72320fC501cb30E55bAF0DA48c20b11fAc9f79D</a></td><td><a href="https://sepolia.celoscan.io/address/0xC955e54F7f6a302d926720890ddE96705104db38">0xC955e54F7f6a302d926720890ddE96705104db38</a></td></tr><tr><td>Governor</td><td><a href="https://sepolia.celoscan.io/address/0x23173Ac37b8E4e5a60d787aC543B3F51e8f398b4">0x23173Ac37b8E4e5a60d787aC543B3F51e8f398b4</a></td><td><a href="https://sepolia.celoscan.io/address/0x910A940a53C12982ae2277392C5Cfa03aa8c602b">0x910A940a53C12982ae2277392C5Cfa03aa8c602b</a></td></tr><tr><td>Timelock</td><td><a href="https://sepolia.celoscan.io/address/0x74c44Be99937815173A3C56274331e0A05611e0D">0x74c44Be99937815173A3C56274331e0A05611e0D</a></td><td><a href="https://sepolia.celoscan.io/address/0x32346936c5bAf3c7B53Ea3fe40B405EFD3A3e656">0x32346936c5bAf3c7B53Ea3fe40B405EFD3A3e656</a></td></tr></tbody></table>

\*Bridged USDC/EUROC are Mock ERC20 tokens that we use on testnet as a surrogate for the bridged USDC/EUROC that will be used in pools Celo Mainnet.

\*MockNativeUSDT is a Mock ERC20 token that we use on testnet as a surrogate for the USDT that will be used in pools.
{% endtab %}
{% endtabs %}

## Mento v2.0 (v2-specific)

Contracts used only by the Mento v2 bi-pool system (Broker, BiPoolManager). Shared contracts (Reserve, StableTokens, SortedOracles, Governor, etc.) are listed under [Shared (Mento v2 & v3)](#shared-mento-v2--v3) above.

{% tabs %}
{% tab title="Celo Mainnet" %}

| Contract      | Address                                                                                                              | Implementation                                                                                                       |
| ------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Broker        | [0x777A8255cA72412f0d706dc03C9D1987306B4CaD](https://celoscan.io/address/0x777A8255cA72412f0d706dc03C9D1987306B4CaD) | [0x1B78f6acD05e7BcB00f74863bfd8a7C264143e37](https://celoscan.io/address/0x1B78f6acD05e7BcB00f74863bfd8a7C264143e37) |
| BiPoolManager | [0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901](https://celoscan.io/address/0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901) | [0xa3D754445f8C3a8134F64467826352885558FD65](https://celoscan.io/address/0xa3D754445f8C3a8134F64467826352885558FD65) |
| {% endtab %}  |                                                                                                                      |                                                                                                                      |

{% tab title="Celo Sepolia" %}

| Contract      | Address                                                                                                                      | Implementation                                                                                                               |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Broker        | [0xB9Ae2065142EB79b6c5EB1E8778F883fad6B07Ba](https://sepolia.celoscan.io/address/0xB9Ae2065142EB79b6c5EB1E8778F883fad6B07Ba) | [0xc9EDe4cB22889ec60C62A9643D76cf6372947670](https://sepolia.celoscan.io/address/0xc9EDe4cB22889ec60C62A9643D76cf6372947670) |
| BiPoolManager | [0xeCB3C656C131fCd9bB8D1d80898716bD684feb78](https://sepolia.celoscan.io/address/0xeCB3C656C131fCd9bB8D1d80898716bD684feb78) | [0x641A91B3c70D0E4A9A8bf5B3a2047ed9762F600c](https://sepolia.celoscan.io/address/0x641A91B3c70D0E4A9A8bf5B3a2047ed9762F600c) |
| {% endtab %}  |                                                                                                                              |                                                                                                                              |
| {% endtabs %} |                                                                                                                              |                                                                                                                              |

***

## Mento v3

Addresses below are from the current deployment manifests. **Proxy vs implementation:** implementation addresses are from EIP-1967 lookup (see [scripts/](https://github.com/mento-protocol/docs/tree/main/build/deployments/scripts/README.md)). Entries named with “Proxy” (e.g. SystemParamsProxyGBPm) are proxy addresses; the implementation is listed in the Implementation column where known. For other contracts, implementation is left as “—” unless otherwise verified.

{% tabs %}
{% tab title="Celo Mainnet (42220)" %}

| Contract                 | Address                                                                                                              | Implementation                                                                                                       |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| FPMMFactory              | [0xa849b475FE5a4B5C9C3280152c7a1945b907613b](https://celoscan.io/address/0xa849b475FE5a4B5C9C3280152c7a1945b907613b) | [0xcc5bb0ba252082213ce1303cbfba8d56cd872a8a](https://celoscan.io/address/0xcc5bb0ba252082213ce1303cbfba8d56cd872a8a) |
| FactoryRegistry          | [0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6](https://celoscan.io/address/0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6) | [0x8124b66595ff4e79b7f0c1b1101afa501d219311](https://celoscan.io/address/0x8124b66595ff4e79b7f0c1b1101afa501d219311) |
| OracleAdapter            | [0xa472fBBF4b890A54381977ac392BdF82EeC4383a](https://celoscan.io/address/0xa472fBBF4b890A54381977ac392BdF82EeC4383a) | [0xc1b767756f582d124e76bb3e246f31e6ab256059](https://celoscan.io/address/0xc1b767756f582d124e76bb3e246f31e6ab256059) |
| Router                   | [0x4861840C2EfB2b98312B0aE34d86fD73E8f9B6f6](https://celoscan.io/address/0x4861840C2EfB2b98312B0aE34d86fD73E8f9B6f6) | —                                                                                                                    |
| ReserveV2                | [0x4255Cf38e51516766180b33122029A88Cb853806](https://celoscan.io/address/0x4255Cf38e51516766180b33122029A88Cb853806) | [0xc16d23e4789e2b214d71c1df7820a4ddab1df5ff](https://celoscan.io/address/0xc16d23e4789e2b214d71c1df7820a4ddab1df5ff) |
| ReserveLiquidityStrategy | [0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B](https://celoscan.io/address/0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B) | [0x420fbdb50dadf0286144bff91ed62a6893dee148](https://celoscan.io/address/0x420fbdb50dadf0286144bff91ed62a6893dee148) |
| CDPLiquidityStrategy     | [0x4e78BD9565341EAbe99cDC024acB044d9BDcB985](https://celoscan.io/address/0x4e78BD9565341EAbe99cDC024acB044d9BDcB985) | [0xaa6a9b01d02ddb3db718669a83621c97c2e31823](https://celoscan.io/address/0xaa6a9b01d02ddb3db718669a83621c97c2e31823) |
| FPMM implementation      | [0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30](https://celoscan.io/address/0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30) | ❌ Implementation                                                                                                     |
| FPMM pool: GBPm/USDm     | [0x8C0014afe032E4574481D8934504100bF23fCB56](https://celoscan.io/address/0x8C0014afe032E4574481D8934504100bF23fCB56) | —                                                                                                                    |
| FPMM pool: axlUSDC/USDm  | [0xb285d4C7133d6f27BfB29224fb0D22E7EC3ddD2D](https://celoscan.io/address/0xb285d4C7133d6f27BfB29224fb0D22E7EC3ddD2D) | —                                                                                                                    |
| FPMM pool: USDC/USDm     | [0x462fe04b4FD719Cbd04C0310365D421D02AaA19E](https://celoscan.io/address/0x462fe04b4FD719Cbd04C0310365D421D02AaA19E) | —                                                                                                                    |
| FPMM pool: USDT/USDm     | [0x0FEBa760d93423D127DE1B6ABECdB60E5253228D](https://celoscan.io/address/0x0FEBa760d93423D127DE1B6ABECdB60E5253228D) | —                                                                                                                    |
| MarketHoursBreaker       | [0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF](https://celoscan.io/address/0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF) | —                                                                                                                    |
| ReserveTroveFactory      | [0x02859465DCC7D7F2Bee183fC7FaC78544c9519e1](https://celoscan.io/address/0x02859465DCC7D7F2Bee183fC7FaC78544c9519e1) | —                                                                                                                    |
| VirtualPoolFactory       | [0x22abd4ADF6aab38aC1022352d496A07Acee5aCB3](https://celoscan.io/address/0x22abd4ADF6aab38aC1022352d496A07Acee5aCB3) | —                                                                                                                    |
| StableTokenV3 v3.0.0     | [0x4B9B0E94197B7b2b11D311239e1420106cE7a2a2](https://celoscan.io/address/0x4B9B0E94197B7b2b11D311239e1420106cE7a2a2) | —                                                                                                                    |
| StableTokenV3 v3.0.1     | [0x815795C30D0758A297B08cD4e0643620c974c318](https://celoscan.io/address/0x815795C30D0758A297B08cD4e0643620c974c318) | —                                                                                                                    |
| {% endtab %}             |                                                                                                                      |                                                                                                                      |

{% tab title="Monad Mainnet (143)" %}

| Contract                 | Address                                                                                                                | Implementation                                                                                                         |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| ChainlinkRelayerFactory  | [0x71c2333928Af2dB247d9C0aa380DF1cCCa53899A](https://monadscan.com/address/0x71c2333928Af2dB247d9C0aa380DF1cCCa53899A) | [0x9aFd679045B571066a6d8491C25d2D6ba5431d3f](https://monadscan.com/address/0x9aFd679045B571066a6d8491C25d2D6ba5431d3f) |
| FPMMFactory              | [0xa849b475FE5a4B5C9C3280152c7a1945b907613b](https://monadscan.com/address/0xa849b475FE5a4B5C9C3280152c7a1945b907613b) | [0xCC5bB0ba252082213ce1303CBfbA8D56CD872A8a](https://monadscan.com/address/0xCC5bB0ba252082213ce1303CBfbA8D56CD872A8a) |
| FactoryRegistry          | [0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6](https://monadscan.com/address/0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6) | [0x8124b66595Ff4E79B7F0c1b1101AFa501d219311](https://monadscan.com/address/0x8124b66595Ff4E79B7F0c1b1101AFa501d219311) |
| OracleAdapter            | [0xa472fBBF4b890A54381977ac392BdF82EeC4383a](https://monadscan.com/address/0xa472fBBF4b890A54381977ac392BdF82EeC4383a) | [0xc1B767756F582d124E76BB3e246f31e6aB256059](https://monadscan.com/address/0xc1B767756F582d124E76BB3e246f31e6aB256059) |
| Router                   | [0x4861840C2EfB2b98312B0aE34d86fD73E8f9B6f6](https://monadscan.com/address/0x4861840C2EfB2b98312B0aE34d86fD73E8f9B6f6) | —                                                                                                                      |
| ReserveV2                | [0x4255Cf38e51516766180b33122029A88Cb853806](https://monadscan.com/address/0x4255Cf38e51516766180b33122029A88Cb853806) | [0xC16d23E4789e2B214D71C1Df7820a4dDAb1Df5FF](https://monadscan.com/address/0xC16d23E4789e2B214D71C1Df7820a4dDAb1Df5FF) |
| ReserveLiquidityStrategy | [0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B](https://monadscan.com/address/0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B) | [0x420FbDB50dadF0286144BFF91ed62A6893dee148](https://monadscan.com/address/0x420FbDB50dadF0286144BFF91ed62A6893dee148) |
| OpenLiquidityStrategy    | [0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f](https://monadscan.com/address/0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f) | [0x10e9bd0b70716dd9e0d41ca274a5846ff513e2b7](https://monadscan.com/address/0x10e9bd0b70716dd9e0d41ca274a5846ff513e2b7) |
| FPMM implementation      | [0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30](https://monadscan.com/address/0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30) | ❌ Implementation                                                                                                       |
| FPMM pool: GBPm/USDm     | [0xD0E9c1a718D2a693d41eacd4B2696180403Ce081](https://monadscan.com/address/0xD0E9c1a718D2a693d41eacd4B2696180403Ce081) | —                                                                                                                      |
| FPMM pool: USDC/USDm     | [0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5](https://monadscan.com/address/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5) | —                                                                                                                      |
| FPMM pool: AUSD/USDm     | [0xb0a0264Ce6847F101b76ba36A4a3083ba489F501](https://monadscan.com/address/0xb0a0264Ce6847F101b76ba36A4a3083ba489F501) | —                                                                                                                      |
| FPMM pool: USDm/USDT0    | [0x0A59be741AD49c6C2E0a2d30a57eD8f5ffa5DEB8](https://monadscan.com/address/0x0A59be741AD49c6C2E0a2d30a57eD8f5ffa5DEB8) | —                                                                                                                      |
| FPMM pool: EURm/USDm     | [0x93e15A22fDa39FEfcCCe82D387A09cCF030EAD61](https://monadscan.com/address/0x93e15A22fDa39FEfcCCe82D387A09cCF030EAD61) | —                                                                                                                      |
| FPMM pool: JPYm/USDm     | [0x4DF3f08977743Ad95aB31b8dC203EAe885Ae9D32](https://monadscan.com/address/0x4DF3f08977743Ad95aB31b8dC203EAe885Ae9D32) | —                                                                                                                      |
| FPMM pool: USDm/CHFm     | [0xDC81135fD82f02Cae736E261FB676B716663e8b8](https://monadscan.com/address/0xDC81135fD82f02Cae736E261FB676B716663e8b8) | —                                                                                                                      |
| BreakerBox               | [0x9fc1E0d10fb38954Da385B8B25aB2BbaF3241722](https://monadscan.com/address/0x9fc1E0d10fb38954Da385B8B25aB2BbaF3241722) | ❌ Non-upgradable                                                                                                       |
| MarketHoursBreaker       | [0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF](https://monadscan.com/address/0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF) | —                                                                                                                      |
| MedianDeltaBreaker       | [0x3E4F2Bca4f7192Be4C3c5E5bD4840F2E90a8Ba84](https://monadscan.com/address/0x3E4F2Bca4f7192Be4C3c5E5bD4840F2E90a8Ba84) | ❌ Non-upgradable                                                                                                       |
| ValueDeltaBreaker        | [0xca2e7563dfC30bc94687F3deAcF682E1dBAffA13](https://monadscan.com/address/0xca2e7563dfC30bc94687F3deAcF682E1dBAffA13) | ❌ Non-upgradable                                                                                                       |
| SortedOracles            | [0x6f92C745346057a61b259579256159458a0a6A92](https://monadscan.com/address/0x6f92C745346057a61b259579256159458a0a6A92) | [0xbEe346578929D70F02C3c236D709F0EfFb0cb192](https://monadscan.com/address/0xbEe346578929D70F02C3c236D709F0EfFb0cb192) |
| StableTokenSpoke         | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) | ❌ Implementation                                                                                                       |
| GBPm                     | [0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1](https://monadscan.com/address/0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| USDm                     | [0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115](https://monadscan.com/address/0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| EURm                     | [0x4D502d735B4C574B487Ed641ae87cEaE884731C7](https://monadscan.com/address/0x4D502d735B4C574B487Ed641ae87cEaE884731C7) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| JPYm                     | [0x22f6A6752800eAB67b84748FeFc3cC658384aF72](https://monadscan.com/address/0x22f6A6752800eAB67b84748FeFc3cC658384aF72) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| CHFm                     | [0xF64e91fFEf7ef43aA314F0Bc2AC39f770797990C](https://monadscan.com/address/0xF64e91fFEf7ef43aA314F0Bc2AC39f770797990C) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://monadscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| {% endtab %}             |                                                                                                                        |                                                                                                                        |

{% tab title="Polygon Mainnet (137)" %}

| Contract                 | Address                                                                                                                  | Implementation                                                                                                           |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| ChainlinkRelayerFactory  | [0x71c2333928Af2dB247d9C0aa380DF1cCCa53899A](https://polygonscan.com/address/0x71c2333928Af2dB247d9C0aa380DF1cCCa53899A) | [0x9aFd679045B571066a6d8491C25d2D6ba5431d3f](https://polygonscan.com/address/0x9aFd679045B571066a6d8491C25d2D6ba5431d3f) |
| FPMMFactory              | [0xa849b475FE5a4B5C9C3280152c7a1945b907613b](https://polygonscan.com/address/0xa849b475FE5a4B5C9C3280152c7a1945b907613b) | [0xCC5bB0ba252082213ce1303CBfbA8D56CD872A8a](https://polygonscan.com/address/0xCC5bB0ba252082213ce1303CBfbA8D56CD872A8a) |
| FactoryRegistry          | [0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6](https://polygonscan.com/address/0x7b2f7d11eabD576782f77bF2CcA46a853410AdF6) | [0x8124b66595Ff4E79B7F0c1b1101AFa501d219311](https://polygonscan.com/address/0x8124b66595Ff4E79B7F0c1b1101AFa501d219311) |
| OracleAdapter            | [0xa472fBBF4b890A54381977ac392BdF82EeC4383a](https://polygonscan.com/address/0xa472fBBF4b890A54381977ac392BdF82EeC4383a) | [0xc1B767756F582d124E76BB3e246f31e6aB256059](https://polygonscan.com/address/0xc1B767756F582d124E76BB3e246f31e6aB256059) |
| Router                   | [0x1Eb1D6692057949D6129ee7742C53be019b22408](https://polygonscan.com/address/0x1Eb1D6692057949D6129ee7742C53be019b22408) | —                                                                                                                        |
| ReserveV2                | [0x4255Cf38e51516766180b33122029A88Cb853806](https://polygonscan.com/address/0x4255Cf38e51516766180b33122029A88Cb853806) | [0xC16d23E4789e2B214D71C1Df7820a4dDAb1Df5FF](https://polygonscan.com/address/0xC16d23E4789e2B214D71C1Df7820a4dDAb1Df5FF) |
| ReserveLiquidityStrategy | [0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B](https://polygonscan.com/address/0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B) | [0x420FbDB50dadF0286144BFF91ed62A6893dee148](https://polygonscan.com/address/0x420FbDB50dadF0286144BFF91ed62A6893dee148) |
| OpenLiquidityStrategy    | [0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f](https://polygonscan.com/address/0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f) | [0x10e9bd0b70716dd9e0d41ca274a5846ff513e2b7](https://polygonscan.com/address/0x10e9bd0b70716dd9e0d41ca274a5846ff513e2b7) |
| FPMM implementation      | [0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30](https://polygonscan.com/address/0x8cB0518a0510Ab62450F79f3cD9EE0cbdDB77F30) | ❌ Implementation                                                                                                         |
| FPMM pool: USDC/USDm     | [0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5](https://polygonscan.com/address/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5) | —                                                                                                                        |
| FPMM pool: EURm/USDm     | [0x93e15A22fDa39FEfcCCe82D387A09cCF030EAD61](https://polygonscan.com/address/0x93e15A22fDa39FEfcCCe82D387A09cCF030EAD61) | —                                                                                                                        |
| FPMM pool: EURm/EUROP    | [0xCd8C6811d975981F57E7fB32e59f0BeE66aF3201](https://polygonscan.com/address/0xCd8C6811d975981F57E7fB32e59f0BeE66aF3201) | —                                                                                                                        |
| BreakerBox               | [0x9fc1E0d10fb38954Da385B8B25aB2BbaF3241722](https://polygonscan.com/address/0x9fc1E0d10fb38954Da385B8B25aB2BbaF3241722) | ❌ Non-upgradable                                                                                                         |
| MarketHoursBreaker       | [0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF](https://polygonscan.com/address/0x0A18B8e7338eF8d6025529257aA5CCd5A14e0DAF) | —                                                                                                                        |
| MedianDeltaBreaker       | [0x3E4F2Bca4f7192Be4C3c5E5bD4840F2E90a8Ba84](https://polygonscan.com/address/0x3E4F2Bca4f7192Be4C3c5E5bD4840F2E90a8Ba84) | ❌ Non-upgradable                                                                                                         |
| ValueDeltaBreaker        | [0xca2e7563dfC30bc94687F3deAcF682E1dBAffA13](https://polygonscan.com/address/0xca2e7563dfC30bc94687F3deAcF682E1dBAffA13) | ❌ Non-upgradable                                                                                                         |
| SortedOracles            | [0x6f92C745346057a61b259579256159458a0a6A92](https://polygonscan.com/address/0x6f92C745346057a61b259579256159458a0a6A92) | [0xbEe346578929D70F02C3c236D709F0EfFb0cb192](https://polygonscan.com/address/0xbEe346578929D70F02C3c236D709F0EfFb0cb192) |
| StableTokenSpoke         | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://polygonscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) | ❌ Implementation                                                                                                         |
| EURm                     | [0x4D502d735B4C574B487Ed641ae87cEaE884731C7](https://polygonscan.com/address/0x4D502d735B4C574B487Ed641ae87cEaE884731C7) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://polygonscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| USDm                     | [0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115](https://polygonscan.com/address/0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115) | [0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e](https://polygonscan.com/address/0x6A8ff60A89F3f359Fa16F45076d6DD1712B5e62e) |
| {% endtab %}             |                                                                                                                          |                                                                                                                          |

{% tab title="Celo Sepolia (11142220)" %}

| Contract                     | Address                                                                                                                      | Implementation                                                                                                               |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| FPMMFactory                  | [0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980](https://sepolia.celoscan.io/address/0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980) | [0x5e2a42d760aa6969c3da49b249ec181115887391](https://sepolia.celoscan.io/address/0x5e2a42d760aa6969c3da49b249ec181115887391) |
| FactoryRegistry              | [0x47Cb00322E9cd6196915629EDD4De1EA92F98561](https://sepolia.celoscan.io/address/0x47Cb00322E9cd6196915629EDD4De1EA92F98561) | [0xca73ea6193341d676ae9f5771d797eee8d83bad6](https://sepolia.celoscan.io/address/0xca73ea6193341d676ae9f5771d797eee8d83bad6) |
| OracleAdapter                | [0x26eFF54e2f0E8825996b83119b7Df5ef2C882dD7](https://sepolia.celoscan.io/address/0x26eFF54e2f0E8825996b83119b7Df5ef2C882dD7) | [0x9ca4fa8253f14cff40e42970df38799a78d3c482](https://sepolia.celoscan.io/address/0x9ca4fa8253f14cff40e42970df38799a78d3c482) |
| Router                       | [0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd](https://sepolia.celoscan.io/address/0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd) | —                                                                                                                            |
| ReserveV2                    | [0xbCdc1D0b92DfceEaa0FcD0a0D53355F4bF1DB8a7](https://sepolia.celoscan.io/address/0xbCdc1D0b92DfceEaa0FcD0a0D53355F4bF1DB8a7) | [0x9af42d11e808d0d6d16cfa676769aafa0da9644d](https://sepolia.celoscan.io/address/0x9af42d11e808d0d6d16cfa676769aafa0da9644d) |
| ReserveLiquidityStrategy     | [0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8](https://sepolia.celoscan.io/address/0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8) | [0x625bd9cc583b5f9a88a38b0657ce816a3f02d367](https://sepolia.celoscan.io/address/0x625bd9cc583b5f9a88a38b0657ce816a3f02d367) |
| CDPLiquidityStrategy         | [0x065AE7D4e207C8f4dca112D0B79E668cc7e93e03](https://sepolia.celoscan.io/address/0x065AE7D4e207C8f4dca112D0B79E668cc7e93e03) | [0x7d66d42cff1374af6790dab5801f21e1edc91248](https://sepolia.celoscan.io/address/0x7d66d42cff1374af6790dab5801f21e1edc91248) |
| FPMM implementation          | [0x43cB9D6AcF1462356303079EA4FDd8bc30042a6A](https://sepolia.celoscan.io/address/0x43cB9D6AcF1462356303079EA4FDd8bc30042a6A) | ❌ Implementation                                                                                                             |
| FPMM pool: GBPm/USDm         | [0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e](https://sepolia.celoscan.io/address/0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e) | —                                                                                                                            |
| FPMM pool: axlUSDC/USDm      | [0xF1B77Ffc1F71b21b6c69876CEDAf82340803dE75](https://sepolia.celoscan.io/address/0xF1B77Ffc1F71b21b6c69876CEDAf82340803dE75) | —                                                                                                                            |
| FPMM pool: USDC/USDm         | [0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb](https://sepolia.celoscan.io/address/0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb) | —                                                                                                                            |
| FPMM pool: USDT/USDm         | [0xd1a70F43B2A95384DD2a7D7b259293328B3974f8](https://sepolia.celoscan.io/address/0xd1a70F43B2A95384DD2a7D7b259293328B3974f8) | —                                                                                                                            |
| BreakerBox                   | [0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE](https://sepolia.celoscan.io/address/0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE) | ❌ Non-upgradable                                                                                                             |
| MarketHoursBreaker           | [0x99C968Bf5972C11442654b989B7eAD0237cA654B](https://sepolia.celoscan.io/address/0x99C968Bf5972C11442654b989B7eAD0237cA654B) | —                                                                                                                            |
| VirtualPoolFactory           | [0x887955f28723B0e9Bddc358448CB5B1FDe692da4](https://sepolia.celoscan.io/address/0x887955f28723B0e9Bddc358448CB5B1FDe692da4) | —                                                                                                                            |
| Broker (v2)                  | [0xB9Ae2065142EB79b6c5EB1E8778F883fad6B07Ba](https://sepolia.celoscan.io/address/0xB9Ae2065142EB79b6c5EB1E8778F883fad6B07Ba) | —                                                                                                                            |
| BiPoolManager (v2)           | [0xeCB3C656C131fCd9bB8D1d80898716bD684feb78](https://sepolia.celoscan.io/address/0xeCB3C656C131fCd9bB8D1d80898716bD684feb78) | —                                                                                                                            |
| Reserve (v2)                 | [0x2bC2D48735842924C508468C5A02580aD4F6d99A](https://sepolia.celoscan.io/address/0x2bC2D48735842924C508468C5A02580aD4F6d99A) | —                                                                                                                            |
| SortedOracles                | [0xfaa7Ca2B056E60F6733aE75AA0709140a6eAfD20](https://sepolia.celoscan.io/address/0xfaa7Ca2B056E60F6733aE75AA0709140a6eAfD20) | [0x0514884378460d86528658543bc8093d8178d7b1](https://sepolia.celoscan.io/address/0x0514884378460d86528658543bc8093d8178d7b1) |
| ChainlinkRelayerFactory      | [0xd96f786f5a294fb7cbb0847307293b7A871B9d5a](https://sepolia.celoscan.io/address/0xd96f786f5a294fb7cbb0847307293b7A871B9d5a) | [0x436a0ec7f23533e4ad109ecab4acf325d2173c28](https://sepolia.celoscan.io/address/0x436a0ec7f23533e4ad109ecab4acf325d2173c28) |
| ConstantSumPricingModule     | [0x3b199d9EbEbe509bb711BfFb455c2d79102A9602](https://sepolia.celoscan.io/address/0x3b199d9EbEbe509bb711BfFb455c2d79102A9602) | ❌ Non-upgradable                                                                                                             |
| ConstantProductPricingModule | [0x2584a5835e3aE7E901e6462E1de06920c2C68028](https://sepolia.celoscan.io/address/0x2584a5835e3aE7E901e6462E1de06920c2C68028) | ❌ Non-upgradable                                                                                                             |
| MedianDeltaBreaker           | [0xd29B4e743F7B84D63fBF9149B6D983DF2eF5C952](https://sepolia.celoscan.io/address/0xd29B4e743F7B84D63fBF9149B6D983DF2eF5C952) | ❌ Non-upgradable                                                                                                             |
| ValueDeltaBreaker            | [0x03CDf2966185Eb0b980f2481Ad386B8aFdAB4534](https://sepolia.celoscan.io/address/0x03CDf2966185Eb0b980f2481Ad386B8aFdAB4534) | ❌ Non-upgradable                                                                                                             |
| StableTokenV3 v3.0.0         | [0xdbd4ea7ce0b15c9d57dc3fa47713477e4ef4fdcb](https://sepolia.celoscan.io/address/0xdbd4ea7ce0b15c9d57dc3fa47713477e4ef4fdcb) | —                                                                                                                            |
| StableTokenV3 v3.0.1         | [0xeA3A7FCb6706dB3DdeBF8859307059d2601452E6](https://sepolia.celoscan.io/address/0xeA3A7FCb6706dB3DdeBF8859307059d2601452E6) | —                                                                                                                            |
| StableTokenV2                | [0xEd9A3541f06E45E3d92E937AA74eD878127318E0](https://sepolia.celoscan.io/address/0xEd9A3541f06E45E3d92E937AA74eD878127318E0) | —                                                                                                                            |
| USDm                         | [0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b](https://sepolia.celoscan.io/address/0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b) | [0xea3a7fcb6706db3ddebf8859307059d2601452e6](https://sepolia.celoscan.io/address/0xea3a7fcb6706db3ddebf8859307059d2601452e6) |
| GBPm                         | [0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3](https://sepolia.celoscan.io/address/0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3) | [0xea3a7fcb6706db3ddebf8859307059d2601452e6](https://sepolia.celoscan.io/address/0xea3a7fcb6706db3ddebf8859307059d2601452e6) |
| EURm                         | [0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a](https://sepolia.celoscan.io/address/0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a) | [0xea3a7fcb6706db3ddebf8859307059d2601452e6](https://sepolia.celoscan.io/address/0xea3a7fcb6706db3ddebf8859307059d2601452e6) |
| MentoToken                   | [0x07867fd40EB56b4380bE39c88D0a7EA59Aa99A20](https://sepolia.celoscan.io/address/0x07867fd40EB56b4380bE39c88D0a7EA59Aa99A20) | ❌ Non-upgradable                                                                                                             |
| MentoGovernor                | [0x23173Ac37b8E4e5a60d787aC543B3F51e8f398b4](https://sepolia.celoscan.io/address/0x23173Ac37b8E4e5a60d787aC543B3F51e8f398b4) | [0x910a940a53c12982ae2277392c5cfa03aa8c602b](https://sepolia.celoscan.io/address/0x910a940a53c12982ae2277392c5cfa03aa8c602b) |
| TimelockController           | [0x74c44Be99937815173A3C56274331e0A05611e0D](https://sepolia.celoscan.io/address/0x74c44Be99937815173A3C56274331e0A05611e0D) | [0x32346936c5baf3c7b53ea3fe40b405efd3a3e656](https://sepolia.celoscan.io/address/0x32346936c5baf3c7b53ea3fe40b405efd3a3e656) |
| {% endtab %}                 |                                                                                                                              |                                                                                                                              |
| {% endtabs %}                |                                                                                                                              |                                                                                                                              |

## CDP (Bold / Liquity v2 fork)

Contracts for the CDP (Collateralized Debt Position) system, a fork of Liquity v2 (Bold). Used by Mento v3 for GBPm and other collateralized stablecoin operations.

{% tabs %}
{% tab title="Celo Mainnet (42220)" %}

| Contract                      | Address                                                                                                              | Implementation                                                                                                       |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| AddressesRegistry             | [0xB3136DBadB14Ab587FFa91545538126938Fe0C6E](https://celoscan.io/address/0xB3136DBadB14Ab587FFa91545538126938Fe0C6E) | —                                                                                                                    |
| BorrowerOperations            | [0x8ec9A81871F816F1EF007a82293703057A943B8A](https://celoscan.io/address/0x8ec9A81871F816F1EF007a82293703057A943B8A) | —                                                                                                                    |
| TroveManager                  | [0xb38aEf2bF4e34B997330D626EBCd7629De3885C9](https://celoscan.io/address/0xb38aEf2bF4e34B997330D626EBCd7629De3885C9) | —                                                                                                                    |
| StabilityPool                 | [0x2d5d7E2767c5493610caE84E0AB7F9D2CCE8C1A5](https://celoscan.io/address/0x2d5d7E2767c5493610caE84E0AB7F9D2CCE8C1A5) | —                                                                                                                    |
| StabilityPoolGBPm             | [0x06346c0fAB682dBde9f245D2D84677592E8aaa15](https://celoscan.io/address/0x06346c0fAB682dBde9f245D2D84677592E8aaa15) | [0x2d5d7e2767c5493610cae84e0ab7f9d2cce8c1a5](https://celoscan.io/address/0x2d5d7e2767c5493610cae84e0ab7f9d2cce8c1a5) |
| SystemParams (logic)          | [0x064D8bCC79711cF51dF7Ca0a7fe531A271Cd74E9](https://celoscan.io/address/0x064D8bCC79711cF51dF7Ca0a7fe531A271Cd74E9) | ❌ Implementation                                                                                                     |
| SystemParamsProxyGBPm (proxy) | [0x70536e44d1D9238BA8E35Ffe63Bb388a63F0DE51](https://celoscan.io/address/0x70536e44d1D9238BA8E35Ffe63Bb388a63F0DE51) | [0x064d8bcc79711cf51df7ca0a7fe531a271cd74e9](https://celoscan.io/address/0x064d8bcc79711cf51df7ca0a7fe531a271cd74e9) |
| ActivePool                    | [0xa7873F4Bf2A1ea2EB20B1e8A992C4748e78473b2](https://celoscan.io/address/0xa7873F4Bf2A1ea2EB20B1e8A992C4748e78473b2) | —                                                                                                                    |
| CollSurplusPool               | [0xfFF48ee3bd2D534E35b54D538de30a9d7709d4B6](https://celoscan.io/address/0xfFF48ee3bd2D534E35b54D538de30a9d7709d4B6) | —                                                                                                                    |
| CollateralRegistry            | [0x1bEDD4334335522B0a0e8e610d326B16B0a605Fb](https://celoscan.io/address/0x1bEDD4334335522B0a0e8e610d326B16B0a605Fb) | —                                                                                                                    |
| DefaultPool                   | [0x95191e52d01eC060cEA753CDADfEEB07b78D0047](https://celoscan.io/address/0x95191e52d01eC060cEA753CDADfEEB07b78D0047) | —                                                                                                                    |
| GasPool                       | [0x8b61f941D89560C7D8b3D595F44F7fd97D79817b](https://celoscan.io/address/0x8b61f941D89560C7D8b3D595F44F7fd97D79817b) | ❌ Non-upgradable                                                                                                     |
| SortedTroves                  | [0x46D0C9e51e05D6ff38B2a19D6310488f3112Bf9b](https://celoscan.io/address/0x46D0C9e51e05D6ff38B2a19D6310488f3112Bf9b) | —                                                                                                                    |
| TroveNFT                      | [0x46273A5792013973b64a42E760E6F81d0472C6b6](https://celoscan.io/address/0x46273A5792013973b64a42E760E6F81d0472C6b6) | —                                                                                                                    |
| HintHelpers                   | [0xAfd741674bc4aa965a788dACe5b0434FD4374D82](https://celoscan.io/address/0xAfd741674bc4aa965a788dACe5b0434FD4374D82) | ❌ Non-upgradable                                                                                                     |
| MultiTroveGetter              | [0x78fd33d2bCe0389cF41e15947B0EB0cE9dF8327F](https://celoscan.io/address/0x78fd33d2bCe0389cF41e15947B0EB0cE9dF8327F) | ❌ Non-upgradable                                                                                                     |
| {% endtab %}                  |                                                                                                                      |                                                                                                                      |

{% tab title="Celo Sepolia (11142220)" %}

| Contract                      | Address                                                                                                                      | Implementation                                                                                                               |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| AddressesRegistry             | [0x8b33D626E8d79388889d404fBC515Ed131c9508e](https://sepolia.celoscan.io/address/0x8b33D626E8d79388889d404fBC515Ed131c9508e) | —                                                                                                                            |
| BorrowerOperations            | [0x7fCd2F75Ed661E76f969E6D0347a93028a099d6D](https://sepolia.celoscan.io/address/0x7fCd2F75Ed661E76f969E6D0347a93028a099d6D) | —                                                                                                                            |
| TroveManager                  | [0x3ADFF16949513480E051F451748Ee8B801731c46](https://sepolia.celoscan.io/address/0x3ADFF16949513480E051F451748Ee8B801731c46) | —                                                                                                                            |
| StabilityPool                 | [0x1c424be1BE055a6C91ED9839a0E440E26814D1fC](https://sepolia.celoscan.io/address/0x1c424be1BE055a6C91ED9839a0E440E26814D1fC) | —                                                                                                                            |
| StabilityPoolGBPm             | [0x31f4fE29B8104969209C0474A40FCa79170Ee53e](https://sepolia.celoscan.io/address/0x31f4fE29B8104969209C0474A40FCa79170Ee53e) | [0x1c424be1be055a6c91ed9839a0e440e26814d1fc](https://sepolia.celoscan.io/address/0x1c424be1be055a6c91ed9839a0e440e26814d1fc) |
| SystemParams (logic)          | [0xdf1E9330f328Ea8Fd3E974b1a2510A9791712318](https://sepolia.celoscan.io/address/0xdf1E9330f328Ea8Fd3E974b1a2510A9791712318) | ❌ Implementation                                                                                                             |
| SystemParamsProxyGBPm (proxy) | [0x70855d7826d3Ae92b2B3ae154eE6945754dD4Fe5](https://sepolia.celoscan.io/address/0x70855d7826d3Ae92b2B3ae154eE6945754dD4Fe5) | [0xdf1e9330f328ea8fd3e974b1a2510a9791712318](https://sepolia.celoscan.io/address/0xdf1e9330f328ea8fd3e974b1a2510a9791712318) |
| ActivePool                    | [0x50651599c8A778732C34d1C181EEB05Ff2Ef9d73](https://sepolia.celoscan.io/address/0x50651599c8A778732C34d1C181EEB05Ff2Ef9d73) | —                                                                                                                            |
| CollSurplusPool               | [0x4b8FD6eFe77B56a27c90eb46586c8903E8D0A63a](https://sepolia.celoscan.io/address/0x4b8FD6eFe77B56a27c90eb46586c8903E8D0A63a) | —                                                                                                                            |
| CollateralRegistry            | [0xc674b6562eaf4E40056aad628E398F58cA0b2B91](https://sepolia.celoscan.io/address/0xc674b6562eaf4E40056aad628E398F58cA0b2B91) | —                                                                                                                            |
| DefaultPool                   | [0x8f0E218fE0EB3Ef1dAF3eEAF1Cbf4Ec6d29b6fe4](https://sepolia.celoscan.io/address/0x8f0E218fE0EB3Ef1dAF3eEAF1Cbf4Ec6d29b6fe4) | —                                                                                                                            |
| GasPool                       | [0xcf0349BaffbEEb9f5c8871338415613610DC321E](https://sepolia.celoscan.io/address/0xcf0349BaffbEEb9f5c8871338415613610DC321E) | ❌ Non-upgradable                                                                                                             |
| SortedTroves                  | [0x714CBd00Be7B39A9319a434a670d51C86F994E3d](https://sepolia.celoscan.io/address/0x714CBd00Be7B39A9319a434a670d51C86F994E3d) | —                                                                                                                            |
| TroveNFT                      | [0x25B721CA74E6D0c2e3b9FD755cd2148A35CF1E84](https://sepolia.celoscan.io/address/0x25B721CA74E6D0c2e3b9FD755cd2148A35CF1E84) | —                                                                                                                            |
| HintHelpers                   | [0x5A54DD5d7AD1b782b43bB08d0A40CA947a315556](https://sepolia.celoscan.io/address/0x5A54DD5d7AD1b782b43bB08d0A40CA947a315556) | ❌ Non-upgradable                                                                                                             |
| MultiTroveGetter              | [0xED59EDfB9fCD06bb13d568ab548eC101fBb77a54](https://sepolia.celoscan.io/address/0xED59EDfB9fCD06bb13d568ab548eC101fBb77a54) | ❌ Non-upgradable                                                                                                             |
| ReserveTroveFactory           | [0xf179d705706CD959884E40B1eA21C95EC84D9E14](https://sepolia.celoscan.io/address/0xf179d705706CD959884E40B1eA21C95EC84D9E14) | —                                                                                                                            |
| ProxyAdmin                    | [0x01bd47aa7B13a75c24E3dA760f8A503c435BB4Df](https://sepolia.celoscan.io/address/0x01bd47aa7B13a75c24E3dA760f8A503c435BB4Df) | —                                                                                                                            |
| {% endtab %}                  |                                                                                                                              |                                                                                                                              |
| {% endtabs %}                 |                                                                                                                              |                                                                                                                              |


# Verification

We've built a handy tool to verify that the on-chain bytecode of deployed Mento contracts matches what has been audited. This is a bit technical and requires at least some knowledge of the stack used for smart contract development and how to use the terminal.

Before you get started make sure you have installed: git, [foundry](https://book.getfoundry.sh/getting-started/installation), node, and yarn.

1. Clone the [mento-deployments](https://github.com/mento-protocol/mento-deployment)
2. Run `forge install`
3. Run `yarn verify:bytecodes -n <network> -u <upgrade> -c <commit or tag>`

For the `verifyBytecodes` command, you need to pick three parameters as follows:

* `network` one of `baklava`, `alfajores` or `celo`
* `upgrade` currently only `MU01` exists which upgrades Mento from v1.0 to v2.0
* `commit or tag` what version of the source files to check against, this should come from the [audit report](https://docs.mento.org/mento-v3/build/smart-contracts/audits) associated with the upgrade.

For example, if we want to verify on Celo mainnet we would run this command:

```
$ yarn verify:bytecodes -n celo -u MU01 -c v2.0.0
```

<figure><img src="https://3822416892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfHYZIGlFVI2XkPqpDQjn%2Fuploads%2Fgit-blob-4f23c00752d42e69f2f1822eacbd4e247a921c82%2Fdownload.gif?alt=media" alt=""><figcaption></figcaption></figure>

#### Verification script (verifying the verifier)

In order to trust the results, you also have to trust the verification script. Luckily it's short enough to be able to read comfortably. You can find it here:

{% embed url="<https://github.com/mento-protocol/mento-deployment/blob/main/bin/verify-bytecodes.ts>" %}
verify-bytecodes.ts
{% endembed %}

The script flow is the following:

1. Check out the `mento-core` submodule at the supplied commit
2. Clean and recompile all contracts
3. Find deployed contracts by looking at the [broadcast folders](#user-content-fn-1)[^1] related to the upgrade
4. Compare the bytecode found on-chain for a deployed contract with the local compilation results
5. Print a pretty table.

[^1]: This is where Foundry stores the artifacts of on-chain operations done via scripts. We commit all relevant runs to the repository and use them to reconstruct the state of the system.


# Parameters

Deployed parameters for Mento V3 pools. The tables below document the configuration in use for **USDC/USDm**, **axlUSDC/USDm**, **USDT/USDm** (Celo), **AUSD/USDm** and **USDC/USDm** (Monad), and **GBPm/USDm** (Celo and Monad).

Unless stated otherwise, **basis points (bps)** use denominator 10,000. Governance can change parameters over time; for current on-chain configuration, see [Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses) and chain explorers.

***

## USDC/USDm, axlUSDC/USDm, USDT/USDm (Celo); AUSD/USDm, USDC/USDm (Monad)

These pools pair reserve-backed **USDm** with an external USD stablecoin. On **Celo** the deployed pools are USDC/USDm, axlUSDC/USDm, and USDT/USDm; on **Monad**, AUSD/USDm and USDC/USDm. Rebalancing uses **ReserveLiquidityStrategy**, not CDP-based liquidity.

{% tabs %}
{% tab title="Celo Mainnet" %}

| Parameter set        | Parameter                                           | Value                              |
| -------------------- | --------------------------------------------------- | ---------------------------------- |
| **Pools**            | Deployed pools                                      | USDC/USDm, axlUSDC/USDm, USDT/USDm |
| **FPMM**             | LP fee (φ\_LP)                                      | 3 bps                              |
| **FPMM**             | Protocol fee (φ\_protocol)                          | 2 bps                              |
| **FPMM**             | Total fee (φ\_total)                                | 5 bps                              |
| **FPMM**             | Rebalance incentive (ρ)                             | 1 bps                              |
| **FPMM**             | Rebalance threshold above (θ\_above)                | 5000 bps                           |
| **FPMM**             | Rebalance threshold below (θ\_below)                | 3333 bps                           |
| **Reserve Strategy** | debtToken                                           | USDm                               |
| **Reserve Strategy** | rebalanceCooldown                                   | 300 s                              |
| **Reserve Strategy** | protocolIncentiveExpansion / Contraction            | 0 %                                |
| **Reserve Strategy** | liquiditySourceIncentiveExpansion / Contraction     | 0 %                                |
| **Oracle feed**      | Chainlink deviation threshold (USDC/USD, USDT/USD)† | 0.5 %                              |
| **Oracle feed**      | Chainlink heartbeat (USDC/USD, USDT/USD)†           | 240 s                              |
| **Oracle feed**      | SortedOracles report expiry (v2 reference)          | 360 s                              |
| **Risk controls**    | ValueDeltaBreaker threshold (USDC/USD, USDT/USD)    | 0.15 %                             |
| **Risk controls**    | TradingLimitsV2 (each pool token) — 5 minutes       | 500,000                            |
| **Risk controls**    | TradingLimitsV2 (each pool token) — 1 day           | 1,000,000                          |

† External Chainlink feed settings; not configurable by Mento governance.
{% endtab %}

{% tab title="Monad" %}

| Parameter set        | Parameter                                           | Value                |
| -------------------- | --------------------------------------------------- | -------------------- |
| **Pools**            | Deployed pools                                      | AUSD/USDm, USDC/USDm |
| **FPMM**             | LP fee (φ\_LP)                                      | 3 bps                |
| **FPMM**             | Protocol fee (φ\_protocol)                          | 2 bps                |
| **FPMM**             | Total fee (φ\_total)                                | 5 bps                |
| **FPMM**             | Rebalance incentive (ρ)                             | 1 bps                |
| **FPMM**             | Rebalance threshold above (θ\_above)                | 5000 bps             |
| **FPMM**             | Rebalance threshold below (θ\_below)                | 3333 bps             |
| **Reserve Strategy** | debtToken                                           | USDm                 |
| **Reserve Strategy** | rebalanceCooldown                                   | 300 s                |
| **Reserve Strategy** | protocolIncentiveExpansion / Contraction            | 0 %                  |
| **Reserve Strategy** | liquiditySourceIncentiveExpansion / Contraction     | 0 %                  |
| **Oracle feed**      | Chainlink deviation threshold (USDC/USD, AUSD/USD)† | 0.05 %               |
| **Oracle feed**      | Chainlink heartbeat (USDC/USD, AUSD/USD)†           | 3600 s               |
| **Oracle feed**      | SortedOracles report expiry (heartbeat + 2 min)     | 3720 s               |
| **Risk controls**    | ValueDeltaBreaker threshold (USDC/USD, AUSD/USD)    | 0.15 %               |
| **Risk controls**    | TradingLimitsV2 (each pool token) — 5 minutes       | 2,500,000            |
| **Risk controls**    | TradingLimitsV2 (each pool token) — 1 day           | 5,000,000            |

† External Chainlink feed settings; not configurable by Mento governance.
{% endtab %}
{% endtabs %}

***

## GBPm/USDm

Oracle-priced **GBPm/USDm** pool deployed on both Celo and Monad. **Celo** has a GBPm CDP deployment (Liquity v2) and rebalancing uses the **CDP Liquidity Strategy**. **Monad** has no CDP deployment and no CDP Liquidity Strategy; rebalancing uses **OpenLiquidityStrategy** at [0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f](https://monadscan.com/address/0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f).

{% tabs %}
{% tab title="Celo Mainnet" %}

| Parameter set     | Parameter                                                   | Value     | Units |
| ----------------- | ----------------------------------------------------------- | --------- | ----- |
| **Pools**         | Deployed pools                                              | GBPm/USDm |       |
| **FPMM**          | LP fee (φ\_LP)                                              | 20        | bps   |
| **FPMM**          | Protocol fee (φ\_protocol)                                  | 10        | bps   |
| **FPMM**          | Rebalance incentive (ρ)                                     | 6         | bps   |
| **FPMM**          | Rebalance threshold above (θ\_above)                        | 5000      | bps   |
| **FPMM**          | Rebalance threshold below (θ\_below)                        | 3333      | bps   |
| **Oracle feed**   | Chainlink deviation threshold (GBP/USD)†                    | 0.30      | %     |
| **Oracle feed**   | Chainlink heartbeat (GBP/USD)†                              | 240       | s     |
| **Oracle feed**   | SortedOracles report expiry (v2 reference)                  | 360       | s     |
| **Risk controls** | TradingLimitsV2 (USDm) — 5 minutes                          | 100,000   | USDm  |
| **Risk controls** | TradingLimitsV2 (USDm) — 1 day                              | 500,000   | USDm  |
| **Risk controls** | TradingLimitsV2 (GBPm) — 5 minutes                          | 77,000    | GBPm  |
| **Risk controls** | TradingLimitsV2 (GBPm) — 1 day                              | 385,000   | GBPm  |
| **Risk controls** | MedianDeltaBreaker threshold (relayed:GBPUSD, v2 reference) | 4         | %     |
| **Risk controls** | MedianDeltaBreaker cooldown (v2 reference)                  | 900       | s     |
| **Risk controls** | MedianDeltaBreaker smoothing factor (v2 reference)          | 0.005     | —     |
| **CDP Strategy**  | rebalanceCooldown                                           | 300       | s     |
| **CDP Strategy**  | stabilityPoolPercentage                                     | 2,000     | bps   |
| **CDP Strategy**  | maxIterations                                               | 500       | count |
| **CDP Strategy**  | liquiditySourceIncentiveExpansion                           | 0.05      | %     |
| **CDP Strategy**  | liquiditySourceIncentiveContraction (fixed trove-owner fee) | 0.05      | %     |
| **CDP Strategy**  | protocolIncentiveExpansion / Contraction                    | 0         | %     |
| **CDP Strategy**  | REDEMPTION\_SHORTFALL\_TOLERANCE                            | ≈10⁻⁶     | USDm  |

† External Chainlink feed settings; not configurable by Mento governance.
{% endtab %}

{% tab title="Monad" %}

| Parameter set          | Parameter                                | Value                                                                                                                  | Units |
| ---------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----- |
| **Pools**              | Deployed pools                           | GBPm/USDm                                                                                                              |       |
| **Liquidity strategy** | OpenLiquidityStrategy                    | [0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f](https://monadscan.com/address/0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f) | —     |
| **FPMM**               | LP fee (φ\_LP)                           | 10                                                                                                                     | bps   |
| **FPMM**               | Protocol fee (φ\_protocol)               | 5                                                                                                                      | bps   |
| **FPMM**               | Rebalance incentive (ρ)                  | 6                                                                                                                      | bps   |
| **FPMM**               | Rebalance threshold above (θ\_above)     | 5000                                                                                                                   | bps   |
| **FPMM**               | Rebalance threshold below (θ\_below)     | 3333                                                                                                                   | bps   |
| **Oracle feed**        | Chainlink deviation threshold (GBP/USD)† | 0.15                                                                                                                   | %     |
| **Oracle feed**        | Chainlink heartbeat (GBP/USD)†           | 240                                                                                                                    | s     |
| **Oracle feed**        | SortedOracles report expiry              | 360                                                                                                                    | s     |
| **Risk controls**      | TradingLimitsV2 (USDm) — 5 minutes       | 100,000                                                                                                                | USDm  |
| **Risk controls**      | TradingLimitsV2 (USDm) — 1 day           | 500,000                                                                                                                | USDm  |
| **Risk controls**      | TradingLimitsV2 (GBPm) — 5 minutes       | 77,000                                                                                                                 | GBPm  |
| **Risk controls**      | TradingLimitsV2 (GBPm) — 1 day           | 385,000                                                                                                                | GBPm  |
| **Risk controls**      | MedianDeltaBreaker threshold             | 4                                                                                                                      | %     |
| **Risk controls**      | MedianDeltaBreaker cooldown              | 900                                                                                                                    | s     |
| **Risk controls**      | MedianDeltaBreaker smoothing factor      | 0.005                                                                                                                  | —     |

† External Chainlink feed settings; not configurable by Mento governance.
{% endtab %}
{% endtabs %}

***

## CDP (Bold / Liquity v2 fork) — GBPm on Celo

The following parameters apply to the **CDP system** (Bold / Liquity v2 fork) used for GBPm on Celo. This is a separate deployment from the GBPm/USDm FPMM pool; the pool uses [CDPLiquidityStrategy](https://github.com/mento-protocol/docs/blob/main/build/deployments/smart-contracts/liquidity-strategies.md#cdpliquiditystrategy) to rebalance against the CDP. CDP contract addresses are in [Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses#cdp-bold--liquity-v2-fork).

Because Mento CDPs are **FX CDPs**, the branch price feed is gated by FX market hours through `FXPriceFeed -> OracleAdapter -> MarketHoursBreaker`. In practice, normal price-dependent trove operations, liquidations, and standard redemptions are unavailable while the FX market is closed (for example on weekends), while regular Stability Pool deposit / withdraw / claim flows remain available.

| Parameter                                             | Value        | Units |
| ----------------------------------------------------- | ------------ | ----- |
| MIN\_DEBT                                             | 1,000        | GBPm  |
| LIQUIDATION\_PENALTY\_SP                              | 5            | %     |
| LIQUIDATION\_PENALTY\_REDISTRIBUTION                  | 10           | %     |
| COLL\_GAS\_COMPENSATION\_DIVISOR                      | 200          | —     |
| COLL\_GAS\_COMPENSATION\_CAP                          | 10           | USDm  |
| ETH\_GAS\_COMPENSATION                                | 1.0          | CELO  |
| CCR                                                   | 135          | %     |
| SCR                                                   | 110          | %     |
| MCR                                                   | 110          | %     |
| BCR                                                   | 10           | %     |
| MIN\_ANNUAL\_INTEREST\_RATE                           | 0.2          | %     |
| REDEMPTION\_FEE\_FLOOR                                | 0.5          | %     |
| INITIAL\_BASE\_RATE                                   | 100          | %     |
| REDEMPTION\_MINUTE\_DECAY\_FACTOR (≈60 min half-life) | 0.9885140204 | —     |
| REDEMPTION\_BETA                                      | 1            | —     |
| SP\_YIELD\_SPLIT                                      | 75           | %     |
| MIN\_BOLD\_IN\_SP                                     | 1            | GBPm  |
| MIN\_BOLD\_AFTER\_REBALANCE                           | 5,000        | GBPm  |


# Troubleshooting

**Who this is for:** Developers and integrators debugging quote/swap failures, SDK or RPC issues, deployment/verification problems, or rebalancing with Mento V3. For **end-user** issues (getting stables, swap failed in app), see [User troubleshooting](https://github.com/mento-protocol/docs/blob/main/other/troubleshooting.md).

***

## Quick reference: why did my swap or quote revert?

The pool (and Router) can revert for these reasons. Check your revert message or transaction trace first:

| Revert / cause                       | Meaning                                                                              | What to do                                                                                                                                                       |
| ------------------------------------ | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ReserveValueDecreased**            | Swap would decrease pool value at oracle after fees (value-protection check failed). | Usually means quote was stale or fee/rate changed; re-quote and retry with a fresh amount.                                                                       |
| **TradingSuspended**                 | Circuit breaker has tripped for this feed; trading is halted.                        | Wait until breakers are reset; check [BreakerBox](https://docs.mento.org/mento-v3/build/smart-contracts/breakerbox) / OracleAdapter for the feed’s trading mode. |
| **NoRecentRate**                     | Oracle report is older than the configured expiry (stale).                           | Wait for a new oracle update or check SortedOracles / Chainlink relay for the feed.                                                                              |
| **FXMarketClosed**                   | FX market-hours breaker says the market is closed for this feed.                     | Trade during configured market hours, or use a pool that does not gate on market hours.                                                                          |
| **TradingLimitsV2** (limit exceeded) | Net flow for a token in the 5-minute or 1-day window would exceed the pool’s limit.  | Use a smaller amount, wait for the rolling window to expire, or try again later.                                                                                 |
| **Insufficient liquidity** (Router)  | Router/pool has no liquidity for the requested output.                               | Check pool reserves and that the pool exists for the pair.                                                                                                       |
| **Expired** (Router)                 | Transaction submitted after the deadline passed.                                     | Increase `deadline` (e.g. `block.timestamp + 300`) and resubmit.                                                                                                 |
| **Insufficient output** (Router)     | Output was less than `amountOutMin` (slippage).                                      | Re-quote and raise `amountOutMin` slightly or accept a lower minimum.                                                                                            |

***

## Swap and quote

### Swap reverted: value protection, limits, or oracle

Every swap is checked in this order:

1. **Oracle rate** — The pool calls `oracleAdapter.getFXRateIfValid(referenceRateFeedID)`. If the adapter reverts, the swap reverts with `TradingSuspended`, `NoRecentRate`, or `FXMarketClosed`. So: ensure the feed is recent, trading is allowed, and (if applicable) FX market is open.
2. **Value protection** — After the swap, the pool’s reserve value at the oracle must not decrease (after crediting fees). If it would, the pool reverts with `ReserveValueDecreased`. This can happen if the quote was computed with an older rate or different fee.
3. **TradingLimitsV2** — After the swap, per-token net flow in the 5-minute and 1-day windows must stay within the pool’s configured limits. If a limit would be exceeded, the swap reverts.

**Practical steps:** Re-fetch a quote immediately before sending the transaction. Use the same pool and rate feed the pool uses. If the revert is `ReserveValueDecreased`, your executed rate/fee differed from the one used for the quote. If the revert is from TradingLimitsV2, reduce size or wait. See [TradingLimitsV2](https://docs.mento.org/mento-v3/build/smart-contracts/tradinglimits) and [BreakerBox](https://docs.mento.org/mento-v3/build/smart-contracts/breakerbox).

### Quote doesn’t match execution

Quotes are valid only at the current block’s oracle rate and fee. If the user sends the tx later, the rate may have changed or the oracle may have become invalid. **Always re-fetch the quote** right before building the transaction, and use a small slippage tolerance (e.g. `amountOutMin = quote * 99 / 100`) if needed.

### getAmountOut or Router getAmountsOut fails

* **Invalid pair or pool:** Ensure the pool exists for the token pair (use [FPMMFactory](https://docs.mento.org/mento-v3/build/smart-contracts/fpmmfactory) `getPool(token0, token1)` or Router `poolFor`). Tokens must be sorted by address (`token0` < `token1`).
* **Oracle invalid:** `getAmountOut` calls the same `getFXRateIfValid` as the swap. If the oracle is suspended, stale, or market closed, the call reverts. Use `adapter.getRate(rateFeedID)` (no revert) to inspect `tradingMode`, `isRecent`, and `isFXMarketOpen` before quoting.
* **Wrong rate feed ID:** The pool’s `referenceRateFeedID` must match a feed that the OracleAdapter and BreakerBox know. Check [OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter) and [Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses) for the correct adapter and feed setup per chain.

***

## Router vs direct pool calls

* **Router:** Use the Router for **exact-input** swaps and for **mint/burn** so it handles transfers and pool calls. Approve the Router for the input token(s). The Router reverts if the pool reverts (oracle, limits, value protection) or if output < `amountOutMin` or `deadline` has passed.
* **Direct pool:** The pool’s `swap(amount0Out, amount1Out, to, data)` is **output-specified** and requires the caller to supply the input tokens (e.g. via `IFPMMCallee` hook). Prefer the Router for simple flows. See [FPMM](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm) and [Router](https://docs.mento.org/mento-v3/build/smart-contracts/router).

***

## Mint and burn (liquidity)

| Symptom                          | Cause                        | Fix                                                                                                                                                                                                                             |
| -------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Mint reverted                    | Wrong ratio or approval      | You must transfer **both** tokens to the pool in the **current reserve ratio**. Use `pool.quoteMint(amount0, amount1)` or Router `quoteAddLiquidity` to get the required amounts. Approve the pool (or Router) for both tokens. |
| Burn reverted                    | Wrong LP amount or approval  | Transfer the **LP tokens** to the pool first, then call `burn(to)`. Approve the pool (or Router) for the LP tokens. Ensure you are not burning more than the pool’s total supply.                                               |
| “Insufficient liquidity” on mint | First mint must meet minimum | The first mint uses `sqrt(amount0*amount1) - MINIMUM_LIQUIDITY`; ensure amounts are large enough.                                                                                                                               |

See [FPMM — Mint and burn](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm#mint-and-burn) and [Router](https://docs.mento.org/mento-v3/build/smart-contracts/router) for exact signatures.

***

## Rebalancing (keepers / strategies)

If you are calling `rebalance` on a pool or a liquidity strategy:

| Revert                                                                                                                   | Meaning                                                                                   | Fix                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **NotLiquidityStrategy**                                                                                                 | Caller is not allowlisted on the pool.                                                    | Only addresses set via `setLiquidityStrategy(addr, true)` can call `rebalance`.                                               |
| **PriceDifferenceTooSmall**                                                                                              | Reserve price deviation from oracle is below the pool’s threshold.                        | Check `getRebalancingState()`; only rebalance when `priceDifference >= rebalanceThreshold`.                                   |
| **PriceDifferenceNotImproved** / **PriceDifferenceMovedInWrongDirection** / **PriceDifferenceMovedTooFarFromThresholds** | Rebalance did not meet post-rebalance checks (direction preserved, no overshoot).         | Strategy must return the other token in the right amount so the new deviation is still ≥ threshold and in the same direction. |
| **InsufficientAmount0In** / **InsufficientAmount1In**                                                                    | Strategy did not send back enough of the other token (minimum repayment / incentive cap). | Strategy must return at least the minimum required by the pool’s rebalance incentive cap.                                     |

Use `pool.getRebalancingState()` to decide if and how much to rebalance. See [Liquidity strategies](https://docs.mento.org/mento-v3/build/smart-contracts/liquidity-strategies) and [FPMM — Rebalance](https://docs.mento.org/mento-v3/build/smart-contracts/fpmm#rebalance).

***

## Oracle and circuit breakers

* **TradingSuspended:** The BreakerBox has set the feed’s trading mode to suspended (e.g. MedianDeltaBreaker or ValueDeltaBreaker tripped). No swaps or quotes using that feed succeed until the breaker is reset and the cooldown has passed.
* **NoRecentRate:** The median report timestamp for the rate feed is older than `reportExpiry`. Relayers must submit a fresh price; check SortedOracles or the Chainlink relayer for that feed.
* **FXMarketClosed:** The pool uses `getFXRateIfValid`, which checks FX market hours. Use a feed without market-hours gating or wait until the market is open.

To **inspect** without reverting: call `oracleAdapter.getRate(rateFeedID)` and check `tradingMode`, `isRecent`, `isFXMarketOpen`. See [OracleAdapter](https://docs.mento.org/mento-v3/build/smart-contracts/oracleadapter) and [BreakerBox](https://docs.mento.org/mento-v3/build/smart-contracts/breakerbox).

***

## SDK and integration

| Symptom                            | Cause                              | Fix                                                                                                                                                                                                                                                                                              |
| ---------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SDK returns wrong network or pairs | Using V2 Broker instead of V3 FPMM | V3 uses **FPMM pools** and the Router for quotes and swaps, not the legacy Broker. Point the SDK at the V3 factory, Router, and pool addresses; see [Mento SDK](https://docs.mento.org/mento-v3/build/mento-sdk) and [Deployments](https://docs.mento.org/mento-v3/build/deployments/addresses). |
| Wrong or stale quote               | Caching or wrong pool              | Ensure you are querying the correct pool for the token pair and re-fetch quotes before sending a transaction.                                                                                                                                                                                    |
| RPC or provider errors             | Wrong RPC URL or chain             | Use a supported chain (e.g. Celo, Monad) and a valid RPC endpoint. See [Deployments](https://docs.mento.org/mento-v3/build/deployments) and [Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses).                                                                            |

***

## Contracts and deployments

| Symptom                         | Cause                                  | Fix                                                                                                                                                                        |
| ------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Wrong pool or router address    | Outdated or wrong chain                | Use [Deployments → Addresses](https://docs.mento.org/mento-v3/build/deployments/addresses) for the chain you are on; verify factory, Router, and pool on a block explorer. |
| Pool not found for pair         | Pool not deployed or wrong token order | Factory returns `getPool(token0, token1)` with tokens sorted by address. Ensure the pool is deployed for that pair on the correct factory.                                 |
| Verification failed on explorer | Source or constructor args             | Follow [Verification](https://docs.mento.org/mento-v3/build/deployments/verification) for the correct compiler settings and constructor arguments.                         |

***

## More

* [Integration](https://docs.mento.org/mento-v3/build/integration) — How to integrate stables and oracles.
* [Smart contracts](https://docs.mento.org/mento-v3/build/smart-contracts) — FPMM, Router, OracleAdapter, TradingLimitsV2, BreakerBox.
* [Deployments](https://docs.mento.org/mento-v3/build/deployments) — Addresses, verification, parameters.
* [User troubleshooting](https://github.com/mento-protocol/docs/blob/main/other/troubleshooting.md) — End-user issues (getting stables, swap in app, CDP).


# Getting Mento Stables

**One way to use Mento V3 is to obtain Mento stablecoins:** USDm (Mento Dollar), EURm (Mento Euro), GBPm (Mento Pound), and others. This page lists the main paths. It assumes you know what Mento V3 is from [Overview](https://docs.mento.org/mento-v3).

***

## What are Mento stablecoins?

**Mento stablecoins** are assets that aim to track a fiat currency (e.g. USD, EUR, GBP). They are **one use case** of the Mento V3 DEX: many FPMM pools pair a Mento stable (e.g. USDm) with an external stable (e.g. USDC, USDT) or with another asset. You can get Mento stables by **swapping** in those pools (at the oracle rate) or by **borrowing** (e.g. GBPm via a CDP). You do **not** need prior knowledge of “minting” or “reserves”; the main user-facing actions are **swap** and **borrow**.

***

## Paths to get Mento stables

| Path                                | When to use it                                                                   | Where                                                                                                                                                                                    |
| ----------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Mento app (swap)**                | You have USDC, USDT, EUROC, or another supported token and want USDm, EURm, etc. | [app.mento.org](https://app.mento.org/?chain=42220) — connect wallet, choose pair, swap at oracle rate.                                                                                  |
| **Mento app (borrow)**              | You want to borrow a Mento stable (e.g. GBPm) against collateral.                | [app.mento.org](https://app.mento.org/borrow?chain=42220) — CDP / borrow flow.                                                                                                           |
| **On Celo**                         | You are on Celo and want to swap or add liquidity on Celo.                       | Same app; select Celo network. See [On Celo](https://docs.mento.org/mento-v3/other/getting-mento-stables/on-celo) for Celo-specific notes.                                               |
| **On mobile**                       | You prefer a mobile wallet or app.                                               | See [On mobile](https://docs.mento.org/mento-v3/other/getting-mento-stables/on-mobile).                                                                                                  |
| **From another chain**              | You hold assets on another chain and want Mento stables.                         | Bridge to a chain where Mento V3 is deployed, then use the app or a DEX there. See [From other chains](https://docs.mento.org/mento-v3/other/getting-mento-stables/from-other-chains).   |
| **Via centralized exchanges (CEX)** | You want to buy/sell Mento stables on a CEX.                                     | See [Via centralized exchanges](https://docs.mento.org/mento-v3/other/getting-mento-stables/via-centralized-exchanges). Check whether USDm, EURm, GBPm are listed and on which networks. |
| **On-ramp providers**               | You want to buy crypto with fiat (card/bank) into your wallet.                   | See [On-ramp providers](https://docs.mento.org/mento-v3/other/getting-mento-stables/on-ramp-providers).                                                                                  |

***

## Recommended starting point

For most users, the simplest path is:

1. Go to [**app.mento.org**](https://app.mento.org/?chain=42220).
2. Connect your wallet on a supported chain (e.g. Celo).
3. To **get USDm or EURm**: choose the pair (e.g. USDC ↔ USDm) and **swap** at the oracle rate.
4. To **get GBPm** (or other CDP-backed stables): use the **borrow** flow (collateralize and borrow).

For **swap and liquidity** in general (not only “getting stables”), see [Swap & liquidity (FPMM operations)](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md).

***

## Next steps

* [Earn Merkl rewards on Monad (FPMMs)](https://docs.mento.org/mento-v3/other/merkl-fpmm-rewards-monad) — Provide liquidity to USDC/USDm and GBPm/USDm on Monad and earn campaign rewards (launched March 2026).
* [Swap & liquidity (FPMM operations)](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md) — How to swap and add/remove liquidity.
* [Overview](https://docs.mento.org/mento-v3) — DEX for FX, FPMMs, and where Mento stables fit in.
* [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) — How pools and the oracle rate work.
* [Troubleshooting](https://github.com/mento-protocol/docs/blob/main/other/troubleshooting.md) — Common issues when swapping or getting stables.


# On Celo

Mento stables are available on the Celo blockchain. This guide covers how to get USDm, EURm, BRLm, XOFm, and GBPm on Celo.

## Swap at oracle rate (USDm, EURm, BRLm, XOFm)

The most direct way to get these Mento stables on Celo is by swapping on the Mento protocol. FPMM pools use **oracle-based rates**: you get the same rate you see off-chain for the pair (e.g. EUR/USD). **There is no slippage** — the rate is fixed by the oracle for your trade size.

### Using the Mento app

1. Visit [app.mento.org](https://app.mento.org/?chain=42220)
2. Connect your wallet and **select the Celo network**
3. Select your **input token** (e.g. USDC, USDT, EUROC)
4. Choose your desired stable (USDm, EURm, BRLm, XOFm)
5. Enter amount and confirm the swap

The app shows the oracle rate and fees upfront. No curve, no slippage. In the backing model documented for **Mento V3**, **USDm** and **EURm** are Reserve-backed, while **GBPm** is CDP-backed.

## GBPm: borrow via CDP

**GBPm is different.** It is not minted by the Reserve like USDm or EURm. You can get GBPm by **borrowing it into existence** against collateral (USDm) in a **CDP (Collateralized Debt Position)**. This is often the main route for sourcing GBPm on Celo.

1. Visit [app.mento.org](https://app.mento.org/borrow?chain=42220) and connect your wallet on Celo.
2. Open **Borrow**. Select **GBPm** in the currency dropdown, then **+ Open Your First Trove**.
3. Deposit **USDm** as collateral and borrow **GBPm**. Set your interest rate; there is no fixed repayment schedule. Keep your collateral ratio above the minimum to avoid liquidation.

For a step-by-step walkthrough, see [**Borrow a stable (e.g. GBPm)**](https://docs.mento.org/mento-v3/get-started/quick-start-guides#-borrow-a-stable-eg-gbpm) in the Quick Start Guides.

For protocol details (troves, liquidations, Stability pool), see [CDPs](https://docs.mento.org/mento-v3/dive-deeper/cdp).

## Other venues (DEXs)

Some DEXs on Celo list pairs that include Mento stables (e.g. USDm/USDC). You can use them if you prefer; rates and liquidity vary. For oracle-priced swaps with no slippage, use the [Mento app](https://app.mento.org/?chain=42220) directly.

## Need help?

* [Troubleshooting](https://github.com/mento-protocol/docs/blob/main/other/troubleshooting.md) — common issues when swapping or getting stables
* [Mento Discord](https://discord.com/invite/7CXxS5ub96)


# On Mobile

Mobile wallets provide the easiest way for users to access and use Mento stables directly from their smartphones. Two primary options are available: Valora and MiniPay, both offering unique features for different user needs.

## Valora Wallet

Valora is a mobile-first crypto wallet that makes saving, sending and spending crypto as easy as sending a text. Available on both iOS and Android, Valora provides comprehensive support for all Mento stables.

#### Key Features

* **Full Mento stable support**: Hold USDm, EURm, and BRLm in your Valora wallet
* **Simple swaps**: Convert between CELO and Mento stables directly in-app
* **Phone number sending**: Send to contacts using just their phone number
* **DeFi integration**: Access Celo DeFi protocols directly from the wallet

#### Getting Started with Valora

1. Download Valora from [App Store](https://apps.apple.com/app/valora/id1520414263) or [Google Play](https://play.google.com/store/apps/details?id=co.clabs.valora)
2. Create or import a wallet
3. Fund your wallet with CELO via:
   * Bank transfer (through partners)
   * Crypto transfer from another wallet
   * On-ramp providers like Ramp
4. Swap CELO to USDm, EURm, BRLm and others using the in-app exchange

Learn more at [valora.xyz](https://valora.xyz/)

## MiniPay Wallet

MiniPay is a self-custodial stablecoin wallet built on the Celo blockchain and integrated into the Opera Mini browser. Originally launched in Africa where it has over 3 million users, MiniPay is now available globally as a standalone app.

#### Key Features

* **Phone number based**: Sending with MiniPay is like sending a text, done in 5 seconds. All you need is a phone number.
* **Pockets feature (Powered by Mento)**: One-click swaps between three stablecoins with drag-and-drop interface

#### Getting Started with MiniPay

1. Download MiniPay from [App Store](https://apps.apple.com/app/minipay) or [Google Play](https://play.google.com/store/apps/details?id=com.opera.minipay)
2. Create account with Google sign-in
3. Verify phone number
4. Add funds using available methods

Learn more at [minipay.to](https://minipay.to/)

## Security Considerations

Both wallets are self-custodial, meaning:

* You control your private keys
* No third party can access your funds
* Backup mechanisms protect against device loss
* Biometric authentication for transactions

## Best Practices

1. **Always verify recipient numbers** before sending
2. **Keep your recovery method secure** (seed phrase for Valora, Google account for MiniPay)
3. **Start with small amounts** when testing new features
4. **Enable biometric security** for transaction approval
5. **Regular backups** of your wallet credentials

### Next Steps

* [Getting Stables on Celo](https://docs.mento.org/mento-v3/other/getting-mento-stables/on-celo) - Other ways to acquire Mento stables
* [Bridge from Other Chains](https://docs.mento.org/mento-v3/other/getting-mento-stables/from-other-chains) - Cross-chain options
* [Using the Mento Web App](https://app.mento.org/?chain=42220) - Desktop trading interface


# From Other Chains

Bridge assets from other blockchains to Celo and swap them for Mento stables. This guide covers the main bridging options and step-by-step instructions for obtaining USDm, EURm, BRLm, and XOFm from external chains.

## Overview

To get Mento stables from other chains, you'll typically:

1. Bridge assets (like USDC, ETH, or other tokens) to Celo
2. Swap the bridged assets for Mento stables using the Mento protocol or DEXs

The most common path is bridging USDC and then swapping it 1:1 for USDm through Mento.

## Squid Router

SquidRouter V2 serves as an easy tool to access Mento stables. It allows you to mint and redeem Mento stables with other Celo assets and assets on various other blockchains. Squid also enables cross-chain swaps.

### Key Features

* **One-click cross-chain swaps**: Get Mento stables directly from any supported chain
* **Wide chain support**: Works with Ethereum, Arbitrum, Polygon, BSC, and 20+ other chains

### How to Use Squid

1. Visit [app.squidrouter.com](https://app.squidrouter.com/)
2. Connect your wallet
3. Select source chain and token (e.g., USDC on Ethereum)
4. Select Celo as destination chain
5. Choose your desired Mento stable (USDm, EURm, etc.)
6. Review rates and fees
7. Approve and execute the swap

## Portal Bridge (Wormhole)

You can also bridge using the the Portal Token Bridge powered by the Wormhole protocol.

### How to Bridge with Portal

1. Go to [portalbridge.com](https://portalbridge.com/)
2. Connect your wallet
3. Select source network (e.g., Ethereum)
4. Select Celo as target network
5. Choose token and amount
6. Approve token spending
7. Complete the bridge transaction

Tokens bridged using the Portal bridge will arrive in your wallet within a few minutes after completing the transaction.

### After Bridging

Once your tokens arrive on Celo:

* Swap to Mento stables on [app.mento.org](https://app.mento.org/?chain=42220)
* Or use DEXs like Uniswap, Curve, or Ubeswap

## Multichain Future with Wormhole NTT

Mento is expanding its decentralized onchain FX capabilities to other blockchains by [integrating with Wormhole](https://www.mento.org/blog/mento-selects-wormhole-as-its-official-interoperability-provider-to-power-multichain-fx) and its Native Token Transfers (NTT) standard. This will enable:

* Movement of multi-currency stablecoins across 40+ blockchains with native issuance and redemption
* Multichain FX trading between 17+ stablecoins (including USDT and USDC) with real-time price execution
* Direct Mento stable access on multiple chains without bridging to Celo first

## Best Practices

### Compare Options

* **For specific tokens**: Check which bridge supports your asset
* **For best rates**: Compare fees between bridges

### Security Tips

* Always verify bridge URLs before connecting
* Start with small test amounts
* Check recipient addresses on Celo explorer
* Keep some CELO for gas fees

### Gas Considerations

* Bridge fees vary by network congestion
* Factor in both source chain and Celo fees

## Need Help?

* Check bridge documentation for specific issues
* Join [Mento Discord](https://discord.com/invite/7CXxS5ub96) for support
* Verify transactions on [Celo Explorer](https://explorer.celo.org/)


# Via Centralized Exchanges

Centralized exchanges (CEXs) provide fiat on-ramps and simplified trading interfaces for acquiring assets that can be swapped for Mento stables. While some exchanges list Mento stables directly, most users will need to first acquire CELO or stablecoins and then swap on-chain.

## Direct Listings

Some Mento stable assets trade directly on centralized exchanges. To find current listings:

1. Go to [CoinGecko](https://www.coingecko.com/)
2. Search for the Mento stable you are interested in
3. Click the market tab to show which exchanges or pools the stable can be found in.

## Common Route: CELO to Mento Stables

Most users acquire Mento stables by:

1. Buying CELO on a centralized exchange
2. Withdrawing CELO to a Celo wallet
3. Swapping CELO for desired Mento stables

### Major Exchanges Supporting CELO

* **Binance** - Wide availability, multiple trading pairs
* **Coinbase** - User-friendly, good for beginners
* **KuCoin** - Available in many regions
* **Gate.io** - Supports CELO deposits/withdrawals
* **OKX** - Growing CELO support

### How to Get Mento Stables

1. **Purchase CELO**
   * Create and verify exchange account
   * Deposit fiat or crypto
   * Buy CELO on spot market
2. **Withdraw to Celo**
   * Select CELO withdrawal
   * **Important**: Choose "Celo" network (not Ethereum)
   * Enter your Celo wallet address
   * Confirm withdrawal
3. **Swap for Mento Stables**
   * Visit [app.mento.org](https://app.mento.org/?chain=42220)
   * Connect wallet with CELO
   * Swap CELO → USDm, EURm, etc

## Stablecoin Route

If your exchange supports USDC or USDT on Celo:

1. Buy USDC/USDT on the exchange
2. Withdraw to Celo network (if available)
3. Swap for Mento stables at near 1:1 rates


# On-ramp Providers

If you don't want to use centralized exchanges and on-ramp crypto assets directly into your decentralized non-custodial wallet, you can use several on-ramp providers to do so.

With on-ramp providers, you can buy Mento stable assets directly with a credit card or from a bank account. You will need to create an account and provide identity identification before you can use their services.

For example, these providers offer direct access to USDm: [MoonPay](https://www.moonpay.com/buy), [Ramp](https://ramp.network/buy), [Bitmama](https://bitmama.io/), [Paychant](https://paychant.com/buy-crypto), [Cashramp](https://cashramp.co/), [Fonbnk](https://fonbnk.com/) and [Banxa](https://banxa.com/).


# Earn Merkl rewards on Monad (FPMMs)

**The first Mento FPMMs are live on Monad** — and you can earn **Merkl campaign rewards** (paid in **USDm**) by providing liquidity to the **USDC/USDm** and **GBPm/USDm** pools. Campaigns launched on **March 12, 2026** (4pm CET) and are expected to run until **June 1st**, with rewards increasing over time.

This page walks you through getting **USDm** and **GBPm** on Monad (or on Celo, then bridging) and adding liquidity to earn.

One important difference between the two campaign pools: **GBPm/USDm** is an **FX-priced** pool and inherits **FX market-hours restrictions** from `OracleAdapter -> MarketHoursBreaker`, while **USDC/USDm** is **not** subject to that specific weekend/holiday gate.

***

## Why provide liquidity on these pools?

* **Oracle-priced FPMMs** — Swaps use the fair FX rate; no curve slippage. As an LP you earn swap fees and, for the duration of the campaign, **Merkl rewards paid in USDm** on top.
* **Two pools, two ways to participate** — **USDC/USDm** (reserve-backed USDm) and **GBPm/USDm** (CDP-backed GBPm). Pick one or both.
* **Simple path from any chain** — Swap into USDm or GBPm on **Monad** in the Mento app (no bridge needed). If you swap on **Celo** instead, bridge your Mento stables to Monad via [Portal Bridge](https://portalbridge.com/), then add liquidity in the [Mento app](https://app.mento.org/pools?chain=143).

***

## Step 1: Get USDm and GBPm

### USDm (reserve-backed)

USDm is backed by the [Mento Reserve](https://reserve.mento.org/). You can get it in two main ways:

**Option A — On Monad**

* Go to [Mento app (Monad swap)](https://app.mento.org/?chain=143).
* Connect your wallet and select **Monad**.
* Swap **USDC** or **AUSD** into **USDm** at the oracle rate (no slippage).

**Option B — On Celo, then bridge to Monad**

* On **Celo**: open [Mento app (Celo swap)](https://app.mento.org/?chain=42220), connect your wallet, and swap into **USDm** (e.g. USDC → USDm).
* Bridge **USDm** (or other assets) from Celo to Monad using [**Portal Bridge**](https://portalbridge.com/) — the recommended way to move Mento stables from Celo to Monad.

If you’re starting on another EVM chain (e.g. Ethereum mainnet), use [**Squid Router**](https://app.squidrouter.com/) to route to Celo, then swap and/or bridge to Monad as above.

### GBPm (CDP-backed)

GBPm is created when users **borrow** against collateral in a CDP; it is not minted by the Reserve. You can get it in three ways:

**Option A — Borrow on Celo**

* Go to [**Mento app (Celo borrow)**](https://app.mento.org/borrow?chain=42220).
* Connect your wallet on **Celo**, select **GBPm**, and open a trove: deposit **USDm** as collateral and borrow **GBPm**.
* To use that GBPm on Monad, bridge it (and any other assets) via [Portal Bridge](https://portalbridge.com/).

**Option B — Swap on Monad**

* Go to [Mento app (Monad swap)](https://app.mento.org/?chain=143) and swap into **GBPm** (e.g. USDm → GBPm).

**Option C — Swap on Celo, then bridge**

* On **Celo**: [Mento app (Celo swap)](https://app.mento.org/?chain=42220) — swap into **GBPm**.
* Bridge to Monad via [Portal Bridge](https://portalbridge.com/).

***

## Step 2: Add liquidity and earn Merkl rewards

Once you have **USDm** and/or **GBPm** (and the other side of the pair) on **Monad**, add liquidity to the FPMM pools in the Mento app. Your position earns swap fees and, for the campaign period, **Merkl rewards**.

### Pool links (Monad)

| Pool          | Add liquidity (Mento app)                                                                                   | Merkl campaign                                                                                                          |
| ------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **USDC/USDm** | [Open in Mento app](https://app.mento.org/pools/monad/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5?chain=143) | [View on Merkl](https://app.merkl.xyz/opportunities/monad/ERC20LOGPROCESSOR/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5) |
| **GBPm/USDm** | [Open in Mento app](https://app.mento.org/pools/monad/0xD0E9c1a718D2a693d41eacd4B2696180403Ce081?chain=143) | [View on Merkl](https://app.merkl.xyz/opportunities/monad/ERC20LOGPROCESSOR/0xD0E9c1a718D2a693d41eacd4B2696180403Ce081) |

### Celo pools (for swapping or LP)

* **GBPm/USDm on Celo:** [Open in Mento app](https://app.mento.org/pools/celo/0x8C0014afe032E4574481D8934504100bF23fCB56?chain=42220)

1. Open the pool link above (Mento app, Monad).
2. Connect your wallet and ensure you’re on **Monad**.
3. Enter amounts for both sides of the pair (e.g. USDC and USDm, or GBPm and USDm). The app shows the required ratio.
4. Confirm. You’re now an LP and will earn swap fees plus Merkl rewards (in **USDm**) for the campaign period.

***

## Weekend And Holiday Impact

The two campaign pools do **not** behave the same way on weekends and holidays:

* **USDC/USDm** — not subject to the FX market-hours breaker
* **GBPm/USDm** — subject to the FX market-hours breaker because it depends on a live GBP/USD-style FX rate

Under the current `MarketHoursBreaker`, FX is treated as closed:

* from **Friday 21:00 UTC** until **Sunday 23:00 UTC**
* on **Dec 25** and **Jan 1**
* after **22:00 UTC** on **Dec 24** and **Dec 31**

### What This Means In Practice

* On **GBPm/USDm**, **quotes and swaps** are unavailable while FX markets are closed
* On **GBPm/USDm**, **rebalancing** is also unavailable while FX markets are closed
* On **USDC/USDm**, this specific FX weekend/holiday restriction does **not** apply
* If you already hold both tokens, **adding or removing liquidity** is not blocked by this FX market-hours gate at the pool level

If you want to enter the **GBPm/USDm** campaign by swapping into GBPm first, do that while FX markets are open, or wait until the market reopens.

***

## Campaign details

* **Start:** March 12, 2026, 4pm CET
* **Expected end:** June 1st (rewards increase over time).
* **Pools:** USDC/USDm and GBPm/USDm on Monad.
* **Rewards:** Paid in **USDm** and distributed via [Merkl](https://app.merkl.xyz/) for liquidity provision in these FPMM pools. Check the Merkl links above for current APRs and claim instructions.

***

## Quick links

| What you need                                | Link                                                                                                                                                                                                                  |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap on Celo                                 | [Mento app (Celo)](https://app.mento.org/?chain=42220)                                                                                                                                                                |
| Swap on Monad                                | [Mento app (Monad)](https://app.mento.org/?chain=143)                                                                                                                                                                 |
| Borrow GBPm (Celo)                           | [Mento app (Celo borrow)](https://app.mento.org/borrow?chain=42220)                                                                                                                                                   |
| Bridge Celo → Monad                          | [portalbridge.com](https://portalbridge.com/)                                                                                                                                                                         |
| Route from other EVM (e.g. Ethereum) to Celo | [app.squidrouter.com](https://app.squidrouter.com/)                                                                                                                                                                   |
| USDC/USDm pool (Monad)                       | [Mento app](https://app.mento.org/pools/monad/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5?chain=143) · [Merkl](https://app.merkl.xyz/opportunities/monad/ERC20LOGPROCESSOR/0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5) |
| GBPm/USDm pool (Monad)                       | [Mento app](https://app.mento.org/pools/monad/0xD0E9c1a718D2a693d41eacd4B2696180403Ce081?chain=143) · [Merkl](https://app.merkl.xyz/opportunities/monad/ERC20LOGPROCESSOR/0xD0E9c1a718D2a693d41eacd4B2696180403Ce081) |

***

**More:** [Getting Mento stables](https://docs.mento.org/mento-v3/other/getting-mento-stables) · [Swap & liquidity](https://github.com/mento-protocol/docs/blob/main/other/swap-and-liquidity.md) · [On Celo](https://docs.mento.org/mento-v3/other/getting-mento-stables/on-celo) · [Troubleshooting](https://github.com/mento-protocol/docs/blob/main/other/troubleshooting.md)


# Analytics & Dashboards

Track Mento Protocol's performance, monitor stablecoin metrics, and analyze reserve health through various analytics platforms and dashboards.

## Official Dashboards

### Mento Reserve Dashboard

Access real-time data about Mento's reserve composition, collateralization ratios, and asset allocations.

[View Reserve Dashboard →](https://reserve.mento.org/)

**Key Metrics:**

* Total reserve value and composition
* Collateralization ratios by stablecoin
* Reserve asset breakdown
* Historical reserve performance

### Dune Analytics

Explore comprehensive on-chain analytics including trading volumes, user activity, and protocol growth metrics.

[View Dune Dashboard →](https://dune.com/mento-labs-eng/mento-overview)

**Key Metrics:**

* Stablecoin supply and circulation
* Trading volumes and swap activity
* User growth and adoption
* Transaction patterns and trends

### Community Dashboards

*Coming soon: Additional analytics platforms and community-built dashboards*

### Understanding the Data

For deeper insights into what these metrics mean:

* [The Reserve](https://docs.mento.org/mento-v3/dive-deeper/the-reserve) — Understand reserve composition and management
* [Protocol Economics](https://docs.mento.org/mento-v3/dive-deeper/protocol-economics) — Value flows, fees, and economic design

***

*Have a dashboard to add? Contribute to the docs or reach out to the Mento community.*


# Glossary

Short definitions for terms used in the Mento V3 docs. For full context, see [Overview](https://docs.mento.org/mento-v3) and [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm).

***

| Term                                      | Definition                                                                                                                                                                                                                                                                             |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AMM** (automated market maker)          | A pool that sets swap price by a rule (e.g. formula or oracle) rather than an order book.                                                                                                                                                                                              |
| **CFMM** (constant-function market maker) | An AMM whose **trading function** depends only on **reserves** (e.g. constant product xy = k). Price is derived from reserves and moves only when someone trades; no oracle in the rule. LVR and slippage arise from this design.                                                      |
| **CDP** (collateralized debt position)    | A position where you deposit collateral and borrow a stablecoin. Used for synthetic Mento stables.                                                                                                                                                                                     |
| **Circuit breaker**                       | A rule that can halt trading when conditions are abnormal (e.g. oracle stale, price move too large). In V3, BreakerBox and OracleAdapter gate when the pool accepts swaps.                                                                                                             |
| **DEX** (decentralized exchange)          | A place to swap tokens without a central custodian; trades are executed by smart contracts.                                                                                                                                                                                            |
| **FPMM** (Fixed-Price Market Maker)       | An AMM where the swap price is fixed to an external **oracle** rate (minus fee). No reserve-based curve; no curve slippage; no LVR from a stale pool price.                                                                                                                            |
| **FX** (foreign exchange)                 | Exchange of one currency or currency-like asset for another at a rate (e.g. USDC/USDm, EUR/USD).                                                                                                                                                                                       |
| **Invariant**                             | A quantity the protocol keeps unchanged by every allowed operation. In V3 FPMMs: **I = V / S** (value at oracle per LP share). This holds under all operations **when we ignore fees and incentives**; in practice, swap fees and the rebalance incentive affect the exact accounting. |
| **Liquidity strategy**                    | A smart contract allowlisted by a pool that can call the pool's rebalance function (e.g. Reserve, CDP).                                                                                                                                                                                |
| **LVR** (loss-versus-rebalancing)         | In curve-based AMMs, loss to LPs when arbitrageurs trade against a stale pool price. In an FPMM the pool always quotes the oracle, so LVR from a stale curve is zero.                                                                                                                  |
| **Mento stables**                         | Mento stablecoins: USDm, EURm, GBPm, and others. Track fiat; obtainable via swap (FPMM) or borrow (CDP).                                                                                                                                                                               |
| **Oracle**                                | An external price feed the protocol trusts. In Mento V3 today, this oracle source is Chainlink, and each pool uses that rate to set the swap price.                                                                                                                                    |
| **Rebalance**                             | When the pool's reserve ratio drifts from the oracle, an allowlisted **liquidity strategy** can take one token from the pool and return the other at the oracle rate (capped incentive).                                                                                               |
| **Reserves**                              | The two tokens held by a pool. Swaps change composition; **value at oracle** is preserved (minus fees).                                                                                                                                                                                |
| **TradingLimitsV2**                       | Mento V3 mechanism: caps on per-token net flow over 5-minute and 1-day windows. Limits how much the pool can be drained in one go. (TradingLimits v1 applied to Mento V2.)                                                                                                             |
| **Value protection**                      | Rule that every swap must not decrease the pool's **reserve value at the oracle** (after fees). If the oracle is wrong and trading is not halted, value can still be extracted.                                                                                                        |

***

**See also:** [Overview](https://docs.mento.org/mento-v3) · [FPMMs](https://docs.mento.org/mento-v3/dive-deeper/fpmm) · [Oracles & circuit breakers](https://docs.mento.org/mento-v3/dive-deeper/fpmm/oracles-and-circuit-breakers).


