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
Header parameters
AuthorizationstringOptional
token
User-IdstringOptional
Body
send_coin_typestringRequired
send_tickstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
addressstringRequired
Responses
200
Success
application/json
10180005
Liquidity Pair Not Found
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"
}
Last updated
Was this helpful?