Skip to content
Fossa

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.

  1. Read Global and the quote mint’s Config. Require an enabled non-USDC quote with an approved graduated model-AMM reference.
  2. Check quote_per_usdc_x32 and quote_price_timestamp. Refresh the reference if needed. See launch pricing.
  3. Select a new base mint and derive the pool, authority, and LP mint.
  4. 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.
  5. Create the creator’s base and quote token accounts. Create empty base and quote vaults owned by the pool authority.
  6. Select a fresh keypair for user_lp. Pass its address as an uninitialized account. The DEX creates this LP token account during launch.
  7. Build initialize_curve, then sign with the payer and new user_lp keypair. 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.

FieldValue
nameToken display name.
symbolToken ticker.
descriptionOptional short description of the token or project.
imageImage URI returned by the hosted image upload.
external_urlOptional HTTPS project website URL.
extensions.websiteOptional HTTPS project website URL.
extensions.twitterOptional HTTPS Twitter or X profile URL.
extensions.telegramOptional 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:

  1. Create the mint account and fund enough rent for its extensions and metadata.
  2. Initialize MetadataPointer with the mint’s own address as the metadata address. Initialize TransferFeeConfig here if the selected token mode needs it.
  3. Initialize the mint with six decimals, zero supply, and no freeze authority. Use a signer you control as the temporary mint authority.
  4. Initialize TokenMetadata with the same name and symbol as the JSON document. Set uri to the document URL. The current mint authority must sign this instruction.
  5. 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.

AccountsRole
payerWritable creator signer. Pays rent and the action fee.
globalGlobal DEX PDA.
treasuryWritable system account at global.treasury.
configEnabled configuration for mint_b.
token_a, token_bOwning token program for each mint.
token_programLegacy SPL Token program for LP accounts.
mint_a, mint_bWritable new base mint A; read-only approved quote mint B.
pool, authorityNew pool PDA and its authority PDA.
source_a, source_bWritable creator-owned accounts for the two mints.
vault_a, vault_bWritable authority-owned accounts for the two mints.
lp_mintNew LP mint PDA. The DEX initializes it with nine decimals.
user_lpWritable fresh signer account. The DEX initializes it as a creator-owned LP token account.
system_programSolana 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

modetax_bpsBase-mint setup
0 standard0No transfer-fee extension.
1 reward100 or 300Token-2022 with immutable transfer fees.
2 community100 or 300Token-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.