Creating/Adding Liquidity Pools
Pre-add/Create Request (BRC20)
When selecting the token pair and clicking to add liquidity, if it is a BRC20 token, you need to first request the pre-add/create interface.
Parameters Request Body Request Body 2 cURL Example 1 cURL Example 2
Copy export interface PoolPsbtTxsizeBody {
tick1 : string ;
tick2 : string ;
coin_type_1 : string ;
coin_type_2 : string ;
amount_1 : string ;
amount_2 : string ;
tick_1_inscription_ids : string [];
tick_2_inscription_ids : string [];
payer_ord_addr : string ;
fee_rate : string ;
payer_btc_addr : string ;
payer_pub_key : string ;
}
Copy // btc-brc20
{
"tick1" : "BTC" ,
"coin_type_1" : "btc" ,
"amount_1" : "17999" ,
"tick_1_inscription_ids" : [] ,
"tick2" : "bqbq" ,
"coin_type_2" : "brc20" ,
"amount_2" : "1000" ,
"tick_2_inscription_ids" : [ "f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0" ] ,
"fee_rate" : "11" ,
"slipper" : "12" ,
"payer_ord_addr" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e" ,
"payer_btc_addr" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e" ,
"payer_pub_key" : "02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81"
}
Copy // brc20-btc
{
"tick1" : "bqbq" ,
"coin_type_1" : "brc20" ,
"amount_1" : "1000" ,
"tick_1_inscription_ids" : [
"f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0"
] ,
"tick2" : "BTC" ,
"coin_type_2" : "btc" ,
"amount_2" : "17999" ,
"tick_2_inscription_ids" : [] ,
"fee_rate" : "11" ,
"slipper" : "12" ,
"payer_ord_addr" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e" ,
"payer_btc_addr" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e" ,
"payer_pub_key" : "02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81"
}
Copy # btc-brc20
curl 'https://test-api-proxy.ddpurse.com/brc20swap/v2/pre_add_liquid' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://192.168.10.66:56651' \
-H 'Pragma: no-cache' \
-H 'Referer: http://192.168.10.66:56651/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"tick2":"bqbq","coin_type_2":"brc20","amount_2":"1000","tick_2_inscription_ids":["f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0"],"tick1":"BTC","coin_type_1":"btc","amount_1":"17999","tick_1_inscription_ids":[],"fee_rate":"11","slipper":"12","payer_ord_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_btc_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_pub_key":"02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81"}' \
--compressed
Copy # brc20-btc
curl 'https://test-api-proxy.ddpurse.com/brc20swap/v2/pre_add_liquid' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://192.168.10.66:56651' \
-H 'Pragma: no-cache' \
-H 'Referer: http://192.168.10.66:56651/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"tick1":"bqbq","coin_type_1":"brc20","amount_1":"1000","tick_1_inscription_ids":["f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0"],"tick2":"BTC","coin_type_2":"btc","amount_2":"17999","tick_2_inscription_ids":[],"fee_rate":"11","slipper":"12","payer_ord_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_btc_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_pub_key":"02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81"}' \
--compressed