Skip to main content
POST
/
quote-and-swap
Quote and swap in one request
curl --request POST \
  --url https://raptor-beta.solanatracker.io/quote-and-swap \
  --header 'Content-Type: application/json' \
  --data '
{
  "userPublicKey": "<string>",
  "inputMint": "<string>",
  "outputMint": "<string>",
  "amount": 123,
  "slippageBps": "<string>",
  "dexes": "<string>",
  "maxHops": 123,
  "wrapUnwrapSol": true,
  "txVersion": "v0",
  "priorityFee": "<string>",
  "feeAccount": "<string>",
  "feeBps": 123,
  "feeFromInput": false
}
'
{
  "quote": {
    "inputMint": "<string>",
    "outputMint": "<string>",
    "amountIn": "<string>",
    "amountOut": "<string>",
    "minAmountOut": "<string>",
    "feeAmount": "<string>",
    "priceImpact": 123,
    "slippageBps": 123,
    "routePlan": [
      {
        "programId": "<string>",
        "dex": "<string>",
        "pool": "<string>",
        "inputMint": "<string>",
        "outputMint": "<string>",
        "amountIn": "<string>",
        "amountOut": "<string>",
        "feeAmount": "<string>",
        "priceImpact": 123,
        "percent": 123
      }
    ],
    "contextSlot": 123,
    "timeTaken": 123,
    "swapUsdValue": "<string>",
    "priorityFee": {
      "recommended": 123,
      "level": "<string>",
      "levels": {
        "min": 123,
        "low": 123,
        "medium": 123,
        "high": 123,
        "veryHigh": 123,
        "unsafeMax": 123
      }
    },
    "platformFee": {
      "feeBps": 123,
      "feeAccount": "<string>"
    }
  },
  "swapTransaction": "<string>",
  "lastValidBlockHeight": 123
}

Body

application/json
userPublicKey
string
required

User's wallet public key

inputMint
string
required

Input token mint

outputMint
string
required

Output token mint

amount
integer
required

Input amount in lamports

slippageBps
string

Slippage in basis points or 'dynamic'

dexes
string

Comma-separated DEX filter

maxHops
integer

Maximum routing hops

wrapUnwrapSol
boolean
default:true

Automatically wrap/unwrap SOL

txVersion
enum<string>
default:v0

Transaction version

Available options:
legacy,
v0
priorityFee
string

Priority fee mode or microlamports

feeAccount
string

Platform fee recipient

feeBps
integer

Platform fee in basis points

feeFromInput
boolean
default:false

Take fee from input

Response

200 - application/json

Successful quote and transaction build

quote
object
required
swapTransaction
string
required

Base64-encoded transaction

lastValidBlockHeight
integer

Block height until transaction is valid