Create Token
Creates a new token with a bonding curve for initial liquidity.
Instruction Index
1
Instruction
Parameters
pda_token_nonce
u8
Nonce for generating the token owner PDA
uri
String
Token metadata URI
name
String
Token name
symbol
String
Token symbol
after_migration_fee
u16
Fee percentage (in basis points) after migration (valid values: 0, 25, 50, 100, 200, 500)
after_migration_burn_bp
u16
Percentage of fees allocated to burning (in basis points)
after_migration_holders_bp
u16
Percentage of fees allocated to token holders (in basis points)
after_migration_lp_bp
u16
Percentage of fees allocated to liquidity providers (in basis points)
logging_account_bump
u8
Bump for the logging authority PDA
Account Setup
1
Properties account
Platform configuration
[Buffer.from("settings")]
2
Payer account
Transaction signer (User wallet)
-
3
Token program
SPL Token program
TOKEN_PROGRAM_ID
4
System program
System program
SystemProgram.programId
5
Associated token account program
ATA program
ASSOCIATED_TOKEN_PROGRAM_ID
6
Token mint
New token mint
Generated keypair
7
Token owner PDA
Bonding curve account
[Buffer.from("token_owner"), mint.toBuffer(), [nonce]]
8
Token owner token account
Token account for PDA
getAssociatedTokenAddress(mint, ownerPDA, true)
9
Metaplex token metadata program
Metadata program
metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
10
Metaplex token metadata account
Metadata account
["metadata", metaplexProgram.toBuffer(), mint.toBuffer()]
11
Post migration CC* WSOL storage
SOL storage
PublicKey.createWithSeed(mint, "w", TOKEN_PROGRAM_ID)
12
Post migration CC* token storage
Token storage
PublicKey.createWithSeed(mint, "t", TOKEN_PROGRAM_ID)
13
Rent sysvar
Rent program
SYSVAR_RENT_PUBKEY
14
Native mint
WSOL mint
NATIVE_MINT
15
CoolDEX owner
Platform owner
Fixed address (see Reference section)
16
Program account
SC Bonding Curve program
SC Bonding Curve program ID
17
Log authority account
For structured logs
[Buffer.from("logging_authority")]
*CC - Community Contribution
Function Logic
Validates that fee components sum to 10000 basis points (100%)
Verifies that the after_migration_fee is one of the allowed values (0, 25, 50, 100, 200, 500)
Creates the token mint account
Creates the bonding curve data account
Initializes the bonding curve with virtual SOL and token amounts
Mints the initial token supply to the bonding curve
Creates and initializes the token metadata
Creates post-migration token and SOL storage accounts
Records creation data in logs
Notes
The initial mint amount is set to 10,000,000,000.000000 tokens with 6 decimal places
The token must have a valid name, symbol, and metadata URI
The fee parameters determine how fees will be distributed after migration to the DEX
The bonding curve is initialized with virtual SOL and token amounts to establish the initial price
Example Usage
Last updated