跳转到主要内容
POST
/
swap
Build swap transaction
curl --request POST \
  --url https://raptor-beta.solanatracker.io/swap \
  --header 'Content-Type: application/json' \
  --data '
{
  "userPublicKey": "<string>",
  "quoteResponse": {
    "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>"
  },
  "wrapUnwrapSol": true,
  "txVersion": "v0",
  "computeUnitPriceMicroLamports": 123,
  "computeUnitLimit": 123,
  "priorityFee": "<string>",
  "maxPriorityFee": 123,
  "tipAccount": "<string>",
  "tipLamports": 123,
  "feeAccount": "<string>",
  "feeBps": 123,
  "feeFromInput": false,
  "chargeBps": 123
}
'
{
  "swapTransaction": "<string>",
  "lastValidBlockHeight": 123,
  "contextSlot": 123,
  "prioritizationFeeLamports": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt

Use this file to discover all available pages before exploring further.

请求体

application/json
userPublicKey
string
必填

User's wallet public key

quoteResponse
object
必填
wrapUnwrapSol
boolean
默认值:true

Automatically wrap/unwrap SOL

txVersion
enum<string>
默认值:v0

Transaction version

可用选项:
legacy,
v0
computeUnitPriceMicroLamports
integer

Priority fee in microlamports

computeUnitLimit
integer

Compute unit limit

priorityFee
string

Priority fee mode or microlamports

maxPriorityFee
integer

Maximum priority fee cap

tipAccount
string

Tip account pubkey

tipLamports
integer

Tip amount in lamports

feeAccount
string

Platform fee recipient

feeBps
integer

Platform fee in basis points

feeFromInput
boolean
默认值:false

Take fee from input

chargeBps
integer

Extra charge on positive slippage

响应

Successful transaction build

swapTransaction
string
必填

Base64-encoded transaction

lastValidBlockHeight
integer
必填

Block height until transaction is valid

contextSlot
integer
必填

Solana slot when built

prioritizationFeeLamports
integer
必填

Priority fee included