Get Exchange Rate

The interface and request parameters for querying token exchange rates are actually the same as those for adding liquidity to the pool.

Through the following interface, you can obtain the current exchange rate of the selected token and the total number of pools in the liquidity pool. The main purpose of this interface in the exchange process is to:

  • Display the exchange rate to users

  • Calculate the estimated amount that can be exchanged

POST /brc20swap/swap_info

export interface SwapInfoBody {
  receive_coin_type: string;
  receive_tick: string;
  send_coin_type: string;
  send_tick: string;
  address: string;
}
  1. If "LiquidPair no found" is prompted, it means that there is no liquidity pool for this token pair.

  2. For RUNES, BRC20, and ARC20, the query interfaces are the same, but send_coin_type / receive_coin_type differ.

[2024.04.23 Update] New: address is a required parameter. If the user is not logged in, default to '0'.

Last updated