> For the complete documentation index, see [llms.txt](https://docs.mento.org/mento-v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mento.org/mento-v3/build/mento-sdk/guides/getting-exchange-pairs.md).

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


---

# 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
If you need additional information that is not directly available in this page, you can query the documentation 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/build/mento-sdk/guides/getting-exchange-pairs.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.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
