Create launch transactions
Prepare token metadata, a mint, vaults, account metas, and signers for a public launch.
Prepare a public launch
Use initialize_curve for public launches. It accepts CurveInit { mode, tax_bps }. Token metadata belongs to mint setup, not these instruction arguments. The instruction also fixes supply and virtual reserves.
- Read
Globaland the quote mint’sConfig. Require an enabled non-USDC quote with an approved graduated model-AMM reference. - Check
quote_per_usdc_x32andquote_price_timestamp. Refresh the reference if needed. See launch pricing. - Select a new base mint and derive the pool, authority, and LP mint.
- Prepare token metadata and attach it to the mint. Before launch, the mint must have six decimals, zero supply, no freeze authority, and the pool authority as mint authority.
- Create the creator’s base and quote token accounts. Create empty base and quote vaults owned by the pool authority.
- Select a fresh keypair for
user_lp. Pass its address as an uninitialized account. The DEX creates this LP token account during launch. - Build
initialize_curve, then sign with the payer and newuser_lpkeypair. Include additional signers required by your mint and metadata instructions.
Keep mint initialization and launch atomic when possible. The DEX creates the pool and LP mint. Do not precreate those accounts yourself. It mints the fixed supply into the base vault and revokes mint authority.
A curve launch still requires both creator token accounts, including an empty base account. Vaults must have no delegate or close authority. See token restrictions.
Metadata format
Use this JSON format for launch metadata. The launch page and hosted upload endpoint use these fields. The DEX program does not create the document or enforce its fields.
| Field | Value |
|---|---|
name | Token display name. |
symbol | Token ticker. |
description | Optional short description of the token or project. |
image | Image URI returned by the hosted image upload. |
external_url | Optional HTTPS project website URL. |
extensions.website | Optional HTTPS project website URL. |
extensions.twitter | Optional HTTPS Twitter or X profile URL. |
extensions.telegram | Optional HTTPS Telegram group or channel URL. |
Omit unavailable links. The launch page stores the website in both external_url and extensions.website. The metadata URI identifies this JSON document; image identifies the image file. Replace the example image URI with your upload result.
Attach metadata to the mint
Publish the image and JSON document before preparing the launch transaction. The document must remain available at the URI stored in the mint’s metadata.
For a Token-2022 mint with MetadataPointer and TokenMetadata, prepare the instructions in this order:
- Create the mint account and fund enough rent for its extensions and metadata.
- Initialize
MetadataPointerwith the mint’s own address as the metadata address. InitializeTransferFeeConfighere if the selected token mode needs it. - Initialize the mint with six decimals, zero supply, and no freeze authority. Use a signer you control as the temporary mint authority.
- Initialize
TokenMetadatawith the samenameandsymbolas the JSON document. Seturito the document URL. The current mint authority must sign this instruction. - Transfer mint authority to the derived pool authority before
initialize_curve. Include the current authority’s signature.
The mint stores name, symbol, and uri. The referenced JSON supplies the description, image, and project links. Those document fields are not DEX instruction arguments.
The DEX revokes mint authority during launch. Complete metadata initialization before that instruction. A separate metadata update authority can still control later metadata changes.
Launch account map
InitializeCurve contains one nested Launch account group. The generated builder preserves this order and these permissions.
| Accounts | Role |
|---|---|
payer | Writable creator signer. Pays rent and the action fee. |
global | Global DEX PDA. |
treasury | Writable system account at global.treasury. |
config | Enabled configuration for mint_b. |
token_a, token_b | Owning token program for each mint. |
token_program | Legacy SPL Token program for LP accounts. |
mint_a, mint_b | Writable new base mint A; read-only approved quote mint B. |
pool, authority | New pool PDA and its authority PDA. |
source_a, source_b | Writable creator-owned accounts for the two mints. |
vault_a, vault_b | Writable authority-owned accounts for the two mints. |
lp_mint | New LP mint PDA. The DEX initializes it with nine decimals. |
user_lp | Writable fresh signer account. The DEX initializes it as a creator-owned LP token account. |
system_program | Solana System Program. |
Vaults can use associated token accounts with the pool authority as owner. Derive each account with the correct token-program ID. The DEX also accepts other token accounts that meet its constraints.
Build the launch instruction
The example uses the shared instruction helper. Each address comes from the preceding preparation steps. creator and user_lp are keypairs. The other variables are addresses. This example selects standard mode.
The DEX does not need the base-mint keypair to sign initialize_curve itself. Your preceding System Program mint-creation instruction requires that keypair’s signature.
Token modes and metadata
mode | tax_bps | Base-mint setup |
|---|---|---|
0 standard | 0 | No transfer-fee extension. |
1 reward | 100 or 300 | Token-2022 with immutable transfer fees. |
2 community | 100 or 300 | Token-2022 with immutable transfer fees. |
For reward and community mints, initialize TransferFeeConfig before initializing the mint. Set its configuration authority to none, withheld-token withdrawal authority to the pool authority, and maximum fee to u64::MAX. Both stored fee schedules must match tax_bps.
Supported mint extensions are TransferFeeConfig, MetadataPointer, and TokenMetadata. Standard mode must omit TransferFeeConfig. All public base mints must have no freeze authority.
Follow the metadata format and mint setup sequence when attaching token details. The DEX rejects unsupported extensions, including transfer hooks. Token-account extensions are limited to TransferFeeAmount and ImmutableOwner.
Launch and buy atomically
Append a buy instruction after initialize_curve in the same transaction. Point it at the new pool, authority, mints, and vaults. Its user token accounts must already exist or be created earlier in that transaction.
Use the initial curve state and current transfer taxes to calculate the buy limit. The buy must still satisfy the 75% per-buy cap. Include mint-creation signers, the creator, the new LP-account signer, and any separate trader.
If an instruction fails, transaction state changes roll back. Transaction size and compute limits apply to the combined instructions. See transaction structure.
Model launches
initialize_model_curve uses a nested Launch plus the council signer. Its payer must be the DEX council. It requires the fixed 100-million-token mint supply, 10-million-token council allocation, and 90-million-token base vault. The quote mint must be configured USDC.
The router’s model-group creation handler prepares those allocations and invokes the DEX. A direct DEX model-curve call alone does not create router group or backing state.