Chameleon
Start
OverviewHow it worksQuickstart
Concepts
ConceptsPrivacy model
Reference
The transactionsJavaScript engineAddresses and programs
Practice
Real examplesSelling and exitingSecurity and limitsFAQChangelog
Solana mainnet

Real examples

Everything on this page was produced by running the code. The first two sections are the mainnet dry run: it builds the exact transactions and asks a real Solana node to simulate them. Nothing was sent and no SOL was spent.

The mainnet dry run

node tests-js/sim-mainnet.mjs picks a live pump.fun token, reads its bonding curve and the program's global account, then simulates, with a funded account standing in for the stealth address (simulation needs a fee payer with SOL, and signature checking is off for this run; signatures are covered by the engine tests):

mint HSAEKR2FaJcdvM6eBDmburvryqxkXfvNaRUL6ByEpump
mayhem false  cashback true
PASS  buy simulates without error
PASS  buy credits the stealth token account       706,014,781,925 raw units
PASS  buy delivers at least the minimum tokens
PASS  marker is part of the compiled message
PASS  sell after buy simulates without error
PASS  token transfer to another wallet simulates without error
PASS  closing an empty token account simulates without error
PASS  return-SOL transaction is well formed
8 passed, 0 failed

The same eight checks pass on three kinds of curve: a plain one, one with cashback enabled (the sell needs an extra account) and one in mayhem mode (only the reserved fee recipients are accepted). The run measured:

  • A fresh address spends 2,895,040 lamports beyond the SOL it puts into the curve: token account rent, volume account rent and fees.
  • The buy uses about 135,000 compute units, inside the 300,000 requested.
  • The tokens received came out within 1 % of the quote.

Why the dry run matters

The first runs of this test failed, and each failure was a real change in the pump.fun program that no documentation announced:

  1. The old 27-account buy returned MintDoesNotMatchBondingCurve on newer tokens, whose curves are quoted in other assets.
  2. buy_exact_sol_in returned NotAuthorized until the fee recipient was taken from the global account instead of a fixed address.
  3. Then BuybackFeeRecipientMissing, until a buyback recipient and the bonding-curve-v2 account were appended.
  4. Selling a cashback coin returned InvalidCashbackAccumulator, until the volume accumulator was added.
  5. Mayhem-mode coins returned NotAuthorized again, until their reserved fee recipients were used.

Each is now handled and covered by the dry run.

The engine tests

PASS  base58 decode matches web3.js
PASS  meta-address rejects a point of small order
PASS  the derived scalar controls exactly that address
PASS  a stealth address is a valid on-curve Solana address
PASS  signature verifies with node:crypto (independent ed25519)
PASS  scan finds exactly my three among 403
PASS  bonding curve PDA matches web3.js
PASS  compiled message decodes to the same instructions as web3.js
PASS  web3.js verifies the stealth signature
PASS  buy transaction lists the marker
PASS  buy transaction fits the packet limit      955 bytes
42 passed, 0 failed

What a buy costs

pump.fun's fees (about 1.25 %), a base fee of 5,000 lamports and a small priority fee, plus about 0.003 SOL of rent for the new token account and volume account. Part of that rent comes back when you close the token account.

Not yet shown here

A full live round trip with real funds. This page will get the signatures once one has been run.