Solana Swaps
KyberSwap Aggregator Solana APIs
Download OpenAPI specification:
Note on integrations: clientID
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.
Example
[V1]GETclientData={"source":"yourCompanyNameHere"}
[V2]POSTsource="yourCompanyNameHere"
Solana swap APIs
Retrieve the information about a Swap between 2 tokens.
Address of the input token.
Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vAddress of the output token.
Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYBAmount of the input token (in wei).
Example: 10000000000000
10000000000000DEX 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%.
200Address to receive the output token
Example: 5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66Deployed program.
Example: 8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJString to present to your client.
Example: yourCompanyNameHere
%7B%22source%22%3A%22kyberswap%22%7DSuccessful response
Successful response
No content
Get the list of DEX IDs through which the swap will be routed to. Used for filtering the included DEXs fore the swap.
Successful response
{"code":0,"message":"successfully","data":{"dexes":["OrcaV2","Serum","RaydiumV5","WhirlPool","Saber","RaydiumV4"]}}Successful response
Encode the swap route to be sent to the KyberSwap Aggregator smart contract.
Base58 token address of the input token.
Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vBase58 token address of the output token.
Example: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYBAmount of the input token (in wei): amountIn * tokenDecimal
Example: 10000000000000
10000000000000Optional.
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%.
200Address to receive the output token
Example: 5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66
5Ba2nY9QuLVJ1Ct56k42tFJQQauujJPPPTXyC3kURV66Deployed program.
Example: 8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJ
8Q9k9zEBQR8LwEFo77uWCe4HWU2xXGxjM7aecsf7FLMJString to present to your client.
Example: yourCompanyNameHere
%7B%22source%22%3A%22kyberswap%22%7DSuccessful response
{"inputAmount":"10000000000000","outputAmount":"2343543369711","minOutputAmount":"2297591538932","amountInUsd":10000000,"amountOutUsd":2343543.369711,"swaps":[[{"pool":"YAkoNb6HKmSxQN9L8hiBE5tPJRsniSSMzND1boHmZxe","tokenIn":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","tokenOut":"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB","swapAmount":"9000000000000","amountOut":"1354816427350","limitReturnAmount":"0","maxPrice":"115792089237316195423570985008687907853269984665640564039457584007913129639935","exchange":"Saber","poolLength":2,"poolType":"Saber","reserveUsd":2404817.844718,"extra":""}],[{"pool":"2EXiumdi14E9b8Fy62QcA5Uh6WdHS2b38wtSxp72Mibj","tokenIn":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","tokenOut":"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB","swapAmount":"1000000000000","amountOut":"988726942361","limitReturnAmount":"0","maxPrice":"115792089237316195423570985008687907853269984665640564039457584007913129639935","exchange":"RaydiumV5","poolLength":2,"poolType":"RaydiumV5","reserveUsd":2702850.685077,"extra":""}]],"tokens":{"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":{"address":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","symbol":"USDC","name":"USD Coin","price":1,"decimals":6},"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB":{"address":"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB","symbol":"USDT","name":"USDT","price":1,"decimals":6}},"encodedMessage":"AgAKHT4j52B5mkP8cHmRIwmkBlhRESg2aC6x7Ub+gyBL1MNnbfAN1HGGv8afaoeRqV/FwDUZv/E9aYvAZMvjyHyBL5VYvmCxSY7K6u0z50WvuDb6Q7uqTbs0PusShvTLb7QssK1OASTn+c50QvivzeJ4xRWFN0DcUIZ/ZkvNVmitjmb8zM1upXsbXf62Oln6oC2GEZPEH3B8AlKwgiL8K0TIG6gOc4kgtGuyXl0ESYePbf88nUoP2Y6/dQbN3Bpb6RI8W0rzQGFso9f953BUJltyQYmb9hJx0kMdyGQP+6tWq9PTElL5v5i0qbUvlQBVmPjpztMZ2G0/CghyhpxacmCiGtI7U+roK03mEQLpMUcfIHksCBDRX/PYhV7f7KjMHcUvnkNPXYyRIbguEvA18701p9YUEttTbELVAeko/Z1jGDH5Cu5UtMkZ2LFqoRRq2mRUxtqJDiVae7jj6CHAVwTpZ4umoL/ss2VXgjucK+xd/en6iFCT02sAlvYoAWlSoQgn1lrm55GhQ3Zmr/vZZ9TuiodRJFEUJKQ2Ur+0A0rA/ICvH3LGCKjJVyWGyzl6RaGPQK2sgzECdNxhN5tnXirfoiaLsn0VNfRJj6DZF2cA9epKWsCjylurJ0vprq2VWOzjLHwppRfh42LZrfoRfbA01hIPbSetuF8ST2LWqvrmmXK77wOAZWD3XeNui0wZMC/p5vTzd328LiC9IvcDSEkTBF56iexAzmhCe4SxDWDl0+W+xAE5iUamN4WsB13vIk7uf9PnrRgqo6aX4G9oDjnwTdwdgPedvDFxgBQ2yaQS0o15AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhNtJbPrf59Wh0YzTm5bNPIjbZITBvHVoGDkRm2r/tgf8CQgmL4CqvVpr49A4XoBc90SoQAgPoxO2UVWbvFo7PkD6V8VszoAjBQcyWMw6R30RL27XXSKNgnViRFh7n6wG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqUf1oq97JdK7lK1cSVhGX1IPkCzQMcTg3QYud/zj+yKIKy+EPXpPEmOxuCd7WQadA8IVKhrFRurZXVs8wVDdVg+FDy1uAqR6+CTQmradxC1wyyjL+iSft+5XudJWwSdi7wMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAA2gdcsv9exoF2E95TC2kqhzVHd2naR0MMvYFUM1xKgycAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUbAAUCwFwVABwEAQAFEwguijSjUn1TphwMARQFFRYAAgMEBQYXJhxqphnZAeVBAJDNeS8IAAABEQAAAAEAkM15LwgAAAAAAAAAAAAAHBUBGAUXBxkICQoLGgwNDg8QERICBQAmHGqmGdkB5UEAEKXU6AAAAAERAAAACQAQpdToAAAAAAAAAAAAAAAcAwABBRB8M3KQBiHG0/SkIPMWAgAA","serumOpenOrdersAccountByMarket":{}}Successful response
Last updated
Was this helpful?