BRC20 Swap API provides a set of interfaces for BRC20 Swap and InSwap services. It allows users to interact with the BRC20 Swap ecosystem, including balance checks, pool information, liquidity management, and token transfers.
👉 View Swagger UI
| Route | Summary |
|---|---|
GET /v1/brc20-swap/config |
Swap’s global configuration information. |
GET /v1/brc20-swap/balance |
Gets the balance for the specified address and tick. |
GET /v1/brc20-swap/all_balance |
Gets all BRC20 token balances for a specified address. |
GET /v1/brc20-swap/pool_info |
Get Pool information based on trade pair. |
GET /v1/brc20-swap/select |
Select the tick information that you can use based on the address. |
GET /v1/brc20-swap/pre_deploy_pool |
Prepare deploy pool operation |
POST /v1/brc20-swap/deploy_pool |
Deploy the pool operation. |
GET /v1/brc20-swap/pre_add_liq |
Prepare add liquidity operation |
POST /v1/brc20-swap/add_liq |
Add the liquidity operation |
GET /v1/brc20-swap/pre_remove_liq |
Prepare remove liquidity operation |
POST /v1/brc20-swap/remove_liq |
Remove the liquidity operation |
GET /v1/brc20-swap/pre_send |
Prepare send operation |
POST /v1/brc20-swap/pre_batch_send |
Prepare batch send operation |
GET /v1/brc20-swap/pre_swap |
Prepare swap operation |
POST /v1/brc20-swap/send |
The send operation. |
POST /v1/brc20-swap/batch_send |
The batch send operation. |
POST /v1/brc20-swap/swap |
The swap operation. |
GET /v1/brc20-swap/pool_list |
Gets the pool list information. |
GET /v1/brc20-swap/my_pool_list |
Gets the user’s pool list information. |
GET /v1/brc20-swap/my_pool |
Gets the user pool information for the specified pair. |
GET /v1/brc20-swap/overview |
An overview of swap information |
GET /v1/brc20-swap/gas_history |
Gets the gas consumption records for a user aggregation operation. |
GET /v1/brc20-swap/send_history |
Gets the history of send transaction. |
GET /v1/brc20-swap/liq_history |
Gets the history of a pair addition pool. |
GET /v1/brc20-swap/swap_history |
Gets the history of swap. |
GET /v1/brc20-swap/rollup_history |
Get chain history of rollup inscription. |
GET /v1/brc20-swap/deposit_list |
Gets the deposit list for a user. |
GET /v1/brc20-swap/create_deposit |
Create a deposit psbt to be signed by the user. |
POST /v1/brc20-swap/confirm_deposit |
User signature deposit psbt, submit confirmation. |
GET /v1/brc20-swap/system_status |
Gets the current system state. |
GET /v1/brc20-swap/withdraw_history |
Gets the user withdrawal history. |
GET /v1/brc20-swap/create_retry_withdraw |
Retry create a withdraw psbt to be signed by the user. |
POST /v1/brc20-swap/confirm_retry_withdraw |
User signature withdraw psbt, submit confirmation. |
GET /v1/brc20-swap/create_withdraw |
Create a withdraw psbt to be signed by the user. |
POST /v1/brc20-swap/confirm_withdraw |
User signature withdraw psbt, submit confirmation. |
GET /v1/brc20-swap/withdraw_process |
Gets the withdrawal progress for the specified ID. |
GET /v1/brc20-swap/quote_swap |
Returns the estimated number of swaps based on the input and exact type. |
GET /v1/brc20-swap/quote_add_liq |
Based on the pair to get the actual addition ratio, LP number and other information. |
GET /v1/brc20-swap/quote_remove_liq |
Estimate the number of ticks you can get by typing LP. |
GET /v1/brc20-swap/pre_stake |
Prepare stake operation |
GET /v1/brc20-swap/pre_unstake |
Prepare unstake operation |
GET /v1/brc20-swap/pre_claim |
Prepare claim operation |
GET /v1/brc20-swap/pre_send_lp |
Prepare send LP operation |
POST /v1/brc20-swap/send_lp |
The send LP operation. |
POST /v1/brc20-swap/stake |
The stake operation. |
POST /v1/brc20-swap/unstake |
The unstake operation. |
POST /v1/brc20-swap/claim |
The claim operation. |
GET /v1/brc20-swap/lp_reward_history |
Gets the user pool information for the specified pair. |
GET /v1/brc20-swap/stake_history |
Gets the stake history. |
GET /v1/brc20-swap/stake_list |
Gets the stake list. |
GET /v1/brc20-swap/stake_item |
Gets the stake item. |
GET /v1/brc20-swap/stake_user_info |
Gets the user info. |
GET /v1/brc20-swap/user_info |
Gets the user info. |
GET /v1/brc20-swap/select_deposit |
Select deposit information |
GET /v1/brc20-swap/func_info |
Gets the func info. |
GET /v1/brc20-swap/deposit_balance |
Gets the deposit balance |
GET /v1/brc20-swap/deposit_process |
Gets the deposit process. |
GET /v1/brc20-swap/tick_price |
Gets the tick price |
GET /v1/brc20-swap/address_gas |
Gets the address’s total tick fee |
GET /v1/brc20-swap/price_line |
Gets the price line. |
GET /v1/brc20-swap/community_info |
Gets the community info. |
POST /v1/brc20-swap/add_community_info |
Adds community info. |
GET /v1/brc20-swap/community_list |
Gets the community info list. |
GET /v1/brc20-swap/tick_holders |
Gets the tick holders. |
GET /v1/brc20-swap/pool_holders |
Gets the pool holders. |
GET /v1/brc20-swap/reward_curve |
Get reward curve data. |
GET /v1/brc20-swap/send_lp_history |
Gets the history of send lp transaction. |
GET /v1/brc20-swap/burn_history |
Gets the history of burn transaction. |
GET /v1/brc20-swap/task_list |
Get task list for address. |
GET /v1/brc20-swap/address_usd |
Get address usd. |
GET /v1/brc20-swap/pre_lock_lp |
Prepare lock LP operation |
POST /v1/brc20-swap/lock_lp |
The lock lp operation. |
GET /v1/brc20-swap/pre_unlock_lp |
Prepare unlock LP operation |
POST /v1/brc20-swap/unlock_lp |
The unlock lp operation. |
GET /v1/brc20-swap/lock_lp_history |
Gets the history of lock lp transaction. |
GET /v1/brc20-swap/unlock_lp_history |
Gets the history of unlock lp transaction. |
GET /v1/brc20-swap/export_lock_lp_history |
Export lock lp history to CSV file. |
GET /v1/brc20-swap/my_lock_lp |
Gets the user lock lp. |
GET /v1/brc20-swap/select_pool |
Select the tick information that you can swap. |
GET /v1/brc20-swap/pre_multi_swap |
Prepare multi swap operation |
POST /v1/brc20-swap/multi_swap |
The multi swap operation. |
GET /v1/brc20-swap/quote_multi_swap |
Returns the estimated number of multi swaps based on the input and exact type. |
GET /v1/brc20-swap/multi_swap_history |
Gets the history of multi swap. |
Method: GET
Path: /v1/brc20-swap/config
Swagger Link: View in Swagger UI
This interface provides the global configuration information for the BRC20 Swap service. It includes details such as the module ID, service gas tick, and pending deposit confirmation numbers.
code (number):msg (string):data (object):
moduleId (string):serviceGasTick (string): The tick used for the second layer gas.pendingDepositDirectNum (number): Number of confirmations required for direct deposit.pendingDepositMatchingNum (number): Number of confirmations required for matching deposit.Method: GET
Path: /v1/brc20-swap/balance
Swagger Link: View in Swagger UI
This interface retrieves the balance for a specific address and tick in the BRC20 Swap service. It returns the confirmed module balance, swap balance, pending swap balance, and pending available balance.
address (query) (required):tick (query) (required):code (number):msg (string):data (object):
balance (object):
module (string): Confirmed module balance.swap (string): Confirmed swap balance.pendingSwap (string): The balance converted from pending to swap.pendingAvailable (string): The balance converted from pending to module.decimal (string):Method: GET
Path: /v1/brc20-swap/all_balance
Swagger Link: View in Swagger UI
This interface retrieves the complete list of all BRC20 token balances for a specific wallet address in the BRC20 Swap service. For each tick, it returns detailed balance information including the confirmed module balance, swap balance, pending swap balance, and pending available balance.
address (query) (required):pubkey (query) :code (number):msg (string):data (object): A map where each key is a token ticker symbol.Method: GET
Path: /v1/brc20-swap/pool_info
Swagger Link: View in Swagger UI
This interface retrieves the pool information for a specific trade pair in the BRC20 Swap service. It includes details such as whether the pool exists, if liquidity has been added, tick prices, LP quantity, TVL, volume, and rewards.
tick0 (query) :tick1 (query) :code (number):msg (string):data (object):
existed (boolean): Is the pool existedaddLiq (boolean): Has LP been added to the pooltick0 (string):tick1 (string):lp (string): Quantity of pool lptvl (string):volume24h (string):volume7d (string):reward0 (string):reward1 (string):activedPid (string): Active pool IDmarketCap (number): Market capmarketCapTick (string): Market cap ticknetworkType0 (string): Network type for tick0networkType1 (string): Network type for tick1assetType0 (string): Asset type for tick0assetType1 (string): Asset type for tick1l1Tick0 (string): L1 tick0l1Tick1 (string): L1 tick1amount0 (string): Amount of tick0amount1 (string): Amount of tick1volume30d (string): 30 days volumeMethod: GET
Path: /v1/brc20-swap/select
Swagger Link: View in Swagger UI
This interface retrieves the tick information that can be used for swapping based on the provided address. It returns the tick, decimal, BRC20 balance, and swap balance for each available tick.
address (query) (required):search (query) : Fuzzy matchingcode (number):msg (string):data (array):
tick (string):decimal (string):brc20Balance (string): Module balance (not participate in swap calculations)swapBalance (string): Swap balanceMethod: GET
Path: /v1/brc20-swap/pre_deploy_pool
Swagger Link: View in Swagger UI
This interface pre-loads the /deploy_pool operation, providing the signature content, gas, and byte information required for deploying a pool in the BRC20 Swap service.
address (query) (required):tick0 (query) (required):tick1 (query) (required):ts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feefeeTick (string): Tick used as feetotalFreeQuota (string): Total free quotaremainingFreeQuota (string): Remaining free quotatotalUsedFreeQuota (string): Total used free quotausageFreeQuota (string): Usage free quotahasVoucher (boolean): Has voucherassetFeeAmount (string): Asset fee amountassetFeeTick (string): Asset fee tickassetFeeTickPrice (string): Asset fee tick priceassetFeeTickBalance (string): Asset fee tick balanceMethod: POST
Path: /v1/brc20-swap/deploy_pool
Swagger Link: View in Swagger UI
This interface deploys a pool in the BRC20 Swap service. It requires the address, tick0, tick1, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/pre_add_liq
Swagger Link: View in Swagger UI
This interface pre-loads the /add_liq operation, providing the signature content, gas, and byte information required for adding liquidity in the BRC20 Swap service.
address (query) (required):tick0 (query) (required):tick1 (query) (required):amount0 (query) (required): Input amount of tick0amount1 (query) (required): Input amount of tick1lp (query) (required): Expect amount of lpslippage (query) (required):ts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feefeeTick (string): Tick used as feetotalFreeQuota (string): Total free quotaremainingFreeQuota (string): Remaining free quotatotalUsedFreeQuota (string): Total used free quotausageFreeQuota (string): Usage free quotahasVoucher (boolean): Has voucherassetFeeAmount (string): Asset fee amountassetFeeTick (string): Asset fee tickassetFeeTickPrice (string): Asset fee tick priceassetFeeTickBalance (string): Asset fee tick balanceMethod: POST
Path: /v1/brc20-swap/add_liq
Swagger Link: View in Swagger UI
This interface adds liquidity to a pool in the BRC20 Swap service. It requires the address, tick0, tick1, amounts, LP, slippage, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):
id (string): Function idrollupInscriptionId (string): The rollup inscription id where the function is locatedaddress (string):type (string):tick0 (string):tick1 (string):amount0 (string): Input amount of tick0amount1 (string): Input amount of tick1lp (string):ts (number):success (boolean): Operation success statusvalue (number): Operation valuepreResult (object): Pre-operation resultresult (object): Operation resultMethod: GET
Path: /v1/brc20-swap/pre_remove_liq
Swagger Link: View in Swagger UI
This interface pre-loads the /remove_liq operation, providing the signature content, gas, and byte information required for removing liquidity in the BRC20 Swap service.
address (query) (required):tick0 (query) (required):tick1 (query) (required):amount0 (query) (required): Input amount of tick0amount1 (query) (required): Input amount of tick1lp (query) (required):slippage (query) (required):ts (query) (required):feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feefeeTick (string): Tick used as feetotalFreeQuota (string): Total free quotaremainingFreeQuota (string): Remaining free quotatotalUsedFreeQuota (string): Total used free quotausageFreeQuota (string): Usage free quotahasVoucher (boolean): Has voucherassetFeeAmount (string): Asset fee amountassetFeeTick (string): Asset fee tickassetFeeTickPrice (string): Asset fee tick priceassetFeeTickBalance (string): Asset fee tick balancereward0 (string): Reward amount for tick0reward1 (string): Reward amount for tick1Method: POST
Path: /v1/brc20-swap/remove_liq
Swagger Link: View in Swagger UI
This interface removes liquidity from a pool in the BRC20 Swap service. It requires the address, tick0, tick1, amounts, LP, slippage, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):
id (string): Function idrollupInscriptionId (string): The rollup inscription id where the function is locatedaddress (string):type (string):tick0 (string):tick1 (string):amount0 (string): Input amount of tick0amount1 (string): Input amount of tick1lp (string):ts (number):success (boolean): Operation success statusvalue (number): Operation valuepreResult (object): Pre-operation resultresult (object): Operation resultMethod: GET
Path: /v1/brc20-swap/pre_send
Swagger Link: View in Swagger UI
This interface pre-loads the /send operation, providing the signature content, gas, and byte information required for sending a tick in the BRC20 Swap service.
address (query) (required):tick (query) (required): Send tickamount (query) (required): The amount of send tickto (query) (required): The receiver of send tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: POST
Path: /v1/brc20-swap/pre_batch_send
Swagger Link: View in Swagger UI
This interface pre-loads the /batch_send operation, providing the signature content, gas, and byte information required for sending multiple ticks in the BRC20 Swap service.
code (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: GET
Path: /v1/brc20-swap/pre_swap
Swagger Link: View in Swagger UI
This interface pre-loads the /swap operation, providing the signature content, gas, and byte information required for swapping ticks in the BRC20 Swap service.
address (query) (required):tickIn (query) (required): Input ticktickOut (query) (required): Output tickamountIn (query) (required): The amount of input tickamountOut (query) (required): The amount of output tickslippage (query) (required):exactType (query) (required):ts (query) (required): Timestamp(seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: POST
Path: /v1/brc20-swap/send
Swagger Link: View in Swagger UI
This interface sends a tick in the BRC20 Swap service. It requires the address, tick, amount, receiver, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/batch_send
Swagger Link: View in Swagger UI
This interface sends multiple ticks in the BRC20 Swap service. It requires the address, tick, amount, receivers, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/swap
Swagger Link: View in Swagger UI
This interface swaps ticks in the BRC20 Swap service. It requires the address, input tick, output tick, input amount, output amount, slippage, exact type, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):
id (string): Function idrollupInscriptionId (string): The rollup inscription id where the function is locatedaddress (string):tickIn (string):tickOut (string):amountIn (string):amountOut (string):exactType (string):ts (number):success (boolean): Operation success statusvalue (number): Operation valuepreResult (object): Pre-operation resultresult (object): Operation resultMethod: GET
Path: /v1/brc20-swap/pool_list
Swagger Link: View in Swagger UI
This interface retrieves the pool list information in the BRC20 Swap service. It supports filtering by address, tick, and fuzzy matching, and allows pagination through start and limit parameters.
search (query) : Fuzzy matchingstart (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
tick0 (string):tick1 (string):lp (string):tvl (string): Total pool valuevolume24h (string):volume7d (string):volume30d (string): 30 days volumeamount0 (string): Amount of tick0amount1 (string): Amount of tick1Method: GET
Path: /v1/brc20-swap/my_pool_list
Swagger Link: View in Swagger UI
This interface retrieves the user’s pool list information in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) (required):tick (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
lp (string):shareOfPool (string):tick0 (string):tick1 (string):amount0 (string): Amount of tick0amount1 (string): Amount of tick1claimedReward0 (string):claimedReward1 (string):unclaimedReward0 (string):unclaimedReward1 (string):Method: GET
Path: /v1/brc20-swap/my_pool
Swagger Link: View in Swagger UI
This interface retrieves the user pool information for a specific pair in the BRC20 Swap service. It requires the address, tick0, and tick1 parameters to identify the pool.
address (query) (required):tick0 (query) (required):tick1 (query) (required):code (number):msg (string):data (object):
lp (string):shareOfPool (string):tick0 (string):tick1 (string):amount0 (string): Amount of tick0amount1 (string): Amount of tick1lockedLp (string): Locked LP amountclaimedReward0 (string): Claimed reward for tick0claimedReward1 (string): Claimed reward for tick1unclaimedReward0 (string): Unclaimed reward for tick0unclaimedReward1 (string): Unclaimed reward for tick1Method: GET
Path: /v1/brc20-swap/overview
Swagger Link: View in Swagger UI
This interface provides an overview of the swap information in the BRC20 Swap service, including total liquidity, 7-day volume, 24-hour volume, number of transactions, and number of pairs.
code (number):msg (string):data (object):
liquidity (string): Total value of all poolsvolume7d (string): 7 days volumevolume24h (string): 24 hours volumetransactions (number): Number of transactions in 24 hourspairs (number):Method: GET
Path: /v1/brc20-swap/gas_history
Swagger Link: View in Swagger UI
This interface retrieves the gas consumption records for a user aggregation operation in the BRC20 Swap service. It supports filtering by address and pagination through start and limit parameters.
address (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
funcType (string): Function type (example: swap)tickA (string):tickB (string):gas (string):tick (string): Fee tickto (string): Recipient addressts (number):Method: GET
Path: /v1/brc20-swap/send_history
Swagger Link: View in Swagger UI
This interface retrieves the history of send transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) :tick (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
tick (string):amount (string):to (string):ts (number):Method: GET
Path: /v1/brc20-swap/liq_history
Swagger Link: View in Swagger UI
This interface retrieves the history of pair addition pools in the BRC20 Swap service. It supports filtering by address, tick, type (add or remove), and pagination through start and limit parameters.
address (query) :tick (query) :type (query) : Optional: add, removestart (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
type (string):tick0 (string):tick1 (string):amount0 (string):amount1 (string):reward0 (string): Reward amount for tick0reward1 (string): Reward amount for tick1lp (string):ts (number):Method: GET
Path: /v1/brc20-swap/swap_history
Swagger Link: View in Swagger UI
This interface retrieves the history of swap transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) :tick (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
tickIn (string): Input ticktickOut (string): Output tickamountIn (string): The amount of input tickamountOut (string): The amount of output tickexactType (string):ts (number):Method: GET
Path: /v1/brc20-swap/rollup_history
Swagger Link: View in Swagger UI
This interface retrieves the chain history of rollup inscriptions in the BRC20 Swap service. It supports filtering by inscription ID and pagination through start and limit parameters.
start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
txid (string):height (number):transactionNum (number): Number of transactions in the inscriptioninscriptionId (string): Rollup inscription idinscriptionNumber (number): Rollup inscription numberts (number):Method: GET
Path: /v1/brc20-swap/deposit_list
Swagger Link: View in Swagger UI
This interface retrieves the deposit list for a user in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) (required):tick (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
tick (string):amount (string):cur (number): Current number of confirmationssum (number): Total number of confirmationsts (number):txid (string):type (string):Method: GET
Path: /v1/brc20-swap/create_deposit
Swagger Link: View in Swagger UI
This interface creates a deposit PSBT to be signed by the user in the BRC20 Swap service. It requires the inscription ID, public key, and address parameters to generate the PSBT.
inscriptionId (query) (required):pubkey (query) (required):address (query) (required):code (number):msg (string):data (object):
psbt (string):type (string): Direct or matchingexpiredTimestamp (number):recommendDeposit (string):Method: POST
Path: /v1/brc20-swap/confirm_deposit
Swagger Link: View in Swagger UI
This interface allows the user to sign the deposit PSBT and submit the confirmation in the BRC20 Swap service. It requires the PSBT and inscription ID to complete the operation.
code (number):msg (string):data (object):
txid (string): Transaction IDpendingNum (number): Number of pending confirmationsMethod: GET
Path: /v1/brc20-swap/system_status
Swagger Link: View in Swagger UI
This interface retrieves the current system state of the BRC20 Swap service, including whether rollup inscription committing is enabled.
code (number):msg (string):data (object):
committing (boolean): Is rollup inscription committingMethod: GET
Path: /v1/brc20-swap/withdraw_history
Swagger Link: View in Swagger UI
This interface retrieves the user withdrawal history in the BRC20 Swap service. It supports filtering by address, pagination through start and limit parameters, and an optional tick parameter.
address (query) (required):start (query) (required):limit (query) (required):tick (query) :code (number):msg (string):data (object):
total (number):list (array):
id (string):tick (string):totalAmount (string): Total amount withdrawalcompletedAmount (string): The number of withdrawal completedts (number):totalConfirmedNum (number): The current number of confirmationstotalNum (number): The total number of confirmationsstatus (string):type (string):Method: GET
Path: /v1/brc20-swap/create_retry_withdraw
Swagger Link: View in Swagger UI
This interface retries to create a withdrawal PSBT to be signed by the user in the BRC20 Swap service. It requires the withdrawal order ID, public key, and address parameters to generate the PSBT.
id (query) (required):pubkey (query) (required):address (query) (required):code (number):msg (string):data (object):
paymentPsbt (string): The user psbt with paymentapprovePsbt (string): The user psbt with approve insctiptionnetworkFee (number):Method: POST
Path: /v1/brc20-swap/confirm_retry_withdraw
Swagger Link: View in Swagger UI
This interface allows the user to sign the retry withdrawal PSBT and submit the confirmation in the BRC20 Swap service. It requires the withdrawal order ID, payment PSBT, and approve PSBT to complete the operation.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/create_withdraw
Swagger Link: View in Swagger UI
This interface creates a withdrawal PSBT to be signed by the user in the BRC20 Swap service. It requires the public key, address, tick, amount, timestamp, and fee tick parameters to generate the PSBT.
pubkey (query) (required):address (query) (required):tick (query) (required):amount (query) (required):ts (query) (required):feeTick (query) (required):code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/confirm_withdraw
Swagger Link: View in Swagger UI
This interface allows the user to sign the withdrawal PSBT and submit the confirmation in the BRC20 Swap service. It requires the withdrawal order ID, payment PSBT, approve PSBT, fee tick, and optional fee amount to complete the operation.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/withdraw_process
Swagger Link: View in Swagger UI
This interface retrieves the withdrawal progress for a specific ID in the BRC20 Swap service. It requires the ID parameter to identify the withdrawal order.
id (query) (required):code (number):msg (string):data (object):
id (string):tick (string):amount (string):ts (number):status (string):totalConfirmedNum (number):totalNum (number): Total number of confirmations (rollUp + approve)rollUpConfirmNum (number):rollUpTotalNum (number): Total number of rollUp confirmationsapproveConfirmNum (number):approveTotalNum (number): Total number of approve confirmationscancelConfirmedNum (number):cancelTotalNum (number):rollUpTxid (string): Decrease operation is required to withdraw, which in rollup inscriptionpaymentTxid (string):inscribeTxid (string):approveTxid (string):completedAmount (string):matchHistory (array):
approveInscriptionId (string): Withdraw inscriptiontransferInscriptionId (string): Deposit inscriptiontick (string):consumeAmount (string):remainAmount (string): Residual cash withdrawalapproveAddress (string): Withdraw user addresstransferAddress (string): Deposit user addresstxid (string): Matching txidts (number):Method: GET
Path: /v1/brc20-swap/quote_swap
Swagger Link: View in Swagger UI
address (query) (required):tickIn (query) (required): Input ticktickOut (query) (required): Output tickamount (query) (required): If it is exactIn, it is the amount of input tick, else is the amount of output tickexactType (query) (required): Exact input or exact outputcode (number):msg (string):data (object):
amountUSD (string): Input amount of usd valueexpectUSD (string): Estimated amount of usd valueexpect (string): Estimated amountMethod: GET
Path: /v1/brc20-swap/quote_add_liq
Swagger Link: View in Swagger UI
address (query) (required):tick0 (query) (required):tick1 (query) (required):amount0 (query) : The expect amount of tick0amount1 (query) : The expect amount of tick1code (number):msg (string):data (object):
amount0 (string): The real amount of tick0amount1 (string): The real amount of tick1amount0USD (string): The usd value of amount0amount1USD (string): The usd value of amount1lp (string): Estimated lptick0PerTick1 (string): tick0/tick1tick1PerTick0 (string): tick1/tick0shareOfPool (string): The proportion of the injected quantity in the poolMethod: GET
Path: /v1/brc20-swap/quote_remove_liq
Swagger Link: View in Swagger UI
address (query) (required):tick0 (query) (required):tick1 (query) (required):lp (query) (required):code (number):msg (string):data (object):
tick0 (string):tick1 (string):amount0 (string): Amount of tick0amount1 (string): Amount of tick1amount0USD (string):amount1USD (string):Method: GET
Path: /v1/brc20-swap/pre_stake
Swagger Link: View in Swagger UI
This interface pre-loads the /stake operation, providing the signature content, gas, and byte information required for staking in the BRC20 Swap service.
pid (query) (required):address (query) (required):amount (query) (required): The amount of send tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: GET
Path: /v1/brc20-swap/pre_unstake
Swagger Link: View in Swagger UI
This interface pre-loads the /unstake operation, providing the signature content, gas, and byte information required for unstaking in the BRC20 Swap service.
pid (query) (required):address (query) (required):amount (query) (required): The amount of send tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: GET
Path: /v1/brc20-swap/pre_claim
Swagger Link: View in Swagger UI
This interface pre-loads the /claim operation, providing the signature content, gas, and byte information required for claiming rewards in the BRC20 Swap service.
pid (query) (required):address (query) (required):ts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: GET
Path: /v1/brc20-swap/pre_send_lp
Swagger Link: View in Swagger UI
This interface pre-loads the /send_lp operation, providing the signature content, gas, and byte information required for sending LP in the BRC20 Swap service.
address (query) (required):tick0 (query) (required): Lp tick0tick1 (query) (required): Lp tick1amount (query) (required): The amount of send tickto (query) (required): The receiver of send tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeamount0PerLp (string):amount1PerLp (string):Method: POST
Path: /v1/brc20-swap/send_lp
Swagger Link: View in Swagger UI
This interface sends LP in the BRC20 Swap service. It requires the address, tick0, tick1, amount, receiver, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/stake
Swagger Link: View in Swagger UI
This interface stakes LP in the BRC20 Swap service. It requires the pid, address, amount, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/unstake
Swagger Link: View in Swagger UI
This interface unstakes LP in the BRC20 Swap service. It requires the pid, address, amount, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: POST
Path: /v1/brc20-swap/claim
Swagger Link: View in Swagger UI
This interface claims rewards in the BRC20 Swap service. It requires the pid, address, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):
amount (string): Claimed reward amountMethod: GET
Path: /v1/brc20-swap/lp_reward_history
Swagger Link: View in Swagger UI
This interface retrieves the LP reward history for a specific pair in the BRC20 Swap service. It requires the address, tick0, tick1, and pagination parameters.
address (query) (required):tick0 (query) (required):tick1 (query) (required):start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
id (string):type (string):address (string):tick0 (string):tick1 (string):reward0 (string):reward1 (string):ts (number):Method: GET
Path: /v1/brc20-swap/stake_history
Swagger Link: View in Swagger UI
This interface retrieves the stake history in the BRC20 Swap service. It supports filtering by pid, address, type, and pagination through start and limit parameters.
pid (query) :search (query) :address (query) (required):type (query) (required):start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
pid (string):address (string):poolTick0 (string):poolTick1 (string):type (string):amount (string):tick (string):ts (number):Method: GET
Path: /v1/brc20-swap/stake_list
Swagger Link: View in Swagger UI
This interface retrieves the stake list in the BRC20 Swap service.
code (number):msg (string):data (object):
list (array):
startBlock (number):endBlock (number):stakePools (array):
summary (object):
pid (string):poolTick0 (string):poolTick1 (string):rewardTick (string):curTotalLp (string):baseReward (string):stageNeedLp (array):
stageAddedRewards (array):Method: GET
Path: /v1/brc20-swap/stake_item
Swagger Link: View in Swagger UI
eid (query) (required):code (number):msg (string):data (object):
item (object):
startBlock (number):endBlock (number):stakePools (array):
summary (object):
pid (string):poolTick0 (string):poolTick1 (string):rewardTick (string):curTotalLp (string):baseReward (string):stageNeedLp (array):
stageAddedRewards (array):newestHeight (number):Method: GET
Path: /v1/brc20-swap/stake_user_info
Swagger Link: View in Swagger UI
This interface retrieves the stake user information in the BRC20 Swap service.
address (query) :code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/user_info
Swagger Link: View in Swagger UI
This interface retrieves the user information in the BRC20 Swap service.
address (query) (required):code (number):msg (string):data (object):
defaultPayType (string):rememberPayType (boolean):Method: GET
Path: /v1/brc20-swap/select_deposit
Swagger Link: View in Swagger UI
pubkey (query) (required):address (query) (required):v (query) :code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/func_info
Swagger Link: View in Swagger UI
id (query) (required):code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/deposit_balance
Swagger Link: View in Swagger UI
pubkey (query) (required):address (query) (required):tick (query) (required):code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/deposit_process
Swagger Link: View in Swagger UI
This interface retrieves the deposit process for a specific transaction ID in the BRC20 Swap service.
txid (query) (required):code (number):msg (string):data (object):
tick (string):amount (string):cur (number): Current number of confirmationssum (number): Total number of confirmationsts (number):txid (string):type (string):status (string):Method: GET
Path: /v1/brc20-swap/tick_price
Swagger Link: View in Swagger UI
This interface retrieves the price for a specific tick in the BRC20 Swap service.
tick (query) (required):code (number):msg (string):data (object):
price (number):Method: GET
Path: /v1/brc20-swap/address_gas
Swagger Link: View in Swagger UI
This interface retrieves the total gas consumption for a specific address and fee tick in the BRC20 Swap service.
address (query) (required):feeTick (query) (required):code (number):msg (string):data (object):
total (number):Method: GET
Path: /v1/brc20-swap/price_line
Swagger Link: View in Swagger UI
This interface retrieves the price line data for a specific pair in the BRC20 Swap service.
tick0 (query) (required):tick1 (query) (required):timeRange (query) (required):code (number):msg (string):data (object):
list (array):
price (number):usdPrice (number):ts (number):Method: GET
Path: /v1/brc20-swap/community_info
Swagger Link: View in Swagger UI
This interface retrieves the community information for a specific tick in the BRC20 Swap service.
tick (query) (required):code (number):msg (string):data (object):
tick (string):twitter (string):telegram (string):website (string):discord (string):desc (string):Method: POST
Path: /v1/brc20-swap/add_community_info
Swagger Link: View in Swagger UI
This interface adds or updates community information for a specific tick in the BRC20 Swap service.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/community_list
Swagger Link: View in Swagger UI
This interface retrieves the list of all community information in the BRC20 Swap service.
code (number):msg (string):data (object):
total (number):list (array):
tick (string):twitter (string):telegram (string):website (string):discord (string):desc (string):Method: GET
Path: /v1/brc20-swap/tick_holders
Swagger Link: View in Swagger UI
This interface retrieves the list of tick holders for a specific tick in the BRC20 Swap service.
tick (query) (required):start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
address (string):amount (string):percentage (number):relativePercentage (number):Method: GET
Path: /v1/brc20-swap/pool_holders
Swagger Link: View in Swagger UI
This interface retrieves the list of pool holders for a specific pair in the BRC20 Swap service.
tick0 (query) (required):tick1 (query) (required):start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
address (string):amount0 (string):amount1 (string):lp (string):shareOfPool (string):lockLp (object):
lp (string):amount0 (string):amount1 (string):Method: GET
Path: /v1/brc20-swap/reward_curve
Swagger Link: View in Swagger UI
This interface retrieves the reward curve data for a specific pair and time range in the BRC20 Swap service.
address (query) (required):tick0 (query) (required):tick1 (query) (required):startTime (query) (required):endTime (query) (required):code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/send_lp_history
Swagger Link: View in Swagger UI
This interface retrieves the history of send LP transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) :tick (query) :fuzzySearch (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
tick (string):amount (string):to (string):ts (number):Method: GET
Path: /v1/brc20-swap/burn_history
Swagger Link: View in Swagger UI
This interface retrieves the history of burn transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) :tick (query) :fuzzySearch (query) :start (query) (required):limit (query) (required):ts (query) :code (number):msg (string):data (object):
total (number):totalLp (string): Total LP amountburnedLp (string): Burned LP amountlist (array):
tick (string):amount (string):to (string):ts (number):Method: GET
Path: /v1/brc20-swap/task_list
Swagger Link: View in Swagger UI
This interface retrieves the task list for a specific address in the BRC20 Swap service.
tid (query) :address (query) (required):code (number):msg (string):data (object):
tid (string):list (array):
tid (string):itemId (string):address (string):done (boolean):Method: GET
Path: /v1/brc20-swap/address_usd
Swagger Link: View in Swagger UI
This interface retrieves the USD value of assets for a specific address in the BRC20 Swap service.
address (query) (required):code (number):msg (string):data (array):
assetsUSD (string):lpUSD (string):Method: GET
Path: /v1/brc20-swap/pre_lock_lp
Swagger Link: View in Swagger UI
This interface pre-loads the /lock_lp operation, providing the signature content, gas, and byte information required for locking LP in the BRC20 Swap service.
address (query) (required):lockDay (query) (required):tick0 (query) (required): Lp tick0tick1 (query) (required): Lp tick1amount (query) (required): The amount of lock tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeamount0PerLp (string):amount1PerLp (string):Method: POST
Path: /v1/brc20-swap/lock_lp
Swagger Link: View in Swagger UI
This interface locks LP in the BRC20 Swap service. It requires the address, lockDay, tick0, tick1, amount, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/pre_unlock_lp
Swagger Link: View in Swagger UI
This interface pre-loads the /unlock_lp operation, providing the signature content, gas, and byte information required for unlocking LP in the BRC20 Swap service.
address (query) (required):tick0 (query) (required): Lp tick0tick1 (query) (required): Lp tick1amount (query) (required): The amount of unlock tickts (query) (required): Timestamp (seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (object):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeamount0PerLp (string):amount1PerLp (string):Method: POST
Path: /v1/brc20-swap/unlock_lp
Swagger Link: View in Swagger UI
This interface unlocks LP in the BRC20 Swap service. It requires the address, tick0, tick1, amount, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (object):Method: GET
Path: /v1/brc20-swap/lock_lp_history
Swagger Link: View in Swagger UI
This interface retrieves the history of lock LP transactions in the BRC20 Swap service. It supports filtering by address, tick, lockDay, and pagination through start and limit parameters.
tick (query) :tick0 (query) :tick1 (query) :start (query) (required):limit (query) (required):address (query) :lockDay (query) :code (number):msg (string):data (object):
total (number):list (array):
id (string):address (string):tick0 (string):tick1 (string):lp (string):amount0 (string):amount1 (string):amount0USD (string):amount1USD (string):lockDay (number):unlockTime (string):ts (number):shareOfPool (string):Method: GET
Path: /v1/brc20-swap/unlock_lp_history
Swagger Link: View in Swagger UI
This interface retrieves the history of unlock LP transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
tick (query) :tick0 (query) :tick1 (query) :start (query) (required):limit (query) (required):address (query) :code (number):msg (string):data (object):
total (number):list (array):
id (string):address (string):tick0 (string):tick1 (string):lp (string):amount0 (string):amount1 (string):amount0USD (string):amount1USD (string):ts (number):Method: GET
Path: /v1/brc20-swap/export_lock_lp_history
Swagger Link: View in Swagger UI
This interface exports the lock LP history to a CSV file in the BRC20 Swap service.
tick0 (query) (required):tick1 (query) (required):lockDay (query) :lockTime (query) :Method: GET
Path: /v1/brc20-swap/my_lock_lp
Swagger Link: View in Swagger UI
This interface retrieves the user’s lock LP information for a specific pair in the BRC20 Swap service.
tick0 (query) (required):tick1 (query) (required):address (query) (required):code (number):msg (string):data (object):
lp (string):lockLp (string):availableLp (string):availableAmount0 (string):availableAmount1 (string):shareOfPool (string):Method: GET
Path: /v1/brc20-swap/select_pool
Swagger Link: View in Swagger UI
This interface retrieves the tick information that can be used for swapping based on the provided address and optional filters.
address (query) (required):tickIn (query) :tickOut (query) :search (query) :code (number):msg (string):data (array):
tick (string):decimal (string):brc20Balance (string): Module balance (not participate in swap calculations)swapBalance (string): Swap balanceroutes (array):Method: GET
Path: /v1/brc20-swap/pre_multi_swap
Swagger Link: View in Swagger UI
This interface pre-loads the /multi_swap operation, providing the signature content and gas information required for multi swapping in the BRC20 Swap service.
address (query) (required):tickIn (query) (required): Input ticktickOut (query) (required): Output tickamountIn (query) (required): The amount of input tickamountOut (query) (required): The amount of output tickslippage (query) (required):exactType (query) (required):ts (query) (required): Timestamp(seconds)feeTick (query) (required): Tick used as feepayType (query) : Pay Type: tick, freeQuotacode (number):msg (string):data (array):
ids (array):
signMsgs (array):
feeAmount (string): The fee that the user needs to payfeeTickPrice (string): The price of fee tickfeeBalance (string): The user’s fee tick balanceusdPrice (string): The dollar value of the feeMethod: POST
Path: /v1/brc20-swap/multi_swap
Swagger Link: View in Swagger UI
This interface performs multi swaps in the BRC20 Swap service. It requires an array of swap items, each with address, input tick, output tick, amounts, slippage, exact type, timestamp, fee tick, and user signatures to complete the operation.
code (number):msg (string):data (array):
address (string):tickIn (string):tickOut (string):success (boolean):amountIn (string):amountOut (string):exactType (string):value (number):ts (number):failureReason (string):Method: GET
Path: /v1/brc20-swap/quote_multi_swap
Swagger Link: View in Swagger UI
address (query) (required):tickIn (query) (required): Input ticktickOut (query) (required): Output tickamount (query) (required): If it is exactIn, it is the amount of input tick, else is the amount of output tickexactType (query) (required): Exact input or exact outputcode (number):msg (string):data (object):
amountUSD (string): Input amount of usd valueexpectUSD (string): Estimated amount of usd valueexpect (string): Estimated amountroutesExpect (array):Method: GET
Path: /v1/brc20-swap/multi_swap_history
Swagger Link: View in Swagger UI
This interface retrieves the history of multi swap transactions in the BRC20 Swap service. It supports filtering by address, tick, and pagination through start and limit parameters.
address (query) :tick (query) :fuzzySearch (query) :start (query) (required):limit (query) (required):code (number):msg (string):data (object):
total (number):list (array):
address (string):tickIn (string): Input ticktickOut (string): Output tickamountIn (string): The amount of input tickamountOut (string): The amount of output tickexactType (string):ts (number):value (number): Swap valueroute0 (object):
id (string):tickIn (string):tickOut (string):amountIn (string):amountOut (string):exactType (string):ts (number):success (boolean):failureReason (string):route1 (object):
id (string):tickIn (string):tickOut (string):amountIn (string):amountOut (string):exactType (string):ts (number):success (boolean):failureReason (string):