DotSwap Nexus Integration
English
English
  • Intro
  • Quickstart Guide
  • General
    • API Access
  • Global
    • Get All Tickers
    • Get Exchange Rate
    • Get Token List
    • Data Queries
  • Swap
    • Runes
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • BRC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Pre-Swap Request
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • ARC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • CAT20
  • Liquidity Management
    • Runes
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • BRC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Pre Liquidity
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • ARC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
  • Remove Liquidity
    • Removing Liquidity
  • CAT20
    • Split
Powered by GitBook
On this page
  1. Liquidity Management
  2. BRC20

Pre Liquidity

PreviousGet Token Exchange RateNextGet Unsigned Liquidity PSBT

Last updated 3 months ago

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.

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.

  • Creating/Adding Liquidity Pools
  • Pre-add/Create Request (BRC20)
  • POSTPre-add liquidity
  • Important Notes

Pre-add liquidity

post
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
tick1stringRequired
tick2stringRequired
amount_1stringRequired
amount_2stringRequired
tick_1_inscription_idsstring[]Required

Only use for BRC20 deposits

tick_2_inscription_idsstring[]Required
payer_ord_addrstringRequired
payer_btc_addrstringRequired
payer_pub_keystringRequired
fee_ratestringRequired
slipperstringRequired
Responses
200
Success
application/json
x-200:Success
Success
application/json
post
POST /brc20swap/v2/pre_add_liquid HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 364

{
  "tick1": "sint amet aliquip reprehenderit",
  "tick2": "sint et",
  "coin_type_1": "nostrud",
  "coin_type_2": "nisi",
  "amount_1": "86",
  "amount_2": "44",
  "tick_1_inscription_ids": [
    "32",
    "44",
    "21",
    "11",
    "55"
  ],
  "tick_2_inscription_ids": [
    "17",
    "55",
    "23",
    "74",
    "41"
  ],
  "payer_ord_addr": "dolor in id",
  "fee_rate": "cillum aute",
  "payer_btc_addr": "irure sit culpa ea sed",
  "payer_pub_key": "minim"
}
{
  "code": 1,
  "msg": "text",
  "data": {
    "tx_size": 1,
    "ins_contain_sats": 1,
    "vins": [
      "text"
    ],
    "usr_cnt": 1,
    "net_fee": 1,
    "check_sum": "text"
  },
  "req_id": "text"
}