移除流动池

本指南中,我们将通过 DotSwap 提供的一个示例来展示如何进行移除流动池,这个过程包括:

  • 移除流动池

    • 预移除请求

    • 获取移除待签名 PSBT

    • 发送移除已签名 PSBT

  • 获取移除预估数量

RUNES/BRC20/ARC20 移除接口相同,根据coin_type_*区分。

预移除流动性

post
/brc20swap/v2/pre_remove_liquid
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
tick1stringRequired
tick2stringRequired
coin_type_1stringRequired
coin_type_2stringRequired
percentstringRequired
payer_btc_addrstringRequired
payer_ord_addrstringRequired
payer_pub_keystringRequired
slipperstringRequired
fee_ratestringRequired
Responses
chevron-right
200

成功

application/json
post
/brc20swap/v2/pre_remove_liquid

示例

circle-info

1、返回结果原值传给 create_remove_liquid_psbt (下一个接口)

构建移除流动性psbt

post
/brc20swap/v2/create_remove_liquid_psbt
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
tick1stringRequired
tick2stringRequired
coin_type_1stringRequired
coin_type_2stringRequired
percentstringRequired
payer_btc_addrstringRequired
payer_ord_addrstringRequired
payer_pub_keystringRequired
slipperstringRequired
fee_ratestringRequired
expect_amount1stringRequired
expect_amount2stringRequired
expect_transfer_feeintegerRequired
check_sumstringRequired
tx_sizeintegerRequired
usr_cntintegerRequired
vinsstring[]Required
Responses
chevron-right
200

成功

application/json
post
/brc20swap/v2/create_remove_liquid_psbt

示例

移除流动性

post
/brc20swap/v2/remove_liquid_by_psbt
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
order_idstringRequired
psbtstringRequired
checksumstringRequired
Responses
chevron-right
200

成功

application/json
post
/brc20swap/v2/remove_liquid_by_psbt

示例

根据移除比例获取流动性信息

post
/brc20swap/get_liquid_info
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
addressstringRequired
lp_precentintegerRequired

小数 百分比 整数

from_tickstringRequired

当前都是btc

to_tickstringRequired
from_coin_typestringRequired
to_coin_typestringRequired
Responses
chevron-right
200

成功

application/json
post
/brc20swap/get_liquid_info

示例

手续费说明

用户实际获得的数量,需要扣掉多签托管机构的服务费,该服务费费率使用后端返回的字段mutisign_fee_proportion(目前是 0.3%,未来如果托管机构变动,我们将会跟着调整)

手续费计算

  • btc-brc20\runes 移除手续费 = btc 聪数*0.3%

  • btc-arc20 移除手续费 = btc 聪数*0.3%+arc20 聪数*0.3%

  • brc20-brc20 移除手续费 = 免费

用户实际获得数量计算示例

circle-info

1、预估数量会根据总流动池的数量实时变化,所以前端可进行轮询请求,以获得最新数量

Last updated