This guide provides instructions on how to get started with the DBC TypeScript SDK.

Before you begin, here are some important resources:

Installation

To use the SDK in your project, install it using your preferred package manager:

npm install @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js
# or
pnpm install @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js
# or
yarn add @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js

Initialization

Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this:

import { Connection } from "@solana/web3.js";
import { DynamicBondingCurveClient } from "@meteora-ag/dynamic-bonding-curve-sdk";

// Initialize a connection to the Solana network (e.g., Mainnet)
const connection = new Connection("https://api.mainnet-beta.solana.com");

// Create a new instance of the DynamicBondingCurveClient
const dbcClient = new DynamicBondingCurveClient(connection, "confirmed");

Testing the SDK (for contributors)

If you have cloned the SDK repository and want to run the built-in tests:

# Install dependencies
bun install

# Run tests
bun test

DAMM v1/v2 Fee Config Keys

DAMM v1

Accessible via DAMM_V1_MIGRATION_FEE_ADDRESS[i] in the SDK.

  • MigrationFeeOption.FixedBps25 == 0: 8f848CEy8eY6PhJ3VcemtBDzPPSD4Vq7aJczLZ3o8MmX
  • MigrationFeeOption.FixedBps30 == 1: HBxB8Lf14Yj8pqeJ8C4qDb5ryHL7xwpuykz31BLNYr7S
  • MigrationFeeOption.FixedBps100 == 2: 7v5vBdUQHTNeqk1HnduiXcgbvCyVEZ612HLmYkQoAkik
  • MigrationFeeOption.FixedBps200 == 3: EkvP7d5yKxovj884d2DwmBQbrHUWRLGK6bympzrkXGja
  • MigrationFeeOption.FixedBps400 == 4: 9EZYAJrcqNWNQzP2trzZesP7XKMHA1jEomHzbRsdX8R2
  • MigrationFeeOption.FixedBps600 == 5: 8cdKo87jZU2R12KY1BUjjRPwyjgdNjLGqSGQyrDshhud

DAMM v2

Accessible via DAMM_V2_MIGRATION_FEE_ADDRESS[i] in the SDK.

  • MigrationFeeOption.FixedBps25 == 0: 7F6dnUcRuyM2TwR8myT1dYypFXpPSxqwKNSFNkxyNESd
  • MigrationFeeOption.FixedBps30 == 1: 2nHK1kju6XjphBLbNxpM5XRGFj7p9U8vvNzyZiha1z6k
  • MigrationFeeOption.FixedBps100 == 2: Hv8Lmzmnju6m7kcokVKvwqz7QPmdX9XfKjJsXz8RXcjp
  • MigrationFeeOption.FixedBps200 == 3: 2c4cYd4reUYVRAB9kUUkrq55VPyy2FNQ3FDL4o12JXmq
  • MigrationFeeOption.FixedBps400 == 4: AkmQWebAwFvWk55wBoCr5D62C6VVDTzi84NJuD9H7cFD
  • MigrationFeeOption.FixedBps600 == 5: DbCRBj8McvPYHJG1ukj8RE15h2dCNUdTAESG49XpQ44u

Development Resources

Faucets