Skip to content

Memecoins Trade

Build Swap

A buy or sell as an unsigned transaction for your wallet to sign. Simulated first; a failing one is refused.

POST /v1/memecoin/swap

Chains
+2on 8 chains; pick one with chain. The answer has the same shape on every one.
Price
Each call costs $0.005. Your first 100 priced calls each day are free, so you can try it before adding credits.
Freshness
Computed fresh on every call.
Answer
Always { data, cost_usd, balance_usd, cached, request_id }.

Parameters

NameTypeRequiredWhat it isExample
mintbodystringyesThe coin's mint address.8o9YbJHdhhpJgyPoWDRZBqvJkKCiKZYuVkW6Qpccpump
walletbodystringyesThe wallet that will sign and pay. Only its public address.7FVfSdnR9VPGjMtmBP1Hz9C2DFTpoNX8gVVRmnimnGt9
amountbodynumberyesSOL to spend for a buy; tokens to sell for a sell.0.1
sidebodystringno, default buy"buy" (spend SOL) or "sell" (sell tokens).buy
slippage_bpsbodynumberno, default 500Most the price may move before the swap fails, in basis points (100 = 1%).500
chainbodystringno, default solanaWhich chain: solana, ethereum, base, bsc, arbitrum, polygon, avalanche, optimism, hyperevm, monad, abstract, sonic, berachain, sei, linea, zksync, mantle, unichain, ronin, cronos, worldchain, scroll, celo, pulsechain, ink, soneium, metis, manta, katana, plasma, flowevm, kava, tron, sui, ton, aptos, near, starknet, xrpl, injective, hyperliquid, robinhood, elysium, arc, megaeth, fantom, opbnb, zora, mode, taiko, lisk, fraxtal, apechain, story, sophon, gnosis, core, xlayer, hedera, polygonzkevm, immutable, kaia, aurora, boba, shibarium, rootstock, bitlayer, merlin, etherlink, xrplevm, vana, bob, shape, beam, memecore, stable, tempo, stacks, cardano, stellar. Default solana.solana

Try it

A real call. Your first 100 priced calls a day are free; after that it costs the price above. Edit anything and run it.

chainbody
8 chains; type to search. Default solana. The answer has the same shape on every one.

Response

Example data (the answer sits inside the envelope)

{
  "data": {
    "amount": 0.1,
    "quote": {
      "amount": 0.1,
      "mint": "8o9YbJHdhhpJgyPoWDRZBqvJkKCiKZYuVkW6Qpccpump",
      "side": "buy",
      "amount_in": 0.1,
      "in_unit": "SOL",
      "expected_out": 506340.116307,
      "out_unit": "tokens",
      "min_out": 481023.110492,
      "price_impact_pct": 0.0178,
      "slippage_bps": 500,
      "route": [
        "Pump.fun Amm"
      ],
      "fees": {
        "route_fee_sol": 0,
        "network_fee_sol": 0.000005,
        "crypto2api_fee_usd": 0
      },
      "value_usd": 7.0431073770534,
      "price_usd": 0.000013909834813054949
    },
    "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA… (base64, 792 chars)",
    "encoding": "base64",
    "fee_payer": "7FVfSdnR9VPGjMtmBP1Hz9C2DFTpoNX8gVVRmnimnGt9",
    "signatures_present": 0,
    "last_valid_block_height": 453095986,
    "priority_fee_lamports": 0,
    "compute_unit_limit": 119995,
    "simulation": {
      "ok": true,
      "error": null,
      "units_consumed": 96253,
      "logs_tail": [
        "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 64181 of 88041 compute units",
        "Program return: JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 Uwc55HUAAAA=",
        "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success"
      ]
    },
    "fee_note": "crypto2api adds no fee instruction to this transaction (quote.fees.crypto2api_fee_usd is 0).",
    "next": "The simulation passed. Have the wallet sign this transaction and send it. It is unsigned; nothing here has or wants a private key."
  },
  "cost_usd": 0.005,
  "balance_usd": "…",
  "cached": false,
  "request_id": "req_…"
}

What the example answered when this page was built, shortened. Run it for a live answer.

Copy it

Runs as-is with your key in place of c2a_your_key. The MCP block gives an agent every endpoint in one server.

curl https://api.crypto2api.com/v1/memecoin/swap \
  -H "Authorization: Bearer c2a_your_key" \
  -H "Content-Type: application/json" \
  -d '{
  "mint": "8o9YbJHdhhpJgyPoWDRZBqvJkKCiKZYuVkW6Qpccpump",
  "wallet": "7FVfSdnR9VPGjMtmBP1Hz9C2DFTpoNX8gVVRmnimnGt9",
  "amount": 0.1,
  "side": "buy",
  "slippage_bps": 500,
  "chain": "solana"
}'