Quote Endpoint
The /quote
endpoint allows you to get a quote for a token swap before executing the transaction. This is useful for previewing swap details, including prices and expected outputs.
We currently support the following:
- Pump.fun
- Moonshot
- Orca
- Raydium
- Raydium CPMM
- Tokens supported by Jupiter
Request
GET
https://swap.solxtence.com/quote
Parameters
Parameter | Description | Example |
---|---|---|
from * | The address of the token you're swapping from | So11111111111111111111111111111111111111112 |
to * | The address of the token you're swapping to | 2CKpz5rLrXZSmoTwwskCiYgSEDhyuqM2q4s5znJVRrFA |
amount * | The amount of the 'from' token you want to swap | 1 |
slip | The maximum slippage percentage you're willing to accept | 1 |
⚠️
The slip
parameter represents slippage in percentage. For example, use "1"
for 1% slippage.
JSON Examples
{
"from": "So11111111111111111111111111111111111111112",
"to": "2CKpz5rLrXZSmoTwwskCiYgSEDhyuqM2q4s5znJVRrFA",
"amount": "0.11",
"slip": "1"
}
Response Explanation
swapDetails
:inputAmount
: The amount of the source token to be swapped.outputAmount
: The estimated amount of the destination token you'll receive.minimumOutputAmount
: The minimum amount you'll receive considering the slippage.priceData
:spotPrice
: The current market price of the token pair.effectivePrice
: The actual price you're getting for the swap.priceImpactPercentage
: The percentage difference between spot and effective price. (Often occurs when there is insufficient trading activity)
feeInfo
:swapFee
: The fee charged for the swap.platformFeeAmount
: The cost charged by the trading platform, measured in SOL Lamports.platformFeeFormatted
: The platform cost shown in SOL.
tokenInfo
: Details about the source and destination tokens, including their addresses and decimal places.
Error Codes
🚫
In case of an error, you may receive one of the following HTTP status codes:
400
: Bad request (check your parameters)429
: Too many requests (you've exceeded the rate limit)500
: Internal server error
Example Usage
Here's an example of how to use the /quote
endpoint with cURL:
curl 'https://swap.solxtence.com/quote?from=So11111111111111111111111111111111111111112&to=2CKpz5rLrXZSmoTwwskCiYgSEDhyuqM2q4s5znJVRrFA&amount=0.11&slip=1'