Programs

Bonding Curve

Last updated April 9, 2026

What You'll Do

Run the full bonding curve lifecycle from the CLI:

  • Create a bonding curve token launch via the Genesis API
  • Buy and sell tokens on the curve
  • Check curve status and get price quotes
  • Inspect the bonding curve bucket

Summary

A bonding curve launch creates a constant-product AMM where trading starts immediately — no deposit window. The price rises as SOL flows in, and the curve auto-graduates to a Raydium CPMM pool when all tokens are sold. This page covers the full bonding curve lifecycle.

  • Creation: Via genesis launch create --launchType bonding-curve (API only, no manual flow)
  • Trading: Buy with genesis swap --buyAmount or sell with --sellAmount
  • Info: Check price, reserves, fill percentage with genesis swap --info
  • Inspect: View bucket configuration with genesis bucket fetch --type bonding-curve
  • Graduation: Auto-graduates to Raydium CPMM when fully filled

Jump to: Create a Bonding Curve · Swap (Buy and Sell) · Checking Curve Status · Inspect Bonding Curve Bucket · Full Lifecycle Example · Common Errors · FAQ

Create a Bonding Curve

Bonding curve launches are created via the Genesis API. Only --name, --symbol, and --image are required:

Create a bonding curve launch
mplx genesis launch create --launchType bonding-curve \
--name "My Token" \
--symbol "MTK" \
--image "https://gateway.irys.xyz/abc123"

Optionally configure creator fees, a first buy, or link to an agent:

With creator fee and first buy
mplx genesis launch create --launchType bonding-curve \
--name "My Token" \
--symbol "MTK" \
--image "https://gateway.irys.xyz/abc123" \
--creatorFeeWallet <FEE_WALLET_ADDRESS> \
--firstBuyAmount 0.1
With agent
mplx genesis launch create --launchType bonding-curve \
--name "Agent Token" \
--symbol "AGT" \
--image "https://gateway.irys.xyz/abc123" \
--agentMint <AGENT_CORE_ASSET_ADDRESS> \
--agentSetToken

See Launch (API) for all flags and details.

Bonding curves are only available through the Genesis API. There is no manual bucket add-bonding-curve command.

Swap (Buy and Sell)

The mplx genesis swap command buys or sells tokens on the bonding curve.

Buy tokens (spend 0.05 SOL)
mplx genesis swap <GENESIS_ACCOUNT> --buyAmount 50000000
Sell tokens
mplx genesis swap <GENESIS_ACCOUNT> --sellAmount 500000000000

Swap Options

FlagShortDescriptionRequiredDefault
--buyAmount <string>Amount of quote tokens to spend (e.g. lamports for SOL)No
--sellAmount <string>Amount of base tokens to sellNo
--slippage <integer>Slippage tolerance in basis pointsNo200 (2%)
--bucketIndex <integer>-bIndex of the bonding curve bucketNo0
--infoDisplay curve status and price quotes without swappingNofalse

Exactly one amount required

When swapping, provide exactly one of --buyAmount or --sellAmount. Use --info to view curve status without swapping.

Swap Examples

Buy with custom slippage (1%):

Buy with 1% slippage
mplx genesis swap <GENESIS_ACCOUNT> --buyAmount 50000000 --slippage 100

Swap Output

Expected swap output
--------------------------------
Direction: Buy
Amount In: 50000000 (quote tokens)
Amount Out: <base_tokens_received>
Signature: <transaction_signature>
Explorer: <explorer_url>
--------------------------------

Checking Curve Status

The --info flag displays the current curve state without executing a swap:

Curve status only
mplx genesis swap <GENESIS_ACCOUNT> --info

Combine --info with an amount to get a price quote:

Buy quote (how many tokens for 0.1 SOL?)
mplx genesis swap <GENESIS_ACCOUNT> --info --buyAmount 100000000
Sell quote (how much SOL for selling tokens?)
mplx genesis swap <GENESIS_ACCOUNT> --info --sellAmount 1000000000

