Raydium

Raydium is a decentralized exchange built on the Solana Blockchain.

Supported Chains

Available on Solana

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getprice GET - Returns the swap quotation for a given token pair on Raydium AMM

  • /getuserliquidity GET - Returns the balance of a particular token pair of an account.

  • /getpoolliquidity GET - Returns the total liquidity for a specified pool.

  • /gettokenliquidity GET - Returns the individual token liquidity within the specified liquidity pool.

  • /swap POST - Initiate a swap transaction on a specified DEX.

  • /addliquidity POST - Add liquidity to a specified pool in a specified DEX.

  • /removeliquidity POST - Remove liquidity from a specified pool in a specified DEX.

Also see Error Handling Details

DEX IDs

Please use DEX ID 2700 for Raydium. See the DEX ID page for a complete list of DEX IDs.

Endpoint Details

/getprice

Returns the swap quotation for the given token pair.

GET https://api.expand.network/dex/getprice

Query Parameters

https://api.expand.network/dex/getprice?dexId=2700&path=So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amountIn=1000000000000000

back to top

/getuserliquidity

Returns the balance of a particular token pair of an account.

GET https://api.expand.network/dex/getuserliquidity

Query Parameters

https://api.expand.network/dex/getuserliquidity?dexId=2700&poolAddress=58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2&address=DgbCWnbXg43nmeiAveMCkUUPEpAr3rZo3iop3TyP6S63

back to top

/getpoolliquidity

Returns the total liquidity for a specified pool.

GET https://api.expand.network/dex/getpoolliquidity

Query Parameters

https://api.expand.network/dex/getpoolliquidity?dexId=2700&poolAddress=58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2

back to top

/gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

GET https://api.expand.network/dex/gettokenliquidity

Query Parameters

https://api.expand.network/dex/gettokenliquidity?dexId=2700&poolAddress=58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2

back to top

/swap

Initiate a swap transaction on a specified DEX.

POST https://api.expand.network/dex/swap

Request Body

{
    "dexId": "2700",
    "from": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
    "amountIn": "1000000000",
    "path": [
        "So11111111111111111111111111111111111111112",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ]
}

With Slippage:

{
    "dexId": "2700",
    "from": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
    "amountIn": "1000000000",
    "path": [
        "So11111111111111111111111111111111111111112",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ],
    "slippage": "10"
}

back to top

/addliquidity

Add liquidity to a specified pool in a specified DEX.

POST https://api.expand.network/dex/addliquidity

Request Body

{
    "amountIn": [
        "100000000",
        "1000000"
    ],
    "from": "3CpV6SbiX65BmZ8g3Bx7X1uMcWBueHxrpYbVrL1E5y8J",
    "path": [
        "7BgBvyjrZX1YKz4oh9mjb8ZScatkkwb8DzFx7LoiVkM3",
        "So11111111111111111111111111111111111111112"
    ],
    "dexId": "2700"
}

With Slippage:

{
    "amountIn": [
        "100000000",
        "1000000"
    ],
    "from": "3CpV6SbiX65BmZ8g3Bx7X1uMcWBueHxrpYbVrL1E5y8J",
    "path": [
        "7BgBvyjrZX1YKz4oh9mjb8ZScatkkwb8DzFx7LoiVkM3",
        "So11111111111111111111111111111111111111112"
    ],
    "slippage": "10",
    "dexId": "2700"
}

back to top

/removeliquidity

Remove liquidity from a specified pool for a specified DEX.

POST https://api.expand.network/dex/removeliquidity

Request Body

{
    "dexId": "2700",
    "from": "HXjWEL3bYucHDpLi81NwCewYKaqJMPdCfxkaSZTu6K2s",
    "liquidity": "10000",
    "path": [
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "So11111111111111111111111111111111111111112"
    ],
    "poolAddress": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"
}

With Slippage:

{
    "dexId": "2700",
    "from": "HXjWEL3bYucHDpLi81NwCewYKaqJMPdCfxkaSZTu6K2s",
    "liquidity": "10000",
    "path": [
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "So11111111111111111111111111111111111111112"
    ],
    "poolAddress": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
    "slippage": "10"
}

back to top

Error Handling Details

back to top

Last updated