Skip to content

Commit 27ca1ea

Browse files
authored
Merge pull request #72 from MeteoraAg/feat/dbc-sdk-v1.5.3
[feat]: dbc sdk v1.5.3
2 parents 101d161 + f604868 commit 27ca1ea

File tree

8 files changed

+507
-158
lines changed

8 files changed

+507
-158
lines changed

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaffolds/fun-launch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@iconify-json/solar": "^1.2.2",
2121
"@iconify/tailwind": "^1.2.0",
2222
"@jup-ag/wallet-adapter": "^0.2.3",
23-
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.2",
23+
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.3",
2424
"@solana/spl-token": "^0.4.14",
2525
"@solana/spl-token-registry": "^0.2.4574",
2626
"@solana/wallet-adapter-wallets": "^0.19.33",

studio/config/dbc_config.jsonc

Lines changed: 105 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -69,112 +69,126 @@
6969
// "percentageSupplyOnMigration": 20, // percentage of total token supply to be migrated
7070

7171
/* Only use the following parameters for buildCurveMode: 5 (buildCurveWithCustomSqrtPrices)
72-
* 1. sqrtPrices - array of custom sqrt prices (must be in ascending order, at least 2 elements)
73-
* 2. liquidityWeights - optional weights for each segment (length must be sqrtPrices.length - 1)
72+
* 1. prices - array of decimal prices in ascending order (at least 2 elements).
73+
* 2. liquidityWeights - optional weights for each segment (length must be prices.length - 1)
7474
*/
75-
// "sqrtPrices": [], // array of custom sqrt prices (ascending order). First = starting price (pMin), Last = migration price (pMax)
75+
// "prices": [0.00001, 0.0005, 0.001, 0.01], // array of decimal prices (ascending order). First = starting price, Last = migration price
7676
// "liquidityWeights": [1, 2, 3], // optional: weights for each segment. If omitted, liquidity is distributed evenly
7777