The info output includes:

  • Current price per token
  • Reserve balances (base and quote)
  • Fill percentage
  • Whether the curve is currently swappable
  • Price quote with fees and minimum output (when an amount is provided)

Inspect Bonding Curve Bucket

The genesis bucket fetch command with --type bonding-curve retrieves the full bucket configuration:

Fetch bonding curve bucket
mplx genesis bucket fetch <GENESIS_ACCOUNT> --type bonding-curve

Or let the CLI auto-detect the bucket type:

Auto-detect bucket type
mplx genesis bucket fetch <GENESIS_ACCOUNT>

Full Lifecycle Example

Complete bonding curve lifecycle
# 1. Create a bonding curve launch
mplx genesis launch create --launchType bonding-curve \
--name "My Token" --symbol "MTK" \
--image "https://gateway.irys.xyz/abc123"
# (copy GENESIS_ACCOUNT from output)
# 2. Check curve status
mplx genesis swap <GENESIS_ACCOUNT> --info
# 3. Buy tokens (0.1 SOL)
mplx genesis swap <GENESIS_ACCOUNT> --buyAmount 100000000
# 4. Check price after buying
mplx genesis swap <GENESIS_ACCOUNT> --info
# 5. Sell some tokens
mplx genesis swap <GENESIS_ACCOUNT> --sellAmount 500000000000
# 6. Inspect bucket state
mplx genesis bucket fetch <GENESIS_ACCOUNT> --type bonding-curve

Common Errors

ErrorCauseFix
Either --buyAmount or --sellAmount is requiredNo amount specified and --info not usedAdd --buyAmount, --sellAmount, or --info
Cannot specify both --buyAmount and --sellAmountBoth amounts providedUse exactly one amount per swap
Curve is not swappableCurve hasn't started or is sold out (graduated)Check status with --info — the curve may have graduated to Raydium
Slippage exceededPrice moved beyond toleranceIncrease --slippage or retry with a smaller amount
Insufficient fundsNot enough SOL or tokens in walletCheck your balance with mplx toolbox sol balance

Notes

  • All amounts are in base units — for SOL, 1 SOL = 1,000,000,000 lamports
  • When buying with SOL as the quote token, the swap command automatically wraps SOL to WSOL
  • The default slippage of 200 bps (2%) protects against price movement between quote and execution
  • Creator fees are always enabled on bonding curves — they default to the launching wallet and accrue in the bucket during trading
  • After the curve graduates to Raydium, trading continues on the Raydium CPMM pool

FAQ

What pricing model does the bonding curve use? The bonding curve uses a constant-product formula. The price increases as more tokens are bought and decreases as tokens are sold.

Do I need to wrap SOL before buying? No. When buying with SOL, the swap command automatically wraps SOL to WSOL if needed.

How do I check the price before swapping? Use the --info flag to display curve status. Combine --info with --buyAmount or --sellAmount to get a quote without executing a swap.

What happens when the curve is fully filled? When all tokens are sold, the bonding curve auto-graduates to a Raydium CPMM pool. Trading continues on Raydium after graduation.

Can I create a bonding curve with the manual flow? No. Bonding curve launches are only available through the Genesis API via genesis launch create --launchType bonding-curve.

Glossary

TermDefinition
Bonding CurveA constant-product AMM that prices tokens based on supply — price rises as tokens are bought and falls as they are sold
GraduationWhen all tokens on the curve are sold, liquidity auto-migrates to a Raydium CPMM pool
Quote TokenThe token spent when buying (usually SOL) — amounts are in base units (lamports)
Base TokenThe token being launched and traded on the curve
SlippageMaximum allowed price deviation between quote and execution, in basis points
Fill PercentageHow much of the curve's total capacity has been filled (100% = graduation)
Creator FeeA fee on swaps directed to the creator wallet, accrued in the bucket and claimed after graduation