Get Rate

GET /rate

API now supports: Pump.fun (opens in a new tab) tokens, Raydium tokens and any token supported by Jupiter.

curl --location 'https://swap-v2.solanatracker.io/rate?from=So11111111111111111111111111111111111111112&to=4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R&amount=1&slippage=10'

Request Parameters

The cURL request requires the following parameters in the URL:

  • from: The base token address. In this case, it's the Solana token address (So11111111111111111111111111111111111111112).
  • to: The quote token address. In this case, it's the RAY token address (4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R).
  • amount: The amount of the base token to convert. In this case, it's 1 which means 1 SOL
  • slippage: The maximum acceptable slippage percentage. In this case, it's 10.

Example Response

{
 "amountIn": 1,
 "amountOut": 9181.330823048,
 "minAmountOut": 9089.517514818,
 "currentPrice": 9181.330823048,
 "executionPrice": 9089.517514818,
 "priceImpact": 0.0334641736518774,
 "fee": 0.01,
 "baseCurrency": {
   "decimals": 9,
   "mint": "So11111111111111111111111111111111111111112"
 },
 "quoteCurrency": {
   "decimals": 9,
   "mint": "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"
 },
 "platformFee": 9000000,
 "platformFeeUI": 0.009,
}

The response includes the following information:

  • amountIn: The amount of the source token that was used for the conversion.
  • amountOut: The amount of the destination token that was received.
  • minAmountOut: The minimum amount of the destination token that the user is willing to receive after slippage.
  • currentPrice: The current market price for the token pair.
  • executionPrice: The actual price at which the trade will be executed
  • priceImpact: The difference between the current market price and the execution price as a percentage, usually caused by lack of liquidity.
  • fee: The trading fee charged for the transaction.
  • baseCurrency: Information about the source token, including its decimal precision and mint address.
  • quoteCurrency: Information about the destination token, including its decimal precision and mint address.
  • platformFee: The fee charged by the platform for the transaction in SOL Lamports
  • platformFeeUI: The platform fee in SOL