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

Get Liquidity Pool Info

post
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
send_coin_typestringRequired
send_tickstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
addressstringRequired
Responses
200
Success
application/json
post
POST /brc20swap/swap_info HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 170

{
  "send_coin_type": "runes",
  "send_tick": "SHE•SHE•SHE•SHE•SHE",
  "receive_coin_type": "btc",
  "receive_tick": "BTC",
  "address": "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"
}
{
  "code": 0,
  "msg": "",
  "data": {
    "tick1_volume": "10000",
    "tick2_volume": "10000",
    "tick1_per_tick2": "100000000",
    "tick2_per_tick1": "0.00000001",
    "platform_service_fee_percent": "0.004",
    "liquider_service_fee_percent": "0.016",
    "platform_service_fee_sell_percent": "0.01",
    "liquider_service_sell_percent": "0.04",
    "partner_service_fee_percent": null,
    "start_swap_timestamp": 0,
    "start_remove_timestamp": 0,
    "require_check": 0,
    "token": "ee1d3ad48400000:0",
    "non_removable": false
  },
  "req_id": "1887717726683045888"
}
  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

Was this helpful?