The Dynamic Bonding Curve is a customizable bonding curve that allows you to configure up to 16 curve segments to control the curve’s shape and price action. Each curve segment follows a constant product formula:
The bonding curve will function across 2 price ranges:
Range 1: (l = 100, pa = 1, pb = 2)
Range 2: (l = 500, pa = 2, pb = 4)
These are just example values and are not real values in the actual curve. You will have to calculate the actual sqrt_price and liquidity values which will be much bigger.
Migration Fee Percentage is the fee (as a decimal, e.g., 0.01 for 1%)
Migration Amount is the total amount of base mint tokens being migrated
These formulas allow you to compute swap amounts, migration thresholds, and price limits for any custom liquidity distribution along the bonding curve.
poolFees: { baseFee: { cliffFeeNumerator: BN // Initial fee numerator (base fee) firstFactor: number // feeScheduler: numberOfPeriod, rateLimiter: feeIncrementBps secondFactor: BN // feeScheduler: periodFrequency, rateLimiter: maxLimiterDuration thirdFactor: BN // feeScheduler: reductionFactor, rateLimiter: referenceAmount baseFeeMode: number // 0: FeeSchedulerLinear, 1: FeeSchedulerExponential, 2: RateLimiter } dynamicFee: { // Optional dynamic fee binStep: number // u16 value representing the bin step in bps binStepU128: BN // u128 value for a more accurate bin step filterPeriod: number // Minimum time that must pass between fee updates decayPeriod: number // Period after the volatility starts decaying (must be > filterPeriod) reductionFactor: number // Controls how quickly volatility decys over time variableFeeControl: number // Multiplier that determines how much volatility affects fees maxVolatilityAccumulator: number // Caps the maximum volatility that can be accumulated } | null}
Using the relevant parameters, you can calculate the base fee and variable fee for any given swap.
We introduced a new migration fee feature that allows users to collect a percentage of the quote_min from the migration_quote_threshold amount.
Copy
Ask AI
migrationFee: { // Optional migration fee (set as 0 for feePercentage and 0 for creatorFeePercentage for no migration fee) feePercentage: number // The percentage of fee taken from migration quote threshold (0-50) creatorFeePercentage: number // The fee share percentage for the creator from the migration fee (0-100)}
ONLY if you are using the buildCurveWithMarketCap function from the DBC Typescript SDK, you will need to calculate the actual initial_market_cap value that you want based on the desired initial market cap.
let D = desiredMarketCap and M = migrationMarketCap and f = migrationFee and I = initialMarketCaprequiredRatio = sqrt(D / M)percentageSupplyOnMigration = (requiredRatio * (1 - f) * 100) / (1 + requiredRatio * (1 - f))x = percentageSupplyOnMigration / ((100 - V - L) - percentageSupplyOnMigration)I = M * x²