DotSwap Nexus Integration
English
English
  • Intro
  • Quickstart Guide
  • General
    • API Access
  • Global
    • Get All Tickers
    • Get Exchange Rate
    • Get Token List
    • Data Queries
  • Swap
    • Runes
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • BRC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Pre-Swap Request
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • ARC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • CAT20
  • Liquidity Management
    • Runes
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • BRC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Pre Liquidity
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • ARC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
  • Remove Liquidity
    • Removing Liquidity
  • CAT20
    • Split
  • Trading
    • Bitcoin Channel
Powered by GitBook
On this page
  1. Global

Get Exchange Rate

PreviousGet All TickersNextGet Token List

Last updated 3 months ago

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

  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'.

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
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"
}