Skip to the content
PokedexDocs

Buy with SOL

A buyer with only SOL buys any coin in one transaction: SOL buys the card token on its CARD/SOL pool, and the card token buys the coin. Every write in the app is simulated on mainnet first, so you see the balance changes before your wallet signs.

On this page

The route

One transaction, two swaps
  1. SOLWrapped in the same transaction.
  2. CARDBought on the class's CARD/SOL DAMM v2 pool, with a minimum out.
  3. COINExactly that minimum of CARD buys the coin on its curve, or on its COIN/CARD pool after graduation.
Any card tokens above the first leg's minimum stay in the buyer's wallet as change.

The transaction is a legacy Solana transaction with no lookup table:

  1. Create the wrapped SOL account, move the SOL in, and sync it.
  2. Create the card token and coin accounts, if they do not exist.
  3. Swap SOL for the card token on the class's CARD/SOL DAMM v2 pool, with a minimum out.
  4. Swap exactly that minimum of card tokens for the coin on its curve. After graduation this leg goes through the coin's COIN/CARD DAMM v2 pool instead.

Any card tokens the first leg returns above its minimum stay in your wallet as change. The app shows them as "back to you (est.)".

MeasuredValue
Size1,005 to 1,057 bytes, under the 1,232-byte limit of a legacy transaction
Computeabout 80k to 140k compute units

Selling goes the other way: the coin for card tokens on the curve, then card tokens for SOL on the pool.

The CARD/SOL pool

Each card token has one DAMM v2 customizable pool against SOL.

PropertyValue
PairCard token / wrapped SOL
Price rangeFull range
Fee0.25% base fee
Starting priceThe card's value in SOL divided by 1,000, chosen by whoever seeds it
PositionThe pool's position NFT goes to whoever created the pool; it is not locked

Buying with the card token

If you already hold card tokens, you can buy a coin with them directly. The app does it with DBC's swap2 in partial-fill mode, which is also the only way to make the last buy of a curve: an exact-in buy past the end of the curve fails with Meteora error 6033 (InsufficientLiquidity), while a partial fill takes what is left and returns the rest.

What the app checks before you sign

  • Simulation. Every write is simulated on mainnet whenever its inputs change and again right before signing. The panel shows the simulated balance changes, compute units and size, or the decoded program error.
  • Price impact. Every quote shows the cost of size alone. Above 2% the panel warns, above 10% it warns strongly. The SOL route shows the combined impact of both legs.
  • Fill limits. A pool swap that would leave the pool's price range is blocked. A curve buy past the end of the curve is blocked on exact-in routes and explained as a partial fill when buying with the card token. A sell larger than the curve can pay back is blocked.
  • Slippage. Max slippage defaults to 1%, with 0.5%, 1%, 3% and 10% to choose from.
  • Fees on Solana. The compute limit is set to the simulated use plus 20%, with a priority fee of 20,000 micro-lamports per compute unit. Max keeps 0.01 SOL back for fees and rent.

The rest of this path

Solana mainnet

Written from the protocol, security and card documents of the pokedex repository and from its code (card-vault, card-launch, cp-ix). Every figure on these pages comes from there.

UpDown to moveEnter to open