78-
"totalTokenSupply": 1000000000, // total token supply (not in lamports)
79-
"migrationOption": 1, // 0 - Migrate to DAMM v1 | 1 - Migrate to DAMM v2
80-
"tokenBaseDecimal": 6, // token base decimal
81-
"tokenQuoteDecimal": 9, // token quote decimal
82-
"lockedVestingParams": {
83-
"totalLockedVestingAmount": 0, // total locked vesting amount (not in lamports)
84-
"numberOfVestingPeriod": 0, // number of vesting period
85-
"cliffUnlockAmount": 0, // cliff unlock amount (not in lamports)
86-
"totalVestingDuration": 0, // total vesting duration (in seconds)
87-
"cliffDurationFromMigrationTime": 0 // cliff duration from migration time (in seconds)
78+
/* Token Configuration */
79+
"token": {
80+
"totalTokenSupply": 1000000000, // total token supply (not in lamports)
81+
"tokenBaseDecimal": 6, // token base decimal
82+
"tokenQuoteDecimal": 9, // token quote decimal
83+
"tokenType": 0, // 0 - SPL | 1 - Token 2022
84+
"tokenUpdateAuthority": 1, // 0 - CreatorUpdateAuthority | 1 - Immutable | 2 - PartnerUpdateAuthority | 3 - CreatorUpdateAndMintAuthority | 4 - PartnerUpdateAndMintAuthority
85+
"leftover": 0 // leftover tokens in the bonding curve (claimable once pool migrates)
86+
},
87+
88+
/* Fee Configuration */
89+
"fee": {
90+
"baseFeeParams": {
91+
"baseFeeMode": 0, // 0 - Fee Scheduler: Linear | 1 - Fee Scheduler: Exponential | 2 - Rate Limiter
92+
"feeSchedulerParam": {
93+
"startingFeeBps": 100, // starting fee (max 99% fee === 9900 bps)
94+
"endingFeeBps": 100, // ending fee (minimum 0.01% fee === 1 bps)
95+
"numberOfPeriod": 0, // number of period
96+
"totalDuration": 0 // total duration (If activationType is 0 (slots), totalDuration = duration / 0.4 | If activationType is 1 (timestamp), totalDuration = duration)
97+
}
98+
/*
99+
"baseFeeMode": 2, // 2 - Rate Limiter
100+
"rateLimiterParam": {
101+
"baseFeeBps": 200, // base fee (max 99% base fee === 9900 bps)
102+
"feeIncrementBps": 200, // fee increment (max fee increment = 9900 bps - baseFeeBps)
103+
"referenceAmount": 1, // reference amount (not in lamports)
104+
"maxLimiterDuration": 3600 // if activationType is 0 (slots), maxLimiterDuration = duration / 0.4, if activationType is 1 (timestamp), maxLimiterDuration = duration)
105+
}
106+
*/
107+
},
108+
"dynamicFeeEnabled": true, // If true, dynamic fee will add 20% of minimum base fee to the total fee.
109+
"collectFeeMode": 0, // 0 - Quote Token | 1 - Output Token
110+
"creatorTradingFeePercentage": 50, // Bonding curve trading fee sharing (0% to 100%) - 0% means all trading fees go to the partner
111+
/* Pool Creation Fee
112+
* Fee charged to token creators when they create a pool using this config.
113+
* Partner claims 90% via claimPartnerPoolCreationFee(), Meteora claims 10%.
114+
* Set to 0 for no fee, or between 0.001 SOL and 100 SOL.
115+
*/
116+
"poolCreationFee": 0, // Pool creation fee in SOL (e.g., 0.1 for 0.1 SOL)
117+
"enableFirstSwapWithMinFee": false // If true, the first swap on the pool will use the minimum fee instead of the starting fee (useful for creator bundled buys)
88118
},
89-
"baseFeeParams": {
90-
"baseFeeMode": 0, // 0 - Fee Scheduler: Linear | 1 - Fee Scheduler: Exponential | 2 - Rate Limiter
91-
"feeSchedulerParam": {
92-
"startingFeeBps": 100, // starting fee (max 99% fee === 9900 bps)
93-
"endingFeeBps": 100, // ending fee (minimum 0.01% fee === 1 bps)
94-
"numberOfPeriod": 0, // number of period
95-
"totalDuration": 0 // total duration (If activationType is 0 (slots), totalDuration = duration / 0.4 | If activationType is 1 (timestamp), totalDuration = duration)
119+
120+
/* Migration Configuration */
121+
"migration": {
122+
"migrationOption": 1, // 0 - Migrate to DAMM v1 | 1 - Migrate to DAMM v2
123+
"migrationFeeOption": 3, // 0 - LP Fee 0.25% | 1 - LP Fee 0.3% | 2 - LP Fee 1% | 3 - LP Fee 2% | 4 - LP Fee 4% | 5 - LP Fee 6% | 6 - Customizable
124+
"migrationFee": {
125+
"feePercentage": 0, // Percentage of fee taken from migration quote threshold once pool migrates (0% to 50%)
126+
"creatorFeePercentage": 0 // Percentage of the migrationFee.feePercentage claimable by creator (0% to 100%)
96127
}
97-
/*
98-
"baseFeeMode": 2, // 2 - Rate Limiter
99-
"rateLimiterParam": {
100-
"baseFeeBps": 200, // base fee (max 99% base fee === 9900 bps)
101-
"feeIncrementBps": 200, // fee increment (max fee increment = 9900 bps - baseFeeBps)
102-
"referenceAmount": 1, // reference amount (not in lamports)
103-
"maxLimiterDuration": 3600 // if activationType is 0 (slots), maxLimiterDuration = duration / 0.4, if activationType is 1 (timestamp), maxLimiterDuration = duration)
104-
}
105-
*/
128+
/* Migrated Pool Fee (DAMM v2 only)
129+
* Configure migratedPoolFee when using migrationFeeOption: 6 (Customizable) or when configuring marketCapFeeSchedulerParams.
130+
* Note: When marketCapFeeSchedulerParams is configured, the SDK will automatically set migrationFeeOption to Customizable (6).
131+
*/
132+
// "migratedPoolFee": {
133+
// "collectFeeMode": 0, // 0 - Quote Token | 1 - Output Token
134+
// "dynamicFee": 0, // 0: Disabled, 1: Enabled
135+
// "poolFeeBps": 100, // The pool fee in basis points. Minimum 10, Maximum 1000 bps. Required when marketCapFeeSchedulerParams is configured.
136+
// "baseFeeMode": 3, // 3 - FeeMarketCapSchedulerLinear | 4 - FeeMarketCapSchedulerExponential (only for DAMM v2)
137+
// "marketCapFeeSchedulerParams": {
138+
// "endingBaseFeeBps": 50, // The ending (minimum) base fee in basis points
139+
// "numberOfPeriod": 100, // The total number of fee reduction periods
140+
// "sqrtPriceStepBps": 100, // The sqrt price increase (in bps) required to advance one period
141+
// "schedulerExpirationDuration": 86400 // The maximum duration (seconds) after which the scheduler expires and defaults to minimum fee
142+
// }
143+
// }
106144
},
107-
"dynamicFeeEnabled": true, // If true, dynamic fee will add 20% of minimum base fee to the total fee.
108-
"activationType": 1, // 0 - Slot | 1 - Timestamp
109-
"collectFeeMode": 0, // 0 - Quote Token | 1 - Output Token
110-
"migrationFeeOption": 3, // 0 - LP Fee 0.25% | 1 - LP Fee 0.3% | 2 - LP Fee 1% | 3 - LP Fee 2% | 4 - LP Fee 4% | 5 - LP Fee 6%
111-
"tokenType": 0, // 0 - SPL | 1 - Token 2022
112-
/* LP Distribution (must total 100%)
145+
146+
/* LP Distribution Configuration (must total 100%)
113147
* IMPORTANT: At least 10% of LP must remain locked/vesting for at least 1 day post-migration.
114148
*
115149
* For DAMM v1: partnerPermanentLockedLiquidityPercentage + creatorPermanentLockedLiquidityPercentage >= 10%
116150
*
117151
* For DAMM v2: 3 options to achieve 10% locked/vesting:
118152
* Option 1 (Permanent Only): Set creator + partner permanent locked percentages >= 10% (LP locked forever)
119153
* Option 2 (Vesting Only): Use creator + partner vestingInfoParams with cliffDurationFromMigrationTime >= 86400 (1 day)
120-
* Option 3 (Combination): Mix permanent + vesting to reach 10% (5% permenant + 5% vesting >= 1 day)
154+
* Option 3 (Combination): Mix permanent + vesting to reach 10% (5% permanent + 5% vesting >= 1 day)
121155
*/
122-
"partnerLiquidityPercentage": 50, // Partner claimable LP (withdrawable LP once pool migrates)
123-
"creatorLiquidityPercentage": 40, // Creator claimable LP (withdrawable LP once pool migrates)
124-
"partnerPermanentLockedLiquidityPercentage": 5, // Partner locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
125-
"creatorPermanentLockedLiquidityPercentage": 5, // Creator locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
126-
"creatorTradingFeePercentage": 50, // Bonding curve trading fee sharing (0% to 100%) - 0% means all trading fees go to the partner
127-
"leftover": 0, // leftover tokens in the bonding curve (claimable once pool migrates)
128-
"tokenUpdateAuthority": 1, // 0 - CreatorUpdateAuthority | 1 - Immutable | 2 - PartnerUpdateAuthority | 3 - CreatorUpdateAndMintAuthority | 4 - PartnerUpdateAndMintAuthority
129-
"migrationFee": {
130-
"feePercentage": 0, // Percentage of fee taken from migration quote threshold once pool migrates (0% to 50%)
131-
"creatorFeePercentage": 0 // Percentage of the migrationFee.feePercentage claimable by creator (0% to 100%)
156+
"liquidityDistribution": {
157+
"partnerLiquidityPercentage": 50, // Partner claimable LP (withdrawable LP once pool migrates)
158+
"creatorLiquidityPercentage": 40, // Creator claimable LP (withdrawable LP once pool migrates)
159+
"partnerPermanentLockedLiquidityPercentage": 5, // Partner locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
160+
"creatorPermanentLockedLiquidityPercentage": 5 // Creator locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
161+
/* LP Vesting (DAMM v2 only)
162+
* Optional vesting schedule for partner/creator LP tokens after migration.
163+
* Only applicable when migrationOption = 1 (DAMM v2).
164+
* Note: At least 10% of LP must remain locked/vesting for at least 1 day post-migration.
165+
*/
166+
// "partnerLiquidityVestingInfoParams": {
167+
// "vestingPercentage": 50, // % of non-permanent LP to vest (0-100)
168+
// "bpsPerPeriod": 100, // BPS released per period (100 = 1%)
169+
// "numberOfPeriods": 100, // Total vesting periods
170+
// "cliffDurationFromMigrationTime": 86400, // Cliff delay in seconds (86400 = 1 day)
171+
// "totalDuration": 2592000 // Total vesting duration in seconds (30 days)
172+
// },
173+
// "creatorLiquidityVestingInfoParams": {
174+
// "vestingPercentage": 50,
175+
// "bpsPerPeriod": 100,
176+
// "numberOfPeriods": 100,
177+
// "cliffDurationFromMigrationTime": 86400,
178+
// "totalDuration": 2592000
179+
// }
132180
},
133-
// "migratedPoolFee": {
134-
// // Configure only when migrationOption = MET_DAMM_V2 (1) and migrationFeeOption = Customizable (6)
135-
// "collectFeeMode": 0, // 0 - Quote Token | 1 - Output Token
136-
// "dynamicFee": 0, // 0: Disabled, 1: Enabled
137-
// "poolFeeBps": 0 // The pool fee in basis points. Minimum 10, Maximum 1000 bps.
138-
// },
139-
"migratedPoolBaseFeeMode": 3, // 3 - FeeMarketCapSchedulerLinear | 4 - FeeMarketCapSchedulerExponential (only for DAMM v2)
140-
"enableFirstSwapWithMinFee": false, // If true, the first swap on the pool will use the minimum fee instead of the starting fee (useful for creator bundled buys)
141-
142-
/* Only use the following parameters for migratedPoolBaseFeeMode: 3 (FeeMarketCapSchedulerLinear) or 4 (FeeMarketCapSchedulerExponential)
143-
* These parameters configure the fee reduction based on price movement (market cap growth) for the post-graduation DAMM v2 pool.
144-
*/
145-
// "migratedPoolMarketCapFeeSchedulerParams": {
146-
// "endingBaseFeeBps": 50, // The ending (minimum) base fee in basis points
147-
// "numberOfPeriod": 100, // The total number of fee reduction periods
148-
// "sqrtPriceStepBps": 100, // The sqrt price increase (in bps) required to advance one period
149-
// "schedulerExpirationDuration": 86400 // The maximum duration (seconds) after which the scheduler expires and defaults to minimum fee
150-
// },
151-
152-
/* Pool Creation Fee
153-
* Fee charged to token creators when they create a pool using this config.
154-
* Partner claims 90% via claimPartnerPoolCreationFee(), Meteora claims 10%.
155-
* Set to 0 for no fee, or between 0.001 SOL and 100 SOL.
156-
*/
157-
"poolCreationFee": 0, // Pool creation fee in SOL (e.g., 0.1 for 0.1 SOL)
158181

159-
/* LP Vesting (DAMM v2 only)
160-
* Optional vesting schedule for partner/creator LP tokens after migration.
161-
* Only applicable when migrationOption = 1 (DAMM v2).
162-
* Note: At least 10% of LP must remain locked/vesting for at least 1 day post-migration.
163-
*/
164-
// "partnerLiquidityVestingInfoParams": {
165-
// "vestingPercentage": 50, // % of non-permanent LP to vest (0-100)
166-
// "bpsPerPeriod": 100, // BPS released per period (100 = 1%)
167-
// "numberOfPeriods": 100, // Total vesting periods
168-
// "cliffDurationFromMigrationTime": 86400, // Cliff delay in seconds (86400 = 1 day)
169-
// "totalDuration": 2592000 // Total vesting duration in seconds (30 days)
170-
// },
171-
// "creatorLiquidityVestingInfoParams": {
172-
// "vestingPercentage": 50,
173-
// "bpsPerPeriod": 100,
174-
// "numberOfPeriods": 100,
175-
// "cliffDurationFromMigrationTime": 86400,
176-
// "totalDuration": 2592000
177-
// },
182+
/* Locked Vesting Configuration */
183+
"lockedVesting": {
184+
"totalLockedVestingAmount": 0, // total locked vesting amount (not in lamports)
185+
"numberOfVestingPeriod": 0, // number of vesting period
186+
"cliffUnlockAmount": 0, // cliff unlock amount (not in lamports)
187+
"totalVestingDuration": 0, // total vesting duration (in seconds)
188+
"cliffDurationFromMigrationTime": 0 // cliff duration from migration time (in seconds)
189+
},
190+
191+
"activationType": 1, // 0 - Slot | 1 - Timestamp
178192

179193
"leftoverReceiver": "YOUR_LEFTOVER_RECEIVER_ADDRESS", // leftover receiver address
180194
"feeClaimer": "YOUR_FEE_CLAIMER_ADDRESS" // fee claimer address
@@ -195,7 +209,7 @@
195209
* This will create an image uri and a new metadata uri and upload everything to Irys
196210
*/
197211
"image": "./data/image/test-token.jpg", // this can be a URL of the image address (e.g. https://example.com/token-image.png) or the image file path (e.g. ./data/image/test-token.jpg)
198-
"description": "YOUR_TOKEN_DESCRIPTION", // token description
212+
"description": "TOKEN_DESCRIPTION", // token description
199213
"website": "https://example.com", // project website
200214
"twitter": "https://x.com/yourproject", // twitter URL
201215
"telegram": "https://t.me/yourproject" // telegram URL

studio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@meteora-ag/cp-amm-sdk": "^1.3.3",
5757
"@meteora-ag/dlmm": "^1.9.3",
5858
"@meteora-ag/dynamic-amm-sdk": "^1.4.1",
59-
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.2",
59+
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.3",
6060
"@meteora-ag/dynamic-fee-sharing-sdk": "^1.0.1",
6161
"@meteora-ag/farming-sdk": "^1.0.18",
6262
"@meteora-ag/m3m3": "^1.0.10",

0 commit comments

Comments
 (0)