This guide provides instructions on how to get started with the DLMM TypeScript SDK.
Before you begin, here are some important resources:
- Program ID (Mainnet & Devnet):
LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo
- TypeScript SDK Repository: @meteora-ag/dlmm
Installation
To use the SDK in your project, install it using your preferred package manager:
npm install @meteora-ag/dlmm @solana/web3.js
# or
pnpm install @meteora-ag/dlmm @solana/web3.js
# or
yarn add @meteora-ag/dlmm @solana/web3.js
Initialization
Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this:
import DLMM from '@meteora-ag/dlmm'
import { Connection, PublicKey } from '@solana/web3.js';
const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com');
// Create pool instances
// e.g. creating a DLMM pool
// You can get your desired pool address from the API https://dlmm-api.meteora.ag/pair/all
const USDC_USDT_POOL = new PublicKey('ARwi1S4DaiTG5DX7S4M4ZsrXqpMD1MrTmbu9ue2tpmEq')
const dlmmPool = await DLMM.create(connection, USDC_USDT_POOL);
// e.g. creating multiple pools
const dlmmPool = await DLMM.createMultiple(connection, [USDC_USDT_POOL, ...]);
Testing the SDK (for contributors)
If you have cloned the SDK repository and want to run the built-in tests:
# Install dependencies
cd ts-client
bun install
# Run tests
bun test
Development Resources
Faucets