Solana Swaps
KyberSwap Aggregator Solana APIs
Last updated
Was this helpful?
KyberSwap Aggregator Solana APIs
Last updated
Was this helpful?
In order to continuously improve the KyberSwap Aggregator, our APIs implement a clientData
or source
field that enables us to understand how the APIs are being utilized. As a developer integrating with our APIs, please add your clientID (i.e. company name) to the clientData
/source
fields to enable us to serve you better.
[V1]GET
clientData={"source":"yourCompanyNameHere"}
[V2]POST
source="yourCompanyNameHere"
Retrieve the information about a Swap between 2 tokens.
/route
Address of the input token.
Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Address of the output token.
Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Amount of the input token (in wei).
Example: 10000000000000
10000000000000
DEX IDs included in the route, separated by comma. Example: kyberswap, kybberswapv2
This is the amount of slippage the user can accept for his trade. The unit is bps. The value is in ranges [0, 2000], 10 means 0.1%. Default value is 50/10000 ~ 0.5%.
200
Address to receive the output token
Example: 5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
Deployed program.
Example: 8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
String to present to your client.
Example: yourCompanyNameHere
%7B%22source%22%3A%22kyberswap%22%7D
No body
Encode the swap route to be sent to the KyberSwap Aggregator smart contract.
/route/encode
Base58 token address of the input token.
Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Base58 token address of the output token.
Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Amount of the input token (in wei): amountIn * tokenDecimal
Example: 10000000000000
10000000000000
Optional.
Dex array, split by ",".
Example: OrcaV2, RaydiumV4
Allowed DEX values: OrcaV2,Serum,RaydiumV5,WhirlPool,Saber,RaydiumV4,Mercurial,GooseFx Note: empty value is implicit as using all dexes.
This is the amount of slippage the user can accept for his trade. The unit is bps. The value is in ranges [0, 2000], 10 means 0.1%. Default value is 50/10000 ~ 0.5%.
200
Address to receive the output token
Example: 5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
Deployed program.
Example: 8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
String to present to your client.
Example: yourCompanyNameHere
%7B%22source%22%3A%22kyberswap%22%7D