> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Bonding Curve Configs

<Note>Every DBC pool must be created using a config key that defines the pool's parameters. Each DBC pool is a PDA of `baseMint` + `quoteMint` + `config`.</Note>

Configs are basically where you configure the pre-graduation pool fees, post-graduation pool fees, the collect fee mode, the dynamic fee, the bonding curve shape, token vesting and more.

This guide will cover what each field in the configuration means and how you can configure your ideal bonding curve settings.

# Context

* **Partner** -> Launchpad (identified via the `feeClaimer` field in the DBC curve config)
* **Creator** -> Token Pool Creator (identified via the `creator` field in the DBC pool state)

# Example of a DBC Curve Config

A typical DBC curve config will look like this when you parse it into the `create_config` instruction on the DBC program:

<AccordionGroup>
  <Accordion title="Example of a DBC Curve Config Parameter">
    ```json theme={"system"}
    {
        poolFees: {
            baseFee: {
                cliffFeeNumerator: new BN(10000000),
                firstFactor: 0,
                secondFactor: new BN(0),
                thirdFactor: new BN(0),
                baseFeeMode: 0
            },
            dynamicFee: {
                binStep: 1,
                binStepU128: new BN(1844674407370955),
                filterPeriod: 10,
                decayPeriod: 120,
                reductionFactor: 5000,
                maxVolatilityAccumulator: 14460000,
                variableFeeControl: 956
            }
        },
        activationType: 1,
        collectFeeMode: 0,
        migrationOption: 1,
        tokenType: 1,
        tokenDecimal: 6,
        migrationQuoteThreshold: new BN(85000000000),
        partnerLiquidityPercentage: 0,
        creatorLiquidityPercentage: 0,
        partnerPermanentLockedLiquidityPercentage: 50,
        creatorPermanentLockedLiquidityPercentage: 50,
        sqrtStartPrice: new BN(95072344172433750),
        lockedVesting: {
            amountPerPeriod: new BN(0),
            cliffDurationFromMigrationTime: new BN(0),
            frequency: new BN(0),
            numberOfPeriod: new BN(0),
            cliffUnlockAmount: new BN(0)
        },
        migrationFeeOption: 2,
        tokenSupply: {
            preMigrationTokenSupply: new BN(1000000000000000),
            postMigrationTokenSupply: new BN(1000000000000000)
        },
        creatorTradingFeePercentage: 0,
        tokenUpdateAuthority: 1,
        migrationFee: { feePercentage: 0, creatorFeePercentage: 0 },
        migratedPoolFee: { collectFeeMode: 0, dynamicFee: 0, poolFeeBps: 0, compoundingFeeBps: 0 },
        poolCreationFee: new BN(0),
        enableFirstSwapWithMinFee: false,
        partnerLiquidityVestingInfo: {
            vestingPercentage: 0,
            bpsPerPeriod: 0,
            numberOfPeriods: 0,
            cliffDurationFromMigrationTime: 0,
            frequency: 0
        },
        creatorLiquidityVestingInfo: {
            vestingPercentage: 0,
            bpsPerPeriod: 0,
            numberOfPeriods: 0,
            cliffDurationFromMigrationTime: 0,
            frequency: 0
        },
        migratedPoolBaseFeeMode: 0,
        padding: [],
        curve: [
            {
            sqrtPrice: new BN(380289371323205464),
            liquidity: new BN(101410499496546307411360885487802)
            },
            {
            sqrtPrice: new BN(79226673521066979257578248091),
            liquidity:new BN(3434578513360188981331421)
            }
        ]
    }
    ```
  </Accordion>
</AccordionGroup>

# Curve Config Parameters

There are 3 ways you can go about to create your DBC curve config key onchain. You can either:

