Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

This guide shows how to install and initialize the official DLMM TypeScript SDK, @meteora-ag/dlmm. Before you begin, here are some important resources:

TypeScript SDK

Meteora DLMM TypeScript SDK

DLMM NPM Package

Meteora DLMM NPM Package

Installation

To use the SDK in your project, install it using your preferred package manager:
npm install @meteora-ag/dlmm @solana/web3.js

Initialization

Once installed, initialize a pool client with a Solana connection and a DLMM pool address:
import DLMM from "@meteora-ag/dlmm";
import { Connection, PublicKey } from "@solana/web3.js";
import BN from "bn.js";

const connection = new Connection(process.env.RPC_URL!, "confirmed");

const poolAddress = new PublicKey("ARwi1S4DaiTG5DX7S4M4ZsrXqpMD1MrTmbu9ue2tpmEq");
const dlmmPool = await DLMM.create(connection, poolAddress, {
  cluster: "mainnet-beta",
});
You can find pool addresses with the Data API:
curl "https://dlmm.datapi.meteora.ag/pools?page=1&page_size=20"
To initialize several pools efficiently:
const pools = await DLMM.createMultiple(connection, [
  poolAddress,
  ...otherPoolAddresses,
]);

Cluster And Program ID

The SDK defaults to the public DLMM program ID:
LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo
Pass opt when using devnet or a custom program ID:
const dlmmPool = await DLMM.create(connection, poolAddress, {
  cluster: "devnet",
})

Reference

SDK Examples

Explore full transaction flows, including pool initialization, swaps, liquidity, and more.

SDK Reference

Learn about all SDK functions: pool creation, liquidity, swaps, rewards, limit orders, and Token-2022 helpers.

Testing The SDK

If you have cloned the SDK repository, start with package-level checks:
cd ts-client
pnpm install
pnpm run build
pnpm run unit-test
For commons, CLI, scripts, and broader repository testing notes, see the DLMM overview.

Faucets

Devnet Faucet

When working on devnet, you might need test tokens. Here is a helpful faucet.