# Jupiter (Aggregator)

### /getprice

Returns the swap quoatation for the given token pair.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getprice`

#### Query Parameter

| Name                                       | Type   | Description                                                                               |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------------- |
| rpc                                        | String | Remote procedural call URL.                                                               |
| dexId<mark style="color:red;">\*</mark>    | String | Refer to the [DEX ID](https://docs.expand.network/important-ids/dex-id) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma separated values of token addresses/token symbol whose price is to be fetched.      |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                                          |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/dex/getprice?dexId=2600&path=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v%2CEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB&amountIn=100000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "100000",
        "path": [
            "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
            "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
        ],
        "amountsOut": [
            "100000",
            "100404"
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /getroute

Retrieves the route details for a swap for a given token pair.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getroute`

#### Query Parameter

| Name                                       | Type   | Description                                                                               |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------------- |
| rpc                                        | String | Remote procedural call URL.                                                               |
| dexId<mark style="color:red;">\*</mark>    | String | Refer to the [DEX ID](https://docs.expand.network/important-ids/dex-id) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma separated values of token addresses/token symbol whose price is to be fetched.      |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                                          |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/dex/getroute?dexId=2600&path=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263%2CHhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4&amountIn=100000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "swapInfo": {
                "ammKey": "Gio5iGZF9YVvhX6vwW3fZEfnPhtafseapaseGbAoiH9D",
                "label": "OpenBook V2",
                "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "inAmount": "20000000000000",
                "outAmount": "4699160000",
                "feeAmount": "0",
                "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            "percent": 20
        },
        {
            "swapInfo": {
                "ammKey": "GBMoNx84HsFdVK63t8BZuDgyZhSBaeKWB4pHHpoeRM9z",
                "label": "Phoenix",
                "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "inAmount": "80000000000000",
                "outAmount": "18805042455",
                "feeAmount": "9407225",
                "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            "percent": 80
        },
        {
            "swapInfo": {
                "ammKey": "5WGYajM1xtLy3QrLHGSX4YPwsso3jrjEsbU1VivUErzk",
                "label": "Raydium",
                "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "outputMint": "HhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4",
                "inAmount": "4699160000",
                "outAmount": "32843399126401",
                "feeAmount": "11747900",
                "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
            },
            "percent": 19
        },
        {
            "swapInfo": {
                "ammKey": "4ahqRcJkAepQAm2QBCwmQEYATm5nWuiSKMCBehz584yH",
                "label": "Phoenix",
                "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "outputMint": "HhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4",
                "inAmount": "18805042455",
                "outAmount": "131448123060000",
                "feeAmount": "65756940000",
                "feeMint": "HhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4"
            },
            "percent": 81
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getliquiditysources

Retrieves the liquidity sources on Jupiter&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getliquiditysources`

#### Query Parameter

| Name                                    | Type   | Description                                                                               |
| --------------------------------------- | ------ | ----------------------------------------------------------------------------------------- |
| rpc                                     | String | Remote procedural call URL.                                                               |
| dexId<mark style="color:red;">\*</mark> | String | Refer to the [DEX ID](https://docs.expand.network/important-ids/dex-id) page for details. |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/dex/getliquiditysources?dexId=2600
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        "Raydium",
        "Orca",
        "Meteora",
        "Phoenix",
        "Lifinity",
        "Openbook v2",
        "Sanctum",
        "Saber",
        "Perps",
        "Invariant",
        "Cropper",
        "FluxBeam",
        "BonkSwap",
        "Stepn",
        "Openbook",
        "Dexlab",
        "Clone",
        "Crema",
        "Saros",
        "Helium Network",
        "GuacSwap",
        "Aldrin",
        "Token Swap",
        "Oasis",
        "Step",
        "Penguin",
        "Sencha"
    ]
}
```

{% endtab %}
{% endtabs %}

### /swap

Initiate a swap on the Solana network leveraging Jupiter.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/dex/swap`

#### Request Body

| Name                                       | Type   | Description                                                                               |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------------- |
| rpc                                        | String | Remote procedural call URL.                                                               |
| dexId<mark style="color:red;">\*</mark>    | String | Refer to the [DEX ID](https://docs.expand.network/important-ids/dex-id) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma-separated values of token addresses/token symbol, inside an array, to swap.         |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token to be swapped.                                                            |
| from<mark style="color:red;">\*</mark>     | String | Address of the sender of the token.                                                       |
| slippage<mark style="color:red;">\*</mark> | String | <p>Percentage of total swap value. By default, 1.</p><p>0 <= slippage value <= 100</p>    |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "dexId": "2600",
    "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
    "amountIn": "10000",
    "path": [
        "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ],
    "slippage": "10"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "900",
        "from": "6r3DSYWNRw437o6cZfe9CnygqoeFDZbnxiqf5xhFMMD9",
        "to": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
        "data": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAFD1baZfDzmdMUpp4qfdfCQD9rOAvM7ijkr3Lnw/wVOABQO7sAR2gDS0+R1HXkqqjr0Wo3+auYeJQtq0il4DAumghPvgunKv7mWa4NEy2TlszlbpidpeeqdQ4xwmGWS9hevV6k/Ec158v1jAliA05vSjjEKbcui/99aMbFBMKAg5rQh1AqmZXlaSkwnGGrzUnj/jmig6f4dGPWGwdDK/q6PdGiHZpJZ1Uy9xq1yiOta3BcBOI7Dv+jmETs0W7Leny+ArSKwzgdk6RKYenUYVzmok5VPRuhgv9I2YxKOUUxkLXFzbIi97HfAp8UngBXA1SbQdtOJNdGP95RHDUjWw3y1j3fsLhf7Ff9NofcPgIyAbMytm5ggTyKwmR+JqgXUXARVe3lmUk+AGboT02FkLff2iWDfHa8/ybUT6mxDB6GLfUgAwZGb+UhFzL/7K26csOb57yM5bvF9xJrLEObOkAAAAAEedVb8jHAbu50xW7OaBUH/bGy3qP0jlECsc2iVrwTj09LbA5BCP0qaiR46uCsxZ2yG7Tt9RHBYs9gLR4MCQH7aQ5ACXQsnbnGpvA5kJ2tNH87VcS0vJEdjWRHWT4ICoC0P/on9df2SnTAmx8pWHneSwmrNt/J3VFLMhqns4zl6ANa7bAA2exulF4tqDAa3or75yoacIyb++TxYJVI6ix8AwoABQLAXBUACgAJA+pkAAAAAAAAC0EfDAADAQgGJiILCw4LHRsdGRwBCSAmGh0MHx8hHQQCBwsdEh0PEAkFIB4THQwfHyEdEQsjJBYMBQgUFRgXHw0NJSzBIJszQdacgQcDAAAAJmQAASZkAQIZZAIDECcAAAAAAAAsJwAAAAAAAOgDAAOm2MgPPB3Ztyzl/3Ld3wmEAGgtTOsqn8Lkw2W2P5B2FwUQCg4SDAYREwAPDWGrhgWStZrZSVSeYkpWy+Z6i8NhUjcaFEHVMHn+t6k30wW6vLm7tgNCuLdpSCRn39lHASoAgNKdrjT5j2FpwGLAwBF+71dN4fE9agSWl5hZAVg=",
        "referenceId": "010b2d8c69f849f4bae76ec87744110e"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expand.network/integrations/dex-and-dex-aggregators/jupiter-aggregator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
