跳转到主要内容
POST
/
swap-instructions
Build swap instructions
curl --request POST \
  --url https://raptor-beta.solanatracker.io/swap-instructions \
  --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
}
'
{
  "tokenLedgerInstruction": {
    "programId": "<string>",
    "accounts": [
      {
        "pubkey": "<string>",
        "isSigner": true,
        "isWritable": true
      }
    ],
    "data": "<string>"
  },
  "computeBudgetInstructions": [
    {
      "programId": "<string>",
      "accounts": [
        {
          "pubkey": "<string>",
          "isSigner": true,
          "isWritable": true
        }
      ],
      "data": "<string>"
    }
  ],
  "setupInstructions": [
    {
      "programId": "<string>",
      "accounts": [
        {
          "pubkey": "<string>",
          "isSigner": true,
          "isWritable": true
        }
      ],
      "data": "<string>"
    }
  ],
  "swapInstruction": {
    "programId": "<string>",
    "accounts": [
      {
        "pubkey": "<string>",
        "isSigner": true,
        "isWritable": true
      }
    ],
    "data": "<string>"
  },
  "cleanupInstruction": {
    "programId": "<string>",
    "accounts": [
      {
        "pubkey": "<string>",
        "isSigner": true,
        "isWritable": true
      }
    ],
    "data": "<string>"
  },
  "addressLookupTableAddresses": [
    "<string>"
  ]
}

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

响应

200 - application/json

Successful instruction build

tokenLedgerInstruction
object
computeBudgetInstructions
object[]
setupInstructions
object[]
swapInstruction
object
cleanupInstruction
object
addressLookupTableAddresses
string[]