Skip to content

POST /v1/tx/buy

Builds an unsigned transaction to buy a token with SOL.

  • Mode: exactIn (you specify exact SOL in, token out is estimated)
  • Auth: required (see API Authentication)
  • Errors: see Errors
  • Method: POST
  • Path: /v1/tx/buy
Authorization: Bearer api_your_key_here
Content-Type: application/json
{
"mint": "TOKEN_MINT",
"solAmount": 0.002,
"slippage": 0.05,
"priority": "fast"
}
  • mint (string, required): token mint address (Solana address)
  • solAmount (number, required): SOL amount to spend
  • slippage (number, required): decimal, (0 <= slippage < 1). Example: 0.05 = 5%
  • priority (string, required): see Priority (economy | fast | faster | fastest)
{
"success": true,
"data": {
"submissionToken": "txn_…",
"unsignedTransaction": "BASE64_WIRE_TRANSACTION",
"expiresAt": "2025-01-01T00:00:00.000Z",
"platform": "pump_fun",
"inputMint": "So11111111111111111111111111111111111111111",
"outputMint": "TOKEN_MINT",
"estimates": {
"inputAmount": 0.002,
"outputAmount": 70598.459309,
"priceImpact": 0.00346
},
"priorityCost": 0.000005125
}
}
  • submissionToken links this built transaction for submission via POST /v1/tx/submit.
  • inputMint / outputMint are from the DEX perspective (what goes in vs what comes out).
  • estimates are best-effort outputs assuming the market doesn’t move between build and execution.
  • priceImpact shows how much your trade will move the price; 0.1 means ~10% price impact.