RUNES
dotswap V3 Transaction request flow

dotswap V3 Swap interface
Apifox/1.0.0 (https://apifox.com)application/jsonwith a minimum of 1, used to filter pools with no available UTXOs.
POST /dotswap/api/swap/quote HTTP/1.1
Host: api-testnet4.dotswap.app
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 2
{}{
"code": 1,
"msg": "text",
"data": {
"quote_id": "text",
"from_amount": "text",
"to_amount": "text",
"swap_method": "text",
"pool_infos": [
{
"service_fee": 1,
"name": "text",
"third_party_id": 1,
"third_party_address": "text",
"pool_id": 1,
"third_pool_id": 1,
"pool_url": "text",
"icon": "text",
"from_tick": {
"coin_type": "text",
"tick": "text",
"token_id": "text"
},
"to_tick": {
"coin_type": "text",
"tick": "text",
"token_id": "text"
},
"from_tick_address": "text",
"to_tick_address": "text",
"from_balance": "text",
"to_balance": "text",
"from_margin": "text",
"to_margin": "text",
"from_to_fee_ratio": "text",
"to_from_fee_ratio": "text",
"dex_margin_percent": "text",
"pool_type": "text",
"sqrt_price": "text",
"liquidity": null,
"ServiceFeeRatio": 1,
"deltaAmount": "text"
}
]
},
"req_id": "text"
}Use this interface to obtain the available swap amount.
For example, if you want to check how much
YKO•KKK•KKK•KKK•KKKyou can get for0.1 BTC, then setfrom_tokentobtcandto_tokentorunes. Input the value offrom_token.amount, and the interface will returnto_amount, which represents the amount ofYKO•KKK•KKK•KKK•KKK.
Apifox/1.0.0 (https://apifox.com)application/jsonobtained from the calculation interface
with a minimum of 1, used for transaction construction.
required only for BRC20.
POST /dotswap/api/swap/create_psbt HTTP/1.1
Host: api-testnet4.dotswap.app
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 372
"{\n \"Address\":\n \"from_token\": {\n \"coin_type\": \"btc\",\n \"tick\": \"btc\",\n \"token_id\": \"72\",\n \"amount\": \"10000000\"\n },\n \"to_token\": {\n \"coin_type\": \"runes\",\n \"tick\": \"BITCOIN•TESTNET\",\n \"token_id\": \"35\",\n \"amount\": \"4944080\"\n },\n \"fee_rate\": 1\n}"{
"code": 1,
"msg": "text",
"data": {
"request_id": "text",
"psbts": [
"text"
]
},
"req_id": "text"
}1、The
quote_idin this interface is the return value obtained from the quotation interface.2、Please set
use_bitcoin_channeltofalseby default, and setinscriptionto an empty array[].
Apifox/1.0.0 (https://apifox.com)application/jsonobtained from the PSBT creation
false:hex true:base64
POST /dotswap/api/swap/submit_psbt HTTP/1.1
Host: api-testnet4.dotswap.app
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 372
"{\n \"Address\":\n \"from_token\": {\n \"coin_type\": \"btc\",\n \"tick\": \"btc\",\n \"token_id\": \"72\",\n \"amount\": \"10000000\"\n },\n \"to_token\": {\n \"coin_type\": \"runes\",\n \"tick\": \"BITCOIN•TESTNET\",\n \"token_id\": \"35\",\n \"amount\": \"4944080\"\n },\n \"fee_rate\": 1\n}"{
"code": 1,
"msg": "text",
"data": {
"order_id": "text",
"tx_id": "text"
},
"req_id": "text"
}
The
request_idis obtained from thecreate_psbtresponse.Please set
psbt_is_base64according to your signing result; by default, it is usuallyfalse.
Last updated