Q1
API Endpoint: /v2/quote
Request Method: GET
Description: This API returns a detailed quote and transaction package for performing a token swap. The response includes the calculated output amounts, slippage, routing plan and a serialized transaction ready to be submitted to the blockchain.
Request URL:
https://api.carbium.io/api/v2/quote
Request Headers:
accept: application/json
X-API-KEY: YOUR_API_KEY
Example Request:
curl --request GET \
--url 'https://api.carbium.io/api/v1/quote?src_mint=So11111111111111111111111111111111111111112&dst_mint=AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY&amount_in=100000&slippage_bps=100&user_account=8N4FvNMwdA3KndSsKKJuzDuqN4QwfDd6wsimkTJ2Wmho' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'accept: text/plain'Response: An object with quote details, route plan and swap base64 txn (if user_account included in request).
Example Response:
{
"srcAmountIn": "100000",
"destAmountOut": "2076427095",
"destAmountOutMin": "2076427095",
"swapMode": "BaseIn",
"slippage": "100",
"priceImpactPct": "0",
"routePlan": [
{
"swapInfo": {
"ammKey": "2PtMUYFXNfs8uKPCL1cMUXWt6qWDp5ysUtXkv2MXABJ1",
"label": "o-whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY",
"inAmount": "80000",
"outAmount": "1661129565",
"feeAmount": "0",
"feeMint": "0"
},
"percent": "80",
"bps": "8000"
},
{
"swapInfo": {
"ammKey": "u41JpbKrcPuzJwRTPU6gDysoFqKPpEZe9YmHdszQTJ1",
"label": "o-whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY",
"inAmount": "20000",
"outAmount": "415297530",
"feeAmount": "0",
"feeMint": "0"
},
"percent": "20",
"bps": "2000"
}
],
"feeMint": "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY",
"feeBps": "0",
"signatureFeeLamports": "0",
"prioritizationFeeLamports": "0",
"rentFeeLamports": "0",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY",
"swapType": "ExactIn",
"router": "spider",
"requestId": "test",
"priceImpact": "0",
"txn": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQACBeseW6PMPLA6+0v9oDue992oxr038a2pCHR2vJyl8ZN9fgeX0e1d6vJ7VOsYdOOGsJnF9ztzpPH02RVHb1ZVMDbyZf8jtEFdUr7bLznKeFd73Y7zeFwYEvJx+w0bxBR7sAMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAAvHSfaDSSYh16bEkT7gl/aVh/rQIP3LwAthG4quwDgTSfIQLxyhUhPy72c4cyxXBflvHlkSM74PHxUIa7PwSo9QMDAAUC+64DAAMACQOghgEAAAAAAAQmBAABBhYYFhYFAAcGCgENAggMCwkOFxYWBQAQBgoBDwISERQVExdi+MaekeF1h8ighgEAAAAAAFfDw3sAAAAAZAACAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAFAAAAEACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBABQAAAEBAQEDCSMzbfS77vEEJG+rxzse4Dx3S4q3Usp62g2egllhJm8KAS7DwqPFvLu6wAIDCKdtjR2BMihRrFTyS9wHMgBiueszogP2VI9N0ESV0zS8BwQBEAUGERIAYoeb7bff7Epltg7G4NPrTF7hL5ClZcaFaU5Xx/uSEEMAAQQ="
}Updated about 15 hours ago
