# route-swap

{% hint style="warning" %}
This endpoint does not submit the transaction to the network.
{% endhint %}

This endpoint is intended for advanced usage. A simple application of this endpoint would be to use [Get Quotes](https://docs.bloxroute.com/solana/trader-api/api-endpoints/jupiter/quotes) to compute several routes, and then use the best route to create the steps in this endpoint.

### Request

#### Method:&#x20;

`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:

<table><thead><tr><th width="196.71896910191123">Parameter</th><th width="218">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerAddress</code></td><td>string</td><td>Solana address which is placing swap.</td></tr><tr><td><code>steps</code></td><td>[]<code>JupiterRouteStep</code></td><td>Route definition for each swap step.</td></tr><tr><td><code>slippage</code></td><td>double</td><td>The maximum slippage tolerance in percentage.</td></tr><tr><td><code>computePrice</code></td><td>uint64</td><td><strong>OPTIONAL</strong>. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport)  to overwrite default Jupiter compute price. </td></tr></tbody></table>

`JupiterRouteStep`

<table><thead><tr><th width="207.33333333333331">Parameter</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>inToken</code></td><td>string</td><td>Symbol or token program address of the swap-in token for the current step.</td></tr><tr><td><code>outToken</code></td><td>string</td><td>Symbol or token program address of the swap-out token for the current step. Mutually exclusive with <code>project.id</code></td></tr><tr><td><code>inAmount</code></td><td>double</td><td>Amount of the swap-in token for the current step.</td></tr><tr><td><code>outAmount</code></td><td>double</td><td>Amount of the swap-out token for the current step.</td></tr><tr><td><code>fee</code></td><td><code>Fee</code></td><td>Fee information. See <code>fee</code> for detail. </td></tr><tr><td>project</td><td><code>StepProject</code></td><td>See <code>StepProject</code> below</td></tr></tbody></table>

`StepProject`

<table><thead><tr><th width="207.33333333333331">Parameter</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>label</code></td><td>string</td><td>Cosmetic label describing containing project. Not necessary for this usage.</td></tr><tr><td><code>id</code></td><td>string</td><td>Pool address to swap through for this step. Mandatory for Jupiter swaps, to distinguish between different AMM projects available in Jupiter.</td></tr></tbody></table>

`Fee`

<table><thead><tr><th width="207.33333333333331">Parameter</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amount</code></td><td>float</td><td>Amount of the fee being charged off. </td></tr><tr><td><code>mint</code></td><td>string</td><td>Token mint address of the token being charged off. </td></tr><tr><td><code>percent</code></td><td>float</td><td>Percentage of the swap was charged as fee. </td></tr></tbody></table>

#### Request example:

{% tabs %}
{% tab title="HTTP" %}

<pre class="language-bash"><code class="lang-bash"><strong>curl --header "Authorization: $AUTH_HEADER" -X 'POST' \
</strong>  '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
            }
        }
    ]
}'
</code></pre>

{% endtab %}
{% endtabs %}

### Response:

#### Fields:

<table><thead><tr><th width="177.5236885968357">Field</th><th width="235">Type</th><th width="419.58916051319363">Description</th></tr></thead><tbody><tr><td><code>transactions</code></td><td>[] <code>TransactionMessage</code> </td><td>See <code>TransactionMesasge below</code> below for details.</td></tr><tr><td><code>outAmount</code></td><td>double</td><td>Amount of tokens expected from the swap</td></tr><tr><td><code>outAmountMin</code></td><td>double</td><td>Minimum amount of tokens allowed from swap given slippage</td></tr><tr><td><code>priceImpact</code></td><td><code>PriceImpactV2</code></td><td>Impact of swap upon the pool's liquidity. See <code>PriceImpactV2</code> below for details.</td></tr><tr><td><code>fee</code></td><td>[]<code>Fee</code></td><td>Fee paid to AMM project. See <code>Fee</code> below for details.</td></tr></tbody></table>

`TransactionMessage`

<table><thead><tr><th width="204">Parameter</th><th width="171.2"></th><th width="369">Description</th></tr></thead><tbody><tr><td><code>content</code></td><td>txbase64Payload</td><td>Raw bytes of signed transaction.</td></tr></tbody></table>

`PriceImpactV2`

<table><thead><tr><th width="148.5236885968357">Field</th><th width="150">Type</th><th width="419.58916051319363">Description</th></tr></thead><tbody><tr><td><code>percent</code></td><td>double</td><td>Percentage impact on price.</td></tr><tr><td><code>infinity</code></td><td>string</td><td>Indicates possible infinity values: <code>INF_NOT</code>, <code>INF_POSITIVE</code>, <code>INF_NEGATIVE</code>. Usually <code>INF_NOT</code>.</td></tr></tbody></table>

`Fee`

<table><thead><tr><th width="177.5236885968357">Field</th><th width="150">Type</th><th width="419.58916051319363">Description</th></tr></thead><tbody><tr><td><code>amount</code></td><td>float</td><td>Amount paid to AMM project</td></tr><tr><td><code>mint</code></td><td>string</td><td>Token currency the fee is paid in</td></tr><tr><td><code>percent</code></td><td>float</td><td>Percentage of the swap consumed by the fee</td></tr></tbody></table>

#### Example:

{% tabs %}
{% tab title="JSON" %}

```json
```

{% endtab %}
{% endtabs %}
