Skip to content

POST /v1/tx/swap

Builds an unsigned transaction for a generic swap (power endpoint).

  • Method: POST
  • Path: /v1/tx/swap
Authorization: Bearer api_your_key_here
Content-Type: application/json
{
"inputMint": "SOL",
"outputMint": "TOKEN_MINT",
"amount": 0.002,
"swapMode": "exactIn",
"slippage": 0.05,
"priority": "fast"
}
  • inputMint / outputMint (string, required): "SOL" or a Solana mint address
  • amount (number, required): (> 0)
  • swapMode (string, required):
    • exactIn: amount is the exact input amount
    • exactOut: amount is the exact output amount
  • 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": "TOKEN_MINT",
"outputMint": "So11111111111111111111111111111111111111111",
"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.