Skip to main content
POST
/
swap
swap
curl --request POST \
  --url https://lite-api.jup.ag/swap/v1/swap \
  --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
  }
}'
{
  "swapTransaction": "<string>",
  "lastValidBlockHeight": 123,
  "prioritizationFeeLamports": 123
}

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
swapTransaction
string
required
lastValidBlockHeight
integer
required
prioritizationFeeLamports
integer