> 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/installation.md).

# 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](/mento-v3/build/mento-sdk/guides/getting-exchange-pairs.md) — tokens, pools, routes, trading status         |
| **Trading**   | [Getting a quote](/mento-v3/build/mento-sdk/guides/getting-a-quote.md), [Initiating a swap](/mento-v3/build/mento-sdk/guides/initiating-a-swap.md) |
| **Liquidity** | [Liquidity management](/mento-v3/build/mento-sdk/guides/liquidity.md) — add/remove liquidity, zap in/out for FPMM pools                            |
| **Borrow**    | [Borrow (CDP)](/mento-v3/build/mento-sdk/guides/borrow.md) — open/adjust/close troves, fees, system params                                         |

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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mento.org/mento-v3/build/mento-sdk/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
