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

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

path*

String

Comma separated values of token addresses whose price is to be fetched.

amountIn*

String

Token amount for which the swap quotation is to be fetched.

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

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

poolAddress*

String

Pool address whose liquidity is to be fetched.

address*

String

Public address of liquidity provider.

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

Name
Type
Description

rpc

String

Remote procedural call URL.

poolAddress*

String

Pool address whose liquidity is to be fetched.

dexId*

String

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

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

poolAddress*

String

Pool address whose token liquidity is to be fetched.

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

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

path*

Array

Comma-separated values of token addresses, inside an array, which needs to be swap.

amountIn*

String

Amount of token to be swapped.

from*

String

Address of the sender of the token.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 100

{
    "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

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

path*

Array

Comma-separated values of token addresses, inside an array, which needs to be added to the pool.

amountIn*

Array

Comma-separated values of tokens amount, inside an array, which needs to be added to the pool.

from*

String

Address of the sender of the token.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 100

{
    "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

Name
Type
Description

rpc

String

dexId*

String

path*

Array

Comma-separated values of token addresses, inside an array, which needs to be added to the pool.

from*

String

Address of the sender of the token.

liquidity*

String

Total amount of liquidity to be removed from the given pool.

poolAddress*

String

The address of the pool.

Slippage

String

Percentage of total value. By default, 1. 0 <= slippage value <= 10

{
    "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

Error
Description

400 (Bad Request)

Indicates the request is invalid or missing the required parameters. The msg field will contain details about the error.

401 (Unauthorised)

Indicates the request lacks valid authentication credentials (API key). Ensure that you provide a valid API key in the request headers.

404 (Not Found)

Indicates that the specified endpoint or resource does not exist.

500 (Server Error)

Indicates an internal server error.

back to top

Last updated