Create Route Swap

Creates an unsigned transaction for a swap along the provided route using Jupiter.

This endpoint does not submit the transaction to the network.

This endpoint is intended for advanced usage. A simple application of this endpoint would be to use Get Quotes to compute several routes, and then use the best route to create the steps in this endpoint.

Request

Method:

POST ./api/v2/jupiter/route-swap

The tip parameter is currently not supported. You can create an additional transaction with an tip instruction and submit the swap & tip transactions as a Bundle.

Parameters:

JupiterRouteStep

StepProject

Fee

Request example:

curl --header "Authorization: $AUTH_HEADER" -X 'POST' \
  'https://ny.solana.dex.blxrbdn.com/api/v2/jupiter/route-swap' \
  -H 'Content-Type: application/json' \
  -d '{
    "ownerAddress": "AFT8...UDfQ",
    "steps": [
        {
            "project": {
                "label": "Invariant",
                "id": "2SgUGxYDczrB6wUzXHPJH65pNhWkEzNMEx3km4xTYUTC"
            },
            "inToken": "So11111111111111111111111111111111111111112",
            "outToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
            "inAmount": 0.1,
            "outAmount": 0.000099274,
            "fee": {
                "amount": 0.000001,
                "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
                "percent": 0.0001
            }
        }
    ]
}'

Response:

Fields:

TransactionMessage

PriceImpactV2

Fee

Example:

Last updated