DLMM Pool Operations Examples

Learn how to work with DLMM pools using the Saros DLMM SDK with these complete examples.

DLMM Swap
Swap tokens using the DLMM SDK.
import { LiquidityBookServices, MODE } from "@saros-finance/dlmm-sdk";
import { PublicKey } from "@solana/web3.js";

const liquidityBookServices = new LiquidityBookServices({
  mode: MODE.DEVNET, // or MODE.MAINNET
});

async function getDLMMQuote() {
  // ... (quote logic)
}

async function executeDLMMSwap() {
  // ... (swap logic)
}

// ... (execution)