Skip to main content
SDK 2.0.0 matches program 0.2.2. Import the client, curve builders, quotes, and PDA helpers from @meteora-ag/dynamic-bonding-curve-sdk. Import curve, fee, transfer-fee, and swap math from @meteora-ag/dynamic-bonding-curve-sdk/math.
DynamicBondingCurveProgram, swapQuoteExactIn, swapQuoteExactOut, swapQuotePartialFill, createDammV1Program, createDammV2Program, and createDynamicVaultProgram are not package exports. Construct services from DynamicBondingCurveClient. The Anchor program is client.program. createDbcProgram returns that Program directly.

Dependencies

Program IDs

Core Exports

Enums

Important Constants

Creating A Client

The client creates service instances for transactions, quotes, and account reads. The returned transactions are unsigned; callers still set blockhashes when needed, sign, simulate, and submit.

Complete Function Index

Client And Program Helpers

PartnerService

PoolService

CreatorService

MigrationService

StateService

Curve Builder Helpers

All curve builders return ConfigParameters.

Config, Curve, And Account Helpers

These names are exported from the package root.

PDA Helpers

Validation Helpers

Call validateConfigParameters before createConfig2. It runs the same config checks as the program, including the transfer-fee restrictions.

Swap Quote Math

These functions are exported from @meteora-ag/dynamic-bonding-curve-sdk/math, except swapQuote, which stays on the package root. swapQuoteExactIn, swapQuoteExactOut, and swapQuotePartialFill are not exported. Quote an existing pool with client.pool.swapQuote2. swapQuote and swapQuote2 return includedTransferFeeAmountIn and excludedTransferFeeAmountOut. For a Token 2022 quote mint, pass quoteMint and currentEpoch from getSwapQuoteTransferFees. Omitting them throws quoteMint and currentEpoch are required for a Token-2022 quote mint, use getSwapQuoteTransferFees. A base transfer fee is read from config.transferFeeFlag unless you pass baseMint or baseTransferFeeBasisPoints.

Curve Math

Fee Math

Pool Fee Math

Math Utilities

Core Types

Config Creation Types

client.partner.createConfig2 accepts CreateConfig2Params. That is CreateConfigParams plus optional transferFeeParameters. createConfig is the deprecated instruction and does not take a base transfer fee. client.partner.createConfigWithTransferHook accepts CreateConfigWithTransferHookParams, which adds transferHookProgram. It does not take transferFeeParameters, and it rejects a quote mint with a non-zero transfer fee or a live transfer fee config authority. ConfigParameters is usually produced by one of the curve builders. Pass the returned object into createConfig2, createConfigWithTransferHook, createConfigAndPool, or createConfigAndPoolWithFirstBuy. TransferFeeParameters has transferFeeBasisPoints (0 to 1000), withheldAuthority (TransferFeeWithheldAuthority.Partner or Creator), and migratedTransferFeeAuthorityOption (Immutable, RevokeZeroFee, Creator, or Partner). 0 basis points still creates a TransferFeeConfig and is rejected with Immutable or RevokeZeroFee. The base mint must be Token 2022. A base transfer fee, or a quote mint with a non-zero transfer fee or a live transfer fee config authority, requires constant token supply, no locked vesting, MigrationFeeOption.Customizable, and MigratedCollectFeeMode.Compounding.

Builder Input Groups

All curve builders share BuildCurveBaseParams, then add builder-specific target fields.

Common Workflows

Create A Config From A Builder

Create A Pool From An Existing Config

For transfer-hook configs, use client.creator.createPoolWithTransferHook.

Quote And Build A swap2 Transaction

For a Token 2022 quote mint, spread getSwapQuoteTransferFees(connection, config) into swapQuote2. Pass baseMint when you want the quote to read the base mint’s current transfer fee instead of transferFeeFlag.

Integration Notes