githubEdit

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

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:

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

Pools

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

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

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

Force a fresh route set from the blockchain:


Trading status

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

For a specific pool, get full tradability status:


Runnable examples: mento-sdk-examplesarrow-up-right.

Last updated