Dynamic fee launch
Create a Solana launch with a dynamic fee schedule
import {
generateKeyPairSigner,
type Address,
} from '@solana/kit';
import {
createLaunch,
cpmmHook,
initializer,
deriveSolanaCpmmDeployment,
DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES,
} from '@whetstone-research/doppler-sdk/solana';
const WSOL_MINT =
'So11111111111111111111111111111111111111112' as Address;
const deployment = await deriveSolanaCpmmDeployment(
DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES,
);
const baseMint = await generateKeyPairSigner();
const baseVault = await generateKeyPairSigner();
const quoteVault = await generateKeyPairSigner();
const namespace = payer.address;
const launchId = initializer.createLaunchId();
const addresses = await initializer.deriveCreateLaunchAddresses({
deployment,
namespace,
launchId,
baseMint,
});
const { instruction } = await createLaunch({
deployment,
namespace,
launchId,
addresses,
launchAccounts: {
baseMint,
quoteMint: WSOL_MINT,
baseVault,
quoteVault,
},
payer,
authority: payer,
supply: {
baseDecimals: 6,
baseTotalSupply: 1_000_000_000n * 10n ** 6n,
baseForDistribution: 0n,
baseForLiquidity: 0n,
},
curve: {
curveVirtualBase: 1_000_000_000n * 10n ** 6n,
curveVirtualQuote: 10n * 1_000_000_000n,
swapFeeBps: 200,
},
dynamicFee: {
startingTime: 0n,
startFeeBps: 8_000,
endFeeBps: 200,
durationSeconds: 10n * 60n,
},
migration: {
minRaiseQuote: 50n * 1_000_000_000n,
},
metadata: null,
feeBeneficiaries: [{ wallet: payer.address, shareBps: 10_000 }],
});Last updated