Remove Liquidity

Decrease Liquidity Message

post
/v0/pool/decrease-liquidity/message

Generates a message hash for decreasing liquidity from a position, which the user should sign.

Authorizations
x-api-keystringRequired
Body
poolIdstring · min: 64 · max: 66Required

The pubkey of the pool.

Pattern: ^[0-9a-fA-F]+$
positionPubKeystring · min: 64 · max: 66Required

The pubkey of the position.

Pattern: ^[0-9a-fA-F]+$
liquidityAmountstringRequired

The amount of liquidity to withdraw.

Pattern: ^[1-9][0-9]*$
minToken0stringRequired

The minimum amount of the first token to withdraw.

Pattern: ^[0-9][0-9]*$
minToken1stringRequired

The minimum amount of the second token to withdraw.

Pattern: ^[0-9][0-9]*$
withdrawAddressToken0stringRequired

The address to withdraw the first token to.

withdrawAddressToken1stringRequired

The address to withdraw the second token to.

feeRateinteger · min: 1Required

The fee rate for the transaction (in sats per byte).

runePubkeystring · min: 64 · max: 66Required

The public key of the rune address of the user initiating the request.

Pattern: ^[0-9a-fA-F]+$
paymentPubkeystring · min: 64 · max: 66Optional

The public key of the bitcoin address of the user initiating the request. If the user doesn't have a bitcoin address, the runePubkey will be used

Pattern: ^[0-9a-fA-F]+$
recentBlockhashstringRequired

The recent blockhash of the transaction.

paymentMethodone ofRequired

The payment method for transaction fees.

or
or
runeAddressstringRequired

The rune address of the user. It must be a taproot address. (P2TR). If no bitcoin address is provided, the rune address will be used for bitcoin too.

paymentAddressstringOptional

The bitcoin address of the user.

Responses
post
/v0/pool/decrease-liquidity/message
POST /v0/pool/decrease-liquidity/message HTTP/1.1
Host: api-dev.saturnbtc.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 356

{
  "poolId": "text",
  "positionPubKey": "text",
  "liquidityAmount": "text",
  "minToken0": "text",
  "minToken1": "text",
  "withdrawAddressToken0": "text",
  "withdrawAddressToken1": "text",
  "feeRate": 1,
  "runePubkey": "text",
  "paymentPubkey": "text",
  "recentBlockhash": "text",
  "paymentMethod": {
    "type": null,
    "feeUtxo": {
      "txid": "text",
      "vout": 1
    }
  },
  "runeAddress": "text",
  "paymentAddress": "text"
}
text

Decrease Liquidity

post
/v0/pool/decrease-liquidity

Finalizes the decrease of liquidity from a position by submitting the signed message and executing the transaction on the network.

Authorizations
x-api-keystringRequired
Body
signaturestringRequired

The user's signature of the decrease liquidity message.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
poolIdstring · min: 64 · max: 66Required

The pubkey of the pool.

Pattern: ^[0-9a-fA-F]+$
positionPubKeystring · min: 64 · max: 66Required

The pubkey of the position.

Pattern: ^[0-9a-fA-F]+$
liquidityAmountstringRequired

The amount of liquidity to withdraw.

Pattern: ^[1-9][0-9]*$
minToken0stringRequired

The minimum amount of the first token to withdraw.

Pattern: ^[0-9][0-9]*$
minToken1stringRequired

The minimum amount of the second token to withdraw.

Pattern: ^[0-9][0-9]*$
withdrawAddressToken0stringRequired

The address to withdraw the first token to.

withdrawAddressToken1stringRequired

The address to withdraw the second token to.

feeRateinteger · min: 1Required

The fee rate for the transaction (in sats per byte).

runePubkeystring · min: 64 · max: 66Required

The public key of the rune address of the user initiating the request.

Pattern: ^[0-9a-fA-F]+$
paymentPubkeystring · min: 64 · max: 66Optional

The public key of the bitcoin address of the user initiating the request. If the user doesn't have a bitcoin address, the runePubkey will be used

Pattern: ^[0-9a-fA-F]+$
recentBlockhashstringRequired

The recent blockhash of the transaction.

paymentMethodone ofRequired

The payment method for transaction fees.

or
or
runeAddressstringRequired

The rune address of the user. It must be a taproot address. (P2TR). If no bitcoin address is provided, the rune address will be used for bitcoin too.

paymentAddressstringOptional

The bitcoin address of the user.

Responses
post
/v0/pool/decrease-liquidity
POST /v0/pool/decrease-liquidity HTTP/1.1
Host: api-dev.saturnbtc.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 375

{
  "signature": "text",
  "poolId": "text",
  "positionPubKey": "text",
  "liquidityAmount": "text",
  "minToken0": "text",
  "minToken1": "text",
  "withdrawAddressToken0": "text",
  "withdrawAddressToken1": "text",
  "feeRate": 1,
  "runePubkey": "text",
  "paymentPubkey": "text",
  "recentBlockhash": "text",
  "paymentMethod": {
    "type": null,
    "feeUtxo": {
      "txid": "text",
      "vout": 1
    }
  },
  "runeAddress": "text",
  "paymentAddress": "text"
}
{
  "archTxId": "text",
  "bitcoinTxIds": [
    "text"
  ]
}

Last updated