Manage Pool
This document provides a brief overview of single-sided pools and the related operation APIs.
Covered APIs
Get submission limits:
/api/pool/single/add_request_limitQuery available balance:
/api/pool/single/balanceGet network fee:
/api/pool/single/get_network_feeSubmit add-liquidity request:
/api/pool/single/add_liquidityUpdate add-liquidity request:
/api/pool/single/update_liquidityCancel matching:
/api/pool/single/cancelRemove liquidity:
/api/pool/single/remove
Prerequisites
Prepare address fields:
payer_address: BTC addresspayer_asset_address: asset address (usually an Ordinals-compatible address, such as for ORDI/Runes assets)
Prepare the
sign_infoobject:
addresspublic_keysign_infosignaturenonce(anti-replay, retrieve from/api/nonce)
Amount and precision conventions:
Pass amount fields exactly as defined by each API (most are
string).price_tick_lowerandprice_tick_upperdefine the price range boundaries.unit_tickdefines the base unit for pricing.
Identifier convention:
pool_idis passed asstringin pool management APIs.
Recommended Call Flow
Call
add_request_limitto get submission constraints (minimum/maximum amount, fee settings, etc.).Call
balanceto confirm available balance.Call
add_liquidityto submit the matching request.Use
update_liquidityorcancelwhen needed.Only before calling
remove, callget_network_feeto estimate on-chain cost for liquidity removal.
Status Reference (Common Pool Statuses)
MATCHING: currently matchingMATCHED: matchedMATCHING_ONCHAIN: matching on-chain in progressREMOVING_LIQUIDITY: liquidity removal in progressREMOVED: removed
Before update/cancel/remove operations, query the latest pool status and perform validation checks.
API Details
POST /api/pool/single/add_request_limit HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 241
{
"payer_address": {
"address": "text",
"public_key": "text"
},
"payer_asset_address": {
"address": "text",
"public_key": "text"
},
"tick_a": {
"tick": "text",
"token_id": "text",
"coin_type": "text"
},
"tick_b": {
"tick": "text",
"token_id": "text",
"coin_type": "text"
}
}{
"code": 0,
"msg": "success",
"data": {
"not_found_pool": false,
"tick_a_maximum_value": "11",
"tick_b_maximum_value": "17",
"tick_a_minimum_value": "28",
"tick_b_minimum_value": "41",
"channel_usage_rates": 63,
"real_channel_usage_rates": 0.63
}
}Address to query
Token name
Token type
Pool
POST /api/pool/single/balance HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 122
{
"address": "tb1pf0tcpgxr30kqhh2gn3pgvr4qyachzm0xxydnfxth5cxlkjl37ugspxp7tm",
"tick": "BTC",
"coin_type": "",
"pool_id": "50001"
}{
"code": 0,
"msg": "success",
"data": {
"balance": "312312"
}
}POST /api/pool/single/get_network_fee HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 2
{}{
"code": 0,
"msg": "success",
"data": {
"network_fee": "425"
}
}Minimum amount
Maximum amount
Minimum fee rate
Minimum price
Maximum price
Tick unit
POST /api/pool/single/add_liquidity HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 635
{
"tick1": {
"tick": "btc",
"token_id": "",
"coin_type": "btc"
},
"tick2": {
"tick": "USDC•STARKNET•TEST",
"token_id": "",
"coin_type": "runes"
},
"token": {
"tick": "btc",
"token_id": "",
"coin_type": "btc"
},
"min_amount": "10000",
"max_amount": "20000",
"min_fee_rate": "0.04",
"sign_info": {
"sign_info": "test",
"address": "tb1pupt6rkpqv77mkxwks85vewwhyakc430rzmelgw5dhg3v83wnf40slm7mqs",
"public_key": "l03f41902fd17e0c632fce4dd4b7c54a8f738635746bb5bfc9c503376e3db267be7",
"signature": "AUB4xtqGpQIR0kcZgb5BGIuRckkZVsASt0fYztEMgHJqRDG2d2G0E+80C1nX7T3Tfn9Rl7KCp7ktpVA44+93YZB7",
"nonce": "test-nonce"
},
"price_tick_lower": 80000,
"price_tick_upper": 110000,
"unit_tick": "BTC"
}{
"code": 0,
"msg": "Success",
"data": {
"isSuccess": true
}
}Minimum amount
Maximum amount
Minimum fee rate
pool id
Minimum price
Maximum price
Tick unit
POST /api/pool/single/update_liquidity HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 574
{
"min_amount": "1000",
"max_amount": "2000",
"min_fee_rate": "0.01",
"pool_id": "50001",
"sign_info": {
"sign_info": "Account was activated by tb1p...p7tm at 2026-01-15 03:05:34",
"address": "tb1pf0tcpgxr30kqhh2gn3pgvr4qyachzm0xxydnfxth5cxlkjl37ugspxp7tm",
"public_key": "03786f146fa5031d05f5e81a2e983a6747f4444762e90b717b15633e9e043a16b9",
"signature": "AUAPXqoJF4Sw/UukzHPuhqVcX2GPNobNjCaecc1RfaOx/xKjfSv8kONONG6mXcUCWoB/H1iGdKKPlFG94psn6n4y",
"nonce": "test-nonce"
},
"token": {
"tick": "BTC",
"token_id": "",
"coin_type": "btc"
},
"price_tick_lower": 80000,
"price_tick_upper": 110000,
"unit_tick": "BTC"
}{
"code": 0,
"msg": "success",
"data": {
"isSuccess": true
}
}pool id
POST /api/pool/single/cancel HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 334
{
"pool_id": "50004",
"sign_info": {
"sign_info": "test",
"address": "tb1pupt6rkpqv77mkxwks85vewwhyakc430rzmelgw5dhg3v83wnf40slm7mqs",
"public_key": "l03f41902fd17e0c632fce4dd4b7c54a8f738635746bb5bfc9c503376e3db267be7",
"signature": "AUB4xtqGpQIR0kcZgb5BGIuRckkZVsASt0fYztEMgHJqRDG2d2G0E+80C1nX7T3Tfn9Rl7KCp7ktpVA44+93YZB7",
"nonce": "test-nonce"
}
}{
"code": 0,
"msg": "success",
"data": {
"isSuccess": true
}
}pool id
POST /api/pool/single/remove HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/json
Accept: */*
Content-Length: 388
{
"pool_id": "50001",
"sign_info": {
"address": "tb1pf0tcpgxr30kqhh2gn3pgvr4qyachzm0xxydnfxth5cxlkjl37ugspxp7tm",
"public_key": "03786f146fa5031d05f5e81a2e983a6747f4444762e90b717b15633e9e043a16b9",
"sign_info": "Account was activated by tb1p...p7tm at 2026-01-15 03:05:34",
"signature": "AUAPXqoJF4Sw/UukzHPuhqVcX2GPNobNjCaecc1RfaOx/xKjfSv8kONONG6mXcUCWoB/H1iGdKKPlFG94psn6n4y",
"nonce": "test-nonce"
}
}{
"code": 0,
"msg": "success",
"data": {
"isSuccess": true
}
}Error Handling and Retry Guidance
Always check
codeandmsgfirst, and only usedatawhen the request succeeds.Show explicit error prompts for signature failures, nonce replay, and out-of-range parameters (minimum/maximum amount).
For transient network issues and timeouts, use idempotent retries and avoid duplicate submissions for the same business intent.
Before update/cancel/remove, re-fetch pool status and balance whenever possible.
Last updated