Skip to main content
POST
/
swap-instructions
swap-instructions
curl --request POST \
  --url https://lite-api.jup.ag/swap/v1/swap-instructions \
  --header 'Content-Type: application/json' \
  --data '{
  "userPublicKey": "<string>",
  "payer": "<string>",
  "wrapAndUnwrapSol": true,
  "useSharedAccounts": true,
  "feeAccount": "<string>",
  "trackingAccount": "<string>",
  "prioritizationFeeLamports": {
    "priorityLevelWithMaxLamports": {
      "priorityLevel": "medium",
      "maxLamports": 123,
      "global": false
    }
  },
  "asLegacyTransaction": false,
  "destinationTokenAccount": "<string>",
  "nativeDestinationAccount": "<string>",
  "dynamicComputeUnitLimit": false,
  "skipUserAccountsRpcCalls": false,
  "dynamicSlippage": false,
  "computeUnitPriceMicroLamports": 123,
  "blockhashSlotsToExpiry": 123,
  "quoteResponse": {
    "inputMint": "<string>",
    "inAmount": "<string>",
    "outputMint": "<string>",
    "outAmount": "<string>",
    "otherAmountThreshold": "<string>",
    "swapMode": "ExactIn",
    "slippageBps": 1,
    "platformFee": {
      "amount": "<string>",
      "feeBps": 123
    },
    "priceImpactPct": "<string>",
    "routePlan": [
      {
        "swapInfo": {
          "ammKey": "<string>",
          "label": "<string>",
          "inputMint": "<string>",
          "outputMint": "<string>",
          "inAmount": "<string>",
          "outAmount": "<string>",
          "feeAmount": "<string>",
          "feeMint": "<string>"
        },
        "percent": 123,
        "bps": 123
      }
    ],
    "contextSlot": 123,
    "timeTaken": 123
  }
}'
{
  "otherInstructions": [
    {
      "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>"
  ]
}

Body

application/json
userPublicKey
string
required
quoteResponse
object
required
payer
string
wrapAndUnwrapSol
boolean
default:true
useSharedAccounts
boolean
feeAccount
string
trackingAccount
string
prioritizationFeeLamports
object
  • priorityLevelWithMaxLamports
  • jitoTipLamports
  • jitoTipLamportsWithPayer
asLegacyTransaction
boolean
default:false
destinationTokenAccount
string
nativeDestinationAccount
string
dynamicComputeUnitLimit
boolean
default:false
skipUserAccountsRpcCalls
boolean
default:false
dynamicSlippage
boolean
default:false
computeUnitPriceMicroLamports
integer
blockhashSlotsToExpiry
integer

Response

200 - application/json
otherInstructions
object[]
required
computeBudgetInstructions
object[]
required
setupInstructions
object[]
required
swapInstruction
object
required
addressLookupTableAddresses
string[]
required
cleanupInstruction
object