POST
/
dex
/
{chain}
/
route
curl --request POST \
  --url https://api-dex.chainstream.io/dex/{chain}/route \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "dex": "raydium",
  "userAddress": "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH",
  "priorityFee": "0.000001",
  "amount": "1000000000",
  "swapMode": "ExactIn",
  "slippage": 5,
  "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
}'
{
  "args": {
    "dex": "raydium",
    "userAddress": "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH",
    "priorityFee": "0.000001",
    "amount": "1000000000",
    "swapMode": "ExactIn",
    "slippage": 5,
    "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  },
  "serializedTx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRgYGpQEDAQIABQcICQoLDA0ODwAAAAAAAAAAAAAQERITFBUWFxgZGhscHR4fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
  "routeInfo": {
    "inAmount": "1000000000",
    "outAmount": "985000000",
    "priceImpact": "0.15",
    "route": [
      "USDC",
      "SOL"
    ]
  },
  "elapsedTime": 245
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chain
enum<string>
required

A chain name listed in supported networks

Available options:
sol,
base

Body

application/json
dex
enum<string>
required

DEX identifier for the trade

Available options:
raydium,
meteora,
pumpfun,
moonshot,
jupiter
Example:

"raydium"

userAddress
string
required

Public key of the wallet initiating the transaction

Required string length: 8 - 64
Example:

"HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH"

amount
string
required

Amount to swap. Use "auto" for full balance or percentage like "50%"

Example:

"1000000000"

swapMode
enum<string>
required

Swap direction mode

Available options:
ExactIn,
ExactOut
Example:

"ExactIn"

slippage
number
default:5
required

Slippage tolerance percentage

Required range: 0 <= x <= 100
Example:

5

priorityFee
string

Priority fee in SOL to increase transaction processing speed

Example:

"0.000001"

inputMint
string

Input Mint, the base token address

Required string length: 8 - 64
Example:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

outputMint
string

Ouput Mint, the quote token address

Required string length: 8 - 64
Example:

"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"

Response

200 - application/json
args
object
required

Original swap request parameters

serializedTx
string
required

Base64 encoded transaction

Example:

"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRgYGpQEDAQIABQcICQoLDA0ODwAAAAAAAAAAAAAQERITFBUWFxgZGhscHR4fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="

routeInfo
object
required

Detailed routing information

Example:
{
  "inAmount": "1000000000",
  "outAmount": "985000000",
  "priceImpact": "0.15",
  "route": ["USDC", "SOL"]
}
elapsedTime
number
required

Time taken to process the request in milliseconds

Example:

245