Pre Liquidity

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.

POST /brc20swap/v2/pre_add_liquid

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;
}

Important Notes

  1. The result returned from this interface should be passed as is to the create_add_liquid_psbt interface.

  2. Since liquidity is added based on a ratio and BRC20 needs to be inscribed first, creating BRC20-BRC20 token pair pools is not supported.

  3. For the tick_1_inscription_ids and tick_2_inscription_ids parameters:

    • If coin_type_1 is BRC20, put the BRC20 inscription ID in the tick_1_inscription_ids array and leave tick_2_inscription_ids empty.

    • If coin_type_2 is BRC20, put the BRC20 inscription ID in the tick_2_inscription_ids array and leave tick_1_inscription_ids empty.

    For the same token pair, BRC20-BTC and BTC-BRC20, the same pool is created or added to (e.g., ordi-BTC, BTC-ordi), just using different fields for the parameters.

Last updated