1. Head to [launch.meteora.ag](https://launch.meteora.ag) and use the UI to create your DBC curve config key.
2. Use the build curve functions in the [DBC Typescript SDK](/developer-guide/guides/dbc/typescript-sdk/getting-started) to create your DBC curve config key. These build curve functions abstracts the math complexity of the bonding curve while still allowing you to have full control over the curve structure.
3. Doing the math and creating the curve config key manually and parsing it into the `create_config` instruction.

## Tokenomics Configuration

### `tokenType`

* 0: SPL Token
* 1: Token2022 Token

<Warning>Currently DBC does not support any Token2022 extensions.</Warning>

### `tokenDecimal`

* The number of token decimals of the `baseMint` token.

### `tokenSupply`

* The total token supply of the token can be set as `fixed` or `dynamic`
* If the token supply is set to `fixed`, you need to set the `preMigrationTokenSupply` and `postMigrationTokenSupply` fields.

```
tokenSupply: {
    preMigrationTokenSupply: new BN(1000000000000000),
    postMigrationTokenSupply: new BN(1000000000000000)
}
```

* If the token supply is set to `dynamic`, you can set `tokenSupply` as null.

```
{
    "tokenSupply": null
}
```

### `tokenUpdateAuthority`

* The token authority of the `baseMint` token that can be configured based on the launchpad's preference.
* The token authority can be set to:
  * 0: `CreatorUpdateAuthority` would give the `creator` the authority to update the token metadata.
  * 1: `Immutable` would make the token metadata immutable and mint authority to be revoked.
  * 2: `PartnerUpdateAuthority` would give the `partner` the authority to update the token metadata.
  * 3: `CreatorUpdateAndMintAuthority` would give the `creator` the authority to update the token metadata and mint authority.
  * 4: `PartnerUpdateAndMintAuthority` would give the `partner` the authority to update the token metadata and mint authority.

### `lockedVesting`

* The vesting of `baseMint` tokens that can be configured based on the launchpad's preference.
* This `lockedVesting` only starts after the pool has migrated.
* The tokens are locked in a `lockEscrow` powered by [Jupiter Lock](https://dev.jup.ag/docs/lock) program.
* The `lockedVesting` is a struct that contains the following fields:
  * `amountPerPeriod` - The amount of tokens that will be unlocked per period (in lamports).
  * `cliffDurationFromMigrationTime` - The duration of the cliff period from the migration time.
  * `frequency` - The frequency of the vesting (in seconds).
  * `numberOfPeriod` - The number of periods of the vesting.
  * `cliffUnlockAmount` - The amount of tokens that will be unlocked at the cliff period (in lamports).

## Pre-Graduation DBC Configuration

### `sqrtStartPrice`

* The starting price of the token in the bonding curve pool in the sqrt price format.
* You can calculate the `sqrtPrice` from the `price` by using the following formula:
  * `price = (sqrtPrice >> 64)^2 * 10^(tokenADecimal - tokenBDecimal)`

### `poolFees`

<Note>The pool fees **only** apply to the pre-graduation DBC pool.</Note>

* The pool fees comprises of the `baseFee` and `dynamicFee`

<Warning>
  **Minimum base fee is 25 bps (0.25%).** Configs with a base fee lower than 25 bps will be rejected by the program.
</Warning>

#### `baseFee`

* The base fee is a struct the contains the following fields:
  * `cliffFeeNumerator` - The initial numerator of the pool fee.
  * `firstFactor` - Depending on the `baseFeeMode`, this field will be either `numberOfPeriod` or `feeIncrementBps`.
    * If the `baseFeeMode` is set to 0 or 1 (Fee Scheduler), this field will be `numberOfPeriod`.
    * If the `baseFeeMode` is set to 2 (Rate Limiter), this field will be `feeIncrementBps`.
  * `secondFactor` - Depending on the `baseFeeMode`, this field will be either `periodFrequency` or `maxLimiterDuration`.
    * If the `baseFeeMode` is set to 0 or 1 (Fee Scheduler), this field will be `periodFrequency`.
    * If the `baseFeeMode` is set to 2 (Rate Limiter), this field will be `maxLimiterDuration`.
  * `thirdFactor` - Depending on the `baseFeeMode`, this field will be either `reductionFactor` or `referenceAmount`.
    * If the `baseFeeMode` is set to 0 or 1 (Fee Scheduler), this field will be `reductionFactor`.
    * If the `baseFeeMode` is set to 2 (Rate Limiter), this field will be `referenceAmount`.
  * `baseFeeMode` - The mode of the base fee.
    * 0: Linear Fee Scheduler
    * 1: Exponential Fee Scheduler
    * 2: Rate Limiter

#### `dynamicFee`

* The dynamic fee is an optional struct that contains the following fields:
  * `binStep` - u16 value representing the bin step in bps
  * `binStepU128` - u128 value for a more accurate bin step
  * `filterPeriod` - Minimum time that must pass between fee updates
  * `decayPeriod` - Period after the volatility starts decaying (must be > filterPeriod)
  * `reductionFactor` - Controls how quickly volatility decys over time
  * `maxVolatilityAccumulator` - Multiplier that determines how much volatility affects fees
  * `variableFeeControl` - Caps the maximum volatility that can be accumulated

Example:

```
dynamicFee: {
    binStep: 1,
    binStepU128: new BN(1844674407370955),
    filterPeriod: 10,
    decayPeriod: 120,
    reductionFactor: 5000,
    maxVolatilityAccumulator: 14460000,
    variableFeeControl: 956
}
```

* The dynamic fee can be set to `null` if you don't want to enable the dynamic fee.

Example:

```
dynamicFee: null
```

### `creatorTradingFeePercentage`

* By default, if the `creatorTradingFeePercentage` === 0, the creator will not receive any trading fees from the pre-graduation DBC pool, and all the fees will go to the `feeClaimer` which belongs to the `partner` launchpad.
* The `creatorTradingFeePercentage` is a u16 value representing the trading fee in percentage.

### `activationType`

* The `activationType` is a u8 value representing the activation type of the DBC pool.
  * 0: `Slot` -> Calculated in terms of slots (0.4 seconds = 400ms).
  * 1: `Timestamp` -> Calculated in terms of seconds. (1 second = 1000ms)

### `collectFeeMode`

* The `collectFeeMode` is a u8 value representing the collect fee mode of the DBC pool.
  * 0: `Quote Token` -> The trading fees collected in the pre-graduation DBC pool is collected in the quote token.
  * 1: `Output Token` -> The trading fees collected in the pre-graduation DBC pool is collected in the output token.

### `enableFirstSwapWithMinFee`

* When set to `true`, allows the pool creator to perform their first swap (buy) without anti-sniper fees.
* This is particularly useful when creating a pool and making an initial purchase in a single transaction.
* The first swap instruction in a transaction that includes pool creation will use the minimum base fee instead of the elevated anti-sniper fee.
* Subsequent swaps will be subject to the normal fee scheduler or rate limiter.

<Warning>
  This feature should be used carefully as it creates an exception to the anti-sniper protection. It is designed for legitimate pool creators who want to acquire tokens at launch without paying elevated anti-sniper fees.
</Warning>

<Note>
  When `enableFirstSwapWithMinFee` is enabled, the `swap` and `swap2` instructions require the `SYSVAR_INSTRUCTIONS_PUBKEY` to be included in the remaining accounts to verify the transaction context.
</Note>

Example:

```typescript theme={"system"}
// Enable first swap with minimum fee for pool creators
enableFirstSwapWithMinFee: true
```

### `migrationQuoteThreshold`

* The `migrationQuoteThreshold` is a u128 value representing the amount of quote token that will be needed to be collected in the pre-graduation DBC pool to qualify for the pool to be ready for migration.
* In order for the token to graduate from pre-graduation to post-graduation, the `poolState.quoteReserve` must be greater than or equal to the `poolConfig.migrationQuoteThreshold`.
* If you want your pool to automatically migrate when the `poolState.quoteReserve` is greater than or equal to the `poolConfig.migrationQuoteThreshold`, you would need to set the `migrationQuoteThreshold` to have a minimum value of 750 USD. You can read more about our migration keepers [here](/developer-guide/guides/dbc/overview#migration-keeper)

### `migrationFee`

<Note>The maximum `feePercentage` for migration fees is **99%**.</Note>

* The `migrationFee` is the amount of quote token that you want to collect as fee when the token pool migrates from pre-graduation to post-graduation.
* This `migrationFee` will be collected from the `migrationQuoteThreshold` amount of quote token.
* The `migrationFee` is a struct that contains the following fields:
  * `feePercentage` - The fee percentage of the migration fee. The value must be between 0% and 50%.
  * `creatorFeePercentage` - The fee percentage of the creator fee. The value must be between 0% and 100%.
* For example, if you want to collect 10% fee of the `migrationQuoteThreshold` amount of quote token, you would need to set the `migrationFee` to:

```
migrationFee: {
    feePercentage: 10,
    creatorFeePercentage: 0
}
```

* Additionally, if you want to fee split 50% of this 10% fee between the `partner` and `creator`, you can set the `creatorFeePercentage` to 50.

```
migrationFee: {
    feePercentage: 10,
    creatorFeePercentage: 50
}
```

* So essentially, if your `migrationQuoteThreshold` is 100 SOL, a 10% migrationFee would mean that 90 SOL will be migrated to the post-graduation pool's LP, and the remaining 10 SOL will be collected as fee.

### `curve`

* The `curve` is an array of objects that contains the following fields:
  * `sqrtPrice` - The sqrt price of the curve segment.
  * `liquidity` - The liquidity of the curve segment.
* When configuring the curve segments, you would need to adhere to the [math formulas of the bonding curve](/overview/products/dbc/bonding-curve-formulas) to ensure that the curve is valid.

## Post-Graduation DAMM Pool Configuration

### `migrationOption`

* The `migrationOption` is a u8 value representing the type of the post-graduation pool after the bonding curve has completed.
  * 0: `DAMM v1` -> The pool will be migrated to a DAMM v1 pool.
  * 1: `DAMM v2` -> The pool will be migrated to a DAMM v2 pool.

### `migrationFeeOption`

* The `migrationFeeOption` are fee configs that have been pre-defined for the DBC Pool Authority to use.
* You can find the list of the pre-defined fee configs [here](/developer-guide/guides/dbc/overview#damm-fee-config-keys).
  <Note>**For DAMM v1**, the `collectFeeMode` of the post-graduation pool is set to `Output Token`.</Note>
  <Note>**For DAMM v2**, the `collectFeeMode` of the post-graduation pool is set to `Quote Token`. Additionally, because dynamic fee is enabled in the DAMM v2 fee config, there will be an additional 20% of the chosen base fee added to the total fee.</Note>
* The `migrationFeeOption` is a u8 value representing the pool fee of the post-graduation pool.
  * 0: `FixedBps25` -> The pool fee of the post-graduation pool will be 25 bps.
  * 1: `FixedBps30` -> The pool fee of the post-graduation pool will be 30 bps.
  * 2: `FixedBps100` -> The pool fee of the post-graduation pool will be 100 bps.
  * 3: `FixedBps200` -> The pool fee of the post-graduation pool will be 200 bps.
  * 4: `FixedBps400` -> The pool fee of the post-graduation pool will be 400 bps.
  * 5: `FixedBps600` -> The pool fee of the post-graduation pool will be 600 bps.
  * 6: `Customizable` -> Only if your `migrationOption` is set to `DAMM v2`. You can set the pool fees of the post-graduation pool in the `migratedPoolFee` struct.

<Note>When using the SDK's `buildCurve*` functions with `marketCapFeeSchedulerParams` configured in `migratedPoolFee`, the SDK automatically overrides `migrationFeeOption` to `Customizable` (6) regardless of what you set. This is required by the on-chain program.</Note>

### `migratedPoolFee`

* The `migratedPoolFee` is only available if your `migrationOption` is set to `DAMM v2` and `migrationFeeOption` is set to `Customizable` \[6].
* The `migratedPoolFee` is a struct that contains the following fields:
  * `collectFeeMode` - The collect fee mode of the post-graduation pool.
  * `dynamicFee` - The dynamic fee of the post-graduation pool.
  * `poolFeeBps` - The pool fee of the post-graduation pool.
  * `compoundingFeeBps` - The compounding fee rate in basis points. Must be non-zero when `collectFeeMode` is `2` (Compounding), and must be `0` for all other modes.

<Note>When `marketCapFeeSchedulerParams` is configured, `poolFeeBps` must be greater than 0 as it serves as the starting (cliff) fee for the market cap fee scheduler.</Note>

#### `migratedPoolFee.collectFeeMode` options

Controls how trading fees are collected in the graduated DAMM v2 pool:

* `0` (`QuoteToken`) — Fees are collected in the quote token only. Maps to DAMM v2's `OnlyB` mode.
* `1` (`OutputToken`) — Fees are collected in the output token of each swap (both tokens). Maps to DAMM v2's `BothToken` mode.
* `2` (`Compounding`) — Fees are automatically reinvested into the LP position. Requires `compoundingFeeBps` to be non-zero.

Example — Compounding fee mode:

```typescript theme={"system"}
migratedPoolFee: {
    collectFeeMode: 2,       // Compounding
    dynamicFee: 0,
    poolFeeBps: 100,         // 1% base fee
    compoundingFeeBps: 50    // 0.5% compounded back into LP
}
```

<Warning>
  When `collectFeeMode` is set to `2` (Compounding), `compoundingFeeBps` must be greater than `0`. When using any other mode, `compoundingFeeBps` must be `0`.
</Warning>

### `liquidityPercentage`

* There are 4 types of Liquidity Percentage parameters that you can configure.
* These 4 Liquidity Percentage parameters must add up to 100%.
  * `partnerLiquidityPercentage` - The percentage of the LP that will be allocated to the partner in the graduated pool (0-100)
  * `creatorLiquidityPercentage` - The percentage of the LP that will be allocated to the creator in the graduated pool (0-100)
  * `partnerPermanentLockedLiquidityPercentage` - The percentage of the permanently locked LP that will be allocated to the partner in the graduated pool (0-100)
  * `creatorPermanentLockedLiquidityPercentage` - The percentage of the permanently locked LP that will be allocated to the creator in the graduated pool (0-100)

<Warning>
  **Minimum 10% Locked Liquidity Requirement (Day 1 Post-Migration)**

  Configs require that at least 10% of liquidity remains locked at day 1 (86400 seconds) after migration. How this is achieved depends on your migration option:

  **For DAMM v1 Migration:**

  * Must use **permanent locked liquidity only**: `partnerPermanentLockedLiquidityPercentage` + `creatorPermanentLockedLiquidityPercentage` >= 10
  * LP vesting is **NOT available** for DAMM v1

  **For DAMM v2 Migration:**

  * **Option A - Permanent locked liquidity only**: `partnerPermanentLockedLiquidityPercentage` + `creatorPermanentLockedLiquidityPercentage` >= 10
  * **Option B - LP vesting only**: If using LP vesting (`partnerLiquidityVestingInfo` or `creatorLiquidityVestingInfo`) without permanent locks, the vested liquidity locked at day 1 must be >= 10%
  * **Option C - Combination of permanent + vesting liquidity**: If using both permanent locked liquidity and LP vesting, the combined locked liquidity at day 1 must be >= 10%

  The SDK validates this using `MIN_LOCKED_LIQUIDITY_BPS = 1000` (10%).
</Warning>

Example:

```
// All the LP are locked forever in the post-graduation pool
liquidityPercentage: {
    partnerLiquidityPercentage: 0,
    creatorLiquidityPercentage: 0,
    partnerPermanentLockedLiquidityPercentage: 50,
    creatorPermanentLockedLiquidityPercentage: 50
}
```

#### LP Vesting (DAMM v2 only)

In addition to the 4 liquidity percentage parameters, you can optionally configure LP vesting for DAMM v2 migrations:

* `partnerLiquidityVestingInfoParams` - Optional vesting configuration for the partner's LP position
* `creatorLiquidityVestingInfoParams` - Optional vesting configuration for the creator's LP position

These parameters are only applicable when `migrationOption` is set to `DAMM v2`. Each vesting info uses the `LiquidityVestingInfoParameters` struct with the following fields:

* `vestingPercentage` - The percentage of non-permanently-locked LP to vest (0-100)
* `bpsPerPeriod` - Basis points released per vesting period (e.g., 100 = 1% per period)
* `numberOfPeriods` - Number of vesting periods
* `cliffDurationFromMigrationTime` - The cliff duration in seconds from migration time before vesting starts
* `totalDuration` - The total vesting duration in seconds

<Note>LP vesting durations are **always in seconds** regardless of the pool's `activationType` setting (Slot or Timestamp).</Note>

<Note>When LP vesting is configured, the `migrateToDammV2` endpoint will require vesting accounts for the positions.</Note>

<Info>
  **Vesting Contribution to Locked Liquidity**

  LP vesting contributes to the minimum 10% locked liquidity requirement. The SDK calculates how much liquidity remains locked at day 1 (86400 seconds) post-migration based on your vesting schedule.

  Use the helper function `getLiquidityVestingInfoParams()` to construct valid vesting parameters and `getVestingLockedLiquidityBpsAtNSeconds()` to calculate locked BPS at a specific time.
</Info>

Example:

```typescript theme={"system"}
// Configure vesting for 50% of partner's non-locked LP
// 7-day cliff, 30-day total vesting
partnerLiquidityVestingInfoParams: {
    vestingPercentage: 50,                           // 50% of LP will vest
    bpsPerPeriod: 100,                               // 1% released per period
    numberOfPeriods: 100,                            // 100 vesting periods
    cliffDurationFromMigrationTime: 7 * 24 * 60 * 60, // 7 days cliff (604800 seconds)
    totalDuration: 30 * 24 * 60 * 60,                // 30 days total vesting (2592000 seconds)
}
```

**SDK Helper Function:**

```typescript theme={"system"}
import { getLiquidityVestingInfoParams } from "@meteora-ag/dynamic-bonding-curve-sdk";

// Use the helper to build valid vesting params
// Parameters: vestingPercentage, bpsPerPeriod, numberOfPeriods, cliffDurationFromMigrationTime, totalDuration
const vestingParams = getLiquidityVestingInfoParams(
    50,                        // vestingPercentage: 50% of LP will vest
    100,                       // bpsPerPeriod: 1% released per period
    100,                       // numberOfPeriods: 100 vesting periods
    7 * 24 * 60 * 60,          // cliffDurationFromMigrationTime: 7 days cliff
    30 * 24 * 60 * 60          // totalDuration: 30 days total vesting
);

// Returns LiquidityVestingInfoParameters:
// {
//     vestingPercentage: 50,
//     bpsPerPeriod: 100,
//     numberOfPeriods: 100,
//     cliffDurationFromMigrationTime: 604800,
//     totalDuration: 2592000
// }
```

### `poolCreationFee`

* Partners can configure a `poolCreationFee` in SOL lamports when creating a config.
* When token creators create a pool using this config (through `initializeVirtualPoolWithSplToken` or `initializeVirtualPoolWithToken2022`), they will need to pay this fee in SOL.
* Partners can later claim this fee using the `claimPartnerPoolCreationFee` function.
* Meteora (protocol) receives 10% of the collected pool creation fees.

Example:

```typescript theme={"system"}
// Set pool creation fee to 0.1 SOL
poolCreationFee: new BN(100000000) // 0.1 SOL in lamports
```

### `migratedPoolBaseFeeMode`

* The `migratedPoolBaseFeeMode` configures the base fee mode for the **post-graduation DAMM v2 pool**.
* This is only applicable when `migrationOption` is set to `DAMM v2` (1).
* The available modes are:
  * 0: `FeeTimeSchedulerLinear` -> Fee decreases linearly over time after migration.
  * 1: `FeeTimeSchedulerExponential` -> Fee decreases exponentially over time after migration.
  * 2: `RateLimiter` -> **Not supported** for DAMM v2 migration. Will throw an error if used.
  * 3: `FeeMarketCapSchedulerLinear` -> Fee decreases linearly based on sqrt price increase (market cap growth) after migration.
  * 4: `FeeMarketCapSchedulerExponential` -> Fee decreases exponentially based on sqrt price increase (market cap growth) after migration.
* Defaults to `FeeTimeSchedulerLinear` (0) if not specified.

<Note>Modes 3 and 4 (Fee Market Cap Scheduler) require `migratedPoolMarketCapFeeSchedulerParams` to be configured. See the [Fee Market Cap Scheduler](/anti-sniper-suite/fee-market-cap-scheduler/what-is-fee-market-cap-scheduler) documentation for more details.</Note>

### `migratedPoolMarketCapFeeSchedulerParams`

* This parameter is only required when `migratedPoolBaseFeeMode` is set to `FeeMarketCapSchedulerLinear` (3) or `FeeMarketCapSchedulerExponential` (4) and `migrationOption` is set to `DAMM v2` (1).
* The `migratedPoolMarketCapFeeSchedulerParams` is a struct that contains the following fields:
  * `numberOfPeriod` - The total number of fee reduction periods.
  * `sqrtPriceStepBps` - The sqrt price increase (in basis points) required to advance one fee reduction period.
  * `schedulerExpirationDuration` - The maximum duration (in seconds) after which the scheduler expires and the fee permanently defaults to the minimum fee.
  * `reductionFactor` - The amount to reduce the fee by per period.

<Warning>When using `migratedPoolMarketCapFeeSchedulerParams`, all fields (`numberOfPeriod`, `sqrtPriceStepBps`, `schedulerExpirationDuration`) must be greater than zero.</Warning>

### Protocol Migration Fee

<Note>There is a fixed **0.2% (20 bps) protocol migration fee** that is applied during the migration process from the DBC bonding curve to the post-graduation DAMM pool. This fee is deducted from the quote reserve during migration and is separate from any `migrationFee` configured by the partner.</Note>

# Creating the Curve Config

When creating the DBC Curve Config, you need to call the `create_config` instruction on the DBC program with the following parameters:

1. `config` - The DBC curve config account public key. This will be the address that stores the curve config settings.
2. `quoteMint` - The quote mint public key that will be paired with the base mint. All pools created with this DBC curve config address will be paired with this quote mint.
3. `feeClaimer` - The fee claimer public key is a wallet signer address that will belong to the launchpad to claim the partner fees.
4. `leftoverReceiver` - The leftover receiver public key is a wallet that will receive the leftover tokens in the bonding curve after the pool has migrated.
5. `payer` - The payer public key is a wallet signer that will pay for the creation of the DBC curve config account.

# Build Curve Helper functions

Creating a curve config key is a highly complex process that involves understanding how the math of the bonding curve works. To make this process easier, we have created a set of helper functions in the [DBC Typescript SDK](/developer-guide/guides/dbc/typescript-sdk/getting-started) that will help you create the curve config key.

### [buildCurve](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurve)

* This function is useful when you want to create a curve config with a specific `migrationQuoteThreshold` and `percentageSupplyOnMigration`.
* The `percentageSupplyOnMigration` is the percentage of the total token supply that you want to be migrated into the post-graduation pool's LP.

### [buildCurveWithMarketCap](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurvewithmarketcap)

* This function is useful when you want to create a curve config that has a specific starting token price and an ending migration token price.
* The `initialMarketCap` is the initial market cap of the token when the pre-graduation pool is first created.
* The `migrationMarketCap` is the market cap of the token when the pre-graduation pool is ready to migrate to the post-graduation pool.

### [buildCurveWithTwoSegments](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurvewithtwosegments)

* This function is useful when you want to create a 2 constant product curve structure with a specific `initialMarketCap`, `migrationMarketCap` and `percentageSupplyOnMigration`.
* The `percentageSupplyOnMigration` is the percentage of the total token supply that you want to be migrated into the post-graduation pool's LP.
* The `initialMarketCap` is the initial market cap of the token when the pre-graduation pool is first created.
* The `migrationMarketCap` is the market cap of the token when the pre-graduation pool is ready to migrate to the post-graduation pool.

### [buildCurveWithLiquidityWeights](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurvewithliquidityweights)

* This function is useful when you want to create a curve config with a unique price action (flat, exponential, etc.) with a specific initial market cap, migration market cap and liquidity weights.
* The `liquidityWeights` is an array of values that you want to be the exponent of the liquidity of the curve segments. Using these liquidity weights, you can control how thick or thin each curve segment's liquidity is to control the price action of the curve.
* The `initialMarketCap` is the initial market cap of the token when the pre-graduation pool is first created.
* The `migrationMarketCap` is the market cap of the token when the pre-graduation pool is ready to migrate to the post-graduation pool.

### [buildCurveWithMidPrice](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurvewithmidprice)

* This function is useful when you want to create a 2 constant product curve structure with a specific mid-point price. This allows you to control the price at which the two curve segments meet.
* The `initialMarketCap` is the initial market cap of the token when the pre-graduation pool is first created.
* The `migrationMarketCap` is the market cap of the token when the pre-graduation pool is ready to migrate to the post-graduation pool.
* The `midPrice` is the price at which the two curve segments will meet (the breakpoint price between the two constant product curves).
* The `percentageSupplyOnMigration` is the percentage of the total token supply that you want to be migrated into the post-graduation pool's LP.

### [buildCurveWithCustomSqrtPrices](/developer-guide/guides/dbc/typescript-sdk/sdk-functions#buildcurvewithcustomsqrtprices)

* This function is useful when you want full control over the curve by specifying custom sqrt price breakpoints directly.
* The `sqrtPrices` is an array of custom sqrt prices that must be in ascending order. The first element is the starting price (pMin) and the last element is the migration price (pMax).
* The `liquidityWeights` is an optional array of weights for each segment between the sqrt price breakpoints. If omitted, liquidity is distributed evenly across all segments. If provided, the array length must be `sqrtPrices.length - 1`.
