Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scaffolds/fun-launch/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next
node_modules
dist
build
2 changes: 1 addition & 1 deletion scaffolds/fun-launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@iconify-json/solar": "^1.2.2",
"@iconify/tailwind": "^1.2.0",
"@jup-ag/wallet-adapter": "^0.2.3",
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.4.9",
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.0",
"@solana/spl-token": "^0.4.14",
"@solana/spl-token-registry": "^0.2.4574",
"@solana/wallet-adapter-wallets": "^0.19.33",
Expand Down
10 changes: 5 additions & 5 deletions studio/LLM.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ All configurations are in `studio/config/`:
"tokenBaseDecimal": 6, // Token decimals
"tokenQuoteDecimal": 9, // Quote token decimals

"lockedVestingParam": {
"lockedVestingParams": {
"totalLockedVestingAmount": 0, // Locked vesting amount (not in lamports)
"numberOfVestingPeriod": 0, // Number of vesting periods
"cliffUnlockAmount": 0, // Cliff unlock amount
Expand All @@ -237,10 +237,10 @@ All configurations are in `studio/config/`:
"migrationFeeOption": 3, // 0: 0.25% | 1: 0.3% | 2: 1% | 3: 2% | 4: 4% | 5: 6%
"tokenType": 0, // 0: SPL | 1: Token 2022

"partnerLpPercentage": 100, // Partner claimable LP after migration
"creatorLpPercentage": 0, // Creator claimable LP after migration
"partnerLockedLpPercentage": 0, // Partner permanently locked LP
"creatorLockedLpPercentage": 0, // Creator permanently locked LP
"partnerLiquidityPercentage": 100, // Partner claimable LP after migration
"creatorLiquidityPercentage": 0, // Creator claimable LP after migration
"partnerPermanentLockedLiquidityPercentage": 0, // Partner permanently locked LP
"creatorPermanentLockedLiquidityPercentage": 0, // Creator permanently locked LP
"creatorTradingFeePercentage": 0, // Creator fee share (0-100%)
"leftover": 0, // Leftover tokens (claimable after migration)
"tokenUpdateAuthority": 1 // 0: Creator | 1: Immutable | 2: Partner | etc.
Expand Down
48 changes: 43 additions & 5 deletions studio/config/dbc_config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"migrationOption": 1, // 0 - Migrate to DAMM v1 | 1 - Migrate to DAMM v2
"tokenBaseDecimal": 6, // token base decimal
"tokenQuoteDecimal": 9, // token quote decimal
"lockedVestingParam": {
"lockedVestingParams": {
"totalLockedVestingAmount": 0, // total locked vesting amount (not in lamports)
"numberOfVestingPeriod": 0, // number of vesting period
"cliffUnlockAmount": 0, // cliff unlock amount (not in lamports)
Expand Down Expand Up @@ -91,10 +91,20 @@
"collectFeeMode": 0, // 0 - Quote Token | 1 - Output Token
"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%
"tokenType": 0, // 0 - SPL | 1 - Token 2022
"partnerLpPercentage": 50, // Partner claimable LP (withdrawable LP once pool migrates)
"creatorLpPercentage": 50, // Creator claimable LP (withdrawable LP once pool migrates)
"partnerLockedLpPercentage": 0, // Partner locked LP (permanently locked LP once pool migrates)
"creatorLockedLpPercentage": 0, // Creator locked LP (permanently locked LP once pool migrates)
/* LP Distribution (must total 100%)
* IMPORTANT: At least 10% of LP must remain locked/vesting for at least 1 day post-migration.
*
* For DAMM v1: partnerPermanentLockedLiquidityPercentage + creatorPermanentLockedLiquidityPercentage >= 10%
*
* For DAMM v2: 3 options to achieve 10% locked/vesting:
* Option 1 (Permanent Only): Set creator + partner permanent locked percentages >= 10% (LP locked forever)
* Option 2 (Vesting Only): Use creator + partner vestingInfoParams with cliffDurationFromMigrationTime >= 86400 (1 day)
* Option 3 (Combination): Mix permanent + vesting to reach 10% (5% permenant + 5% vesting >= 1 day)
*/
"partnerLiquidityPercentage": 50, // Partner claimable LP (withdrawable LP once pool migrates)
"creatorLiquidityPercentage": 40, // Creator claimable LP (withdrawable LP once pool migrates)
"partnerPermanentLockedLiquidityPercentage": 5, // Partner locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
"creatorPermanentLockedLiquidityPercentage": 5, // Creator locked LP (permanently locked LP once pool migrates) - counts toward 10% requirement
"creatorTradingFeePercentage": 50, // Bonding curve trading fee sharing (0% to 100%) - 0% means all trading fees go to the partner
"leftover": 0, // leftover tokens in the bonding curve (claimable once pool migrates)
"tokenUpdateAuthority": 1, // 0 - CreatorUpdateAuthority | 1 - Immutable | 2 - PartnerUpdateAuthority | 3 - CreatorUpdateAndMintAuthority | 4 - PartnerUpdateAndMintAuthority
Expand All @@ -108,6 +118,34 @@
// "dynamicFee": 0, // 0: Disabled, 1: Enabled
// "poolFeeBps": 0 // The pool fee in basis points. Minimum 10, Maximum 1000 bps.
// },

/* Pool Creation Fee
* Fee charged to token creators when they create a pool using this config.
* Partner claims 90% via claimPartnerPoolCreationFee(), Meteora claims 10%.
* Set to 0 for no fee, or between 0.001 SOL and 100 SOL.
*/
"poolCreationFee": 0, // Pool creation fee in SOL (e.g., 0.1 for 0.1 SOL)

/* LP Vesting (DAMM v2 only)
* Optional vesting schedule for partner/creator LP tokens after migration.
* Only applicable when migrationOption = 1 (DAMM v2).
* Note: At least 10% of LP must remain locked/vesting for at least 1 day post-migration.
*/
// "partnerLiquidityVestingInfoParams": {
// "vestingPercentage": 50, // % of non-permanent LP to vest (0-100)
// "bpsPerPeriod": 100, // BPS released per period (100 = 1%)
// "numberOfPeriods": 100, // Total vesting periods
// "cliffDurationFromMigrationTime": 86400, // Cliff delay in seconds (86400 = 1 day)
// "totalDuration": 2592000 // Total vesting duration in seconds (30 days)
// },
// "creatorLiquidityVestingInfoParams": {
// "vestingPercentage": 50,
// "bpsPerPeriod": 100,
// "numberOfPeriods": 100,
// "cliffDurationFromMigrationTime": 86400,
// "totalDuration": 2592000
// },

"leftoverReceiver": "YOUR_LEFTOVER_RECEIVER_ADDRESS", // leftover receiver address
"feeClaimer": "YOUR_FEE_CLAIMER_ADDRESS" // fee claimer address
},
Expand Down
2 changes: 1 addition & 1 deletion studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@meteora-ag/cp-amm-sdk": "^1.2.6",
"@meteora-ag/dlmm": "^1.9.3",
"@meteora-ag/dynamic-amm-sdk": "^1.4.1",
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.4.9",
"@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.0",
"@meteora-ag/dynamic-fee-sharing-sdk": "^1.0.1",
"@meteora-ag/farming-sdk": "^1.0.18",
"@meteora-ag/m3m3": "^1.0.10",
Expand Down
16 changes: 8 additions & 8 deletions studio/src/lib/dbc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ export async function migrateDammV1(
// if creator and partner are the same, combine the amounts and do a single claim
const transactionLabels: string[] = [];
if (isCreatorSameAsPartner) {
const totalClaimableLp = dammv1MigrationMetadata.creatorLp.add(
dammv1MigrationMetadata.partnerLp
const totalClaimableLp = dammv1MigrationMetadata.creatorLiquidity.add(
dammv1MigrationMetadata.partnerLiquidity
);
const hasClaimableLp = totalClaimableLp.gt(new BN(0));
const bothNotClaimed =
Expand All @@ -635,7 +635,7 @@ export async function migrateDammV1(
} else {
if (
dammv1MigrationMetadata.creatorClaimStatus === 0 &&
dammv1MigrationMetadata.creatorLp.gt(new BN(0))
dammv1MigrationMetadata.creatorLiquidity.gt(new BN(0))
) {
console.log('> Claiming Creator DAMM V1 LP tokens...');
const claimCreatorLpTx = await dbcInstance.migration.claimDammV1LpToken({
Expand All @@ -653,7 +653,7 @@ export async function migrateDammV1(

if (
dammv1MigrationMetadata.partnerClaimStatus === 0 &&
dammv1MigrationMetadata.partnerLp.gt(new BN(0))
dammv1MigrationMetadata.partnerLiquidity.gt(new BN(0))
) {
console.log('> Claiming Partner DAMM V1 LP tokens...');
const claimPartnerLpTx = await dbcInstance.migration.claimDammV1LpToken({
Expand All @@ -672,8 +672,8 @@ export async function migrateDammV1(

// if creator and partner are the same, combine the amounts and do a single lock
if (isCreatorSameAsPartner) {
const totalLockedLp = dammv1MigrationMetadata.creatorLockedLp.add(
dammv1MigrationMetadata.partnerLockedLp
const totalLockedLp = dammv1MigrationMetadata.creatorLockedLiquidity.add(
dammv1MigrationMetadata.partnerLockedLiquidity
);
const hasLockedLp = totalLockedLp.gt(new BN(0));
const bothNotLocked =
Expand All @@ -699,7 +699,7 @@ export async function migrateDammV1(
} else {
if (
dammv1MigrationMetadata.creatorLockedStatus === 0 &&
dammv1MigrationMetadata.creatorLockedLp.gt(new BN(0))
dammv1MigrationMetadata.creatorLockedLiquidity.gt(new BN(0))
) {
console.log('> Locking Creator DAMM V1 LP tokens...');
const lockCreatorLpTx = await dbcInstance.migration.lockDammV1LpToken({
Expand All @@ -717,7 +717,7 @@ export async function migrateDammV1(

if (
dammv1MigrationMetadata.partnerLockedStatus === 0 &&
dammv1MigrationMetadata.partnerLockedLp.gt(new BN(0))
dammv1MigrationMetadata.partnerLockedLiquidity.gt(new BN(0))
) {
console.log('> Locking Partner DAMM V1 LP tokens...');
const lockPartnerLpTx = await dbcInstance.migration.lockDammV1LpToken({
Expand Down
21 changes: 16 additions & 5 deletions studio/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,30 @@ export type LockedVesting = {
cliffDurationFromMigrationTime: number;
};

export type LiquidityVestingInfoParams = {
vestingPercentage: number;
bpsPerPeriod: number;
numberOfPeriods: number;
cliffDurationFromMigrationTime: number;
totalDuration: number;
};

export type BuildCurveBase = {
totalTokenSupply: number;
migrationOption: number;
tokenBaseDecimal: number;
tokenQuoteDecimal: number;
lockedVestingParam: LockedVesting;
lockedVestingParams: LockedVesting;
baseFeeParams: DbcBaseFee;
dynamicFeeEnabled: boolean;
activationType: number;
collectFeeMode: number;
migrationFeeOption: number;
tokenType: number;
partnerLpPercentage: number;
creatorLpPercentage: number;
partnerLockedLpPercentage: number;
creatorLockedLpPercentage: number;
partnerLiquidityPercentage: number;
creatorLiquidityPercentage: number;
partnerPermanentLockedLiquidityPercentage: number;
creatorPermanentLockedLiquidityPercentage: number;
creatorTradingFeePercentage: number;
leftover: number;
tokenUpdateAuthority: number;
Expand All @@ -297,6 +305,9 @@ export type BuildCurveBase = {
};
leftoverReceiver: string;
feeClaimer: string;
poolCreationFee: number; // in SOL lamports
partnerLiquidityVestingInfoParams?: LiquidityVestingInfoParams; // DAMM v2 only
creatorLiquidityVestingInfoParams?: LiquidityVestingInfoParams; // DAMM v2 only
};

export type BuildCurve = BuildCurveBase & {
Expand Down