Ton API
Rates

Rates

Rates service provides access to exchange rates for various tokens on the TON blockchain. This service calculates token prices using data from our indexer and liquidity pools such as Stonfi and Dedust, offering a comprehensive view of verified tokens, their reserves, and holder counts.

⚠️

The rates provided are for informational purposes only. Do not use this data for financial transactions.

Logic of Token Price Calculation

Our Rates service utilizes a systematic approach to gather and process data:

Data Sources:

  • By leveraging the analytics service in tonconsole, we obtain data on pools from Stonfi and Dedust.
  • The collected information includes token addresses, reserves, and the number of holders for verified tokens.

Price Calculation:

  • For standard pools: We apply the formula xy=kxy = k, where xx and yy are volumes of two assets in the pool, and kk is a constant.
  • For Dedust stable pools: We use a modified formula x3y+y3x=kx^3y + y^3x = k to account for the specifics of these pools.

You can view the implementation of these calculations here .

Data Analysis:

  • We evaluate minimum holder counts to ensure token relevance.
  • Pool reserves are analyzed and equated to TON for consistency.

Troubleshooting

If your token has over 100 TON in liquidity but doesn't receive a price from the API, please contact us with the following information:

  1. Token address
  2. Liquidity amount
  3. Number of holders

Send this information to @zakhar_petukhov for assistance.

Operations

  • getRates - Get the token price in the chosen currency for display only. Don’t use this for financial transactions.
  • getChartRates - Get chart by token
  • getMarketsRates - Get the TON price from markets

Remember, while this service provides valuable insights into token rates on the TON blockchain, it should not be used as the sole basis for financial decisions or transactions.