Increase Liquidity

Increase Liquidity PSBT

Generates a PSBT for increasing liquidity in an existing position by sending funds to the pool.

POSThttps://api-dev.saturnbtc.io/v0/pool/increase-liquidity/psbt
Authorization
Body

The request body containing the funding details.

token0*The first token's identifier. Must be the name of the token

The first token's identifier. Must be the name of the token.

token1*The second token's identifier. Must be the name of the token

The second token's identifier. Must be the name of the token. Usually 'sat'.

amount0*The amount of the first token to deposit

The amount of the first token to deposit.

amount1*The amount of the second token to deposit

The amount of the second token to deposit.

initializeAccountUtxo*A boolean indicating whether to initialize the account UTXO

A boolean indicating whether to initialize the account UTXO. If you're creating a new position, you should set this to true.

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

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

pubkey*The public key of the user initiating the request

The public key of the user initiating the request.

address*string

The address of the user. If no secondary address is provided, the primary address must be a taproot address. (P2TR)

secondaryAddressstring

The secondary address of the user. Must be a taproot address. (P2TR)

Response

An object containing the PSBT (in base64 format), the fee, and the list of UTXOs to sign.

Body
accountCreatedAccount (object)
psbt*string
fee*number
utxosToSign*array of UtxoToSign (object)
Request
const response = await fetch('https://api-dev.saturnbtc.io/v0/pool/increase-liquidity/psbt', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "token0": "text",
      "token1": "text",
      "amount0": "text",
      "amount1": "text",
      "initializeAccountUtxo": false,
      "feeRate": 0,
      "pubkey": "text",
      "address": "text"
    }),
});
const data = await response.json();
Response
{
  "account": {
    "privkey": "text",
    "pubkey": "text",
    "address": "text"
  },
  "psbt": "text",
  "fee": 0,
  "utxosToSign": [
    {
      "address": "text",
      "signingIndexes": [
        0
      ],
      "sigHash": 0,
      "utxo": "text"
    }
  ]
}

Increase Liquidity Message

Generates a message hash for increasing liquidity in an existing position, which the user should sign.

POSThttps://api-dev.saturnbtc.io/v0/pool/increase-liquidity/message
Authorization
Body

The request body containing the liquidity increase details.

positionPubKey*The pubkey of the position

The pubkey of the position.

poolId*The pubkey of the pool

The pubkey of the pool.

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

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

pubkey*The public key of the user initiating the request

The public key of the user initiating the request.

signedPsbt*The signed PSBT in base64 format

The signed PSBT in base64 format.

amount0*The amount of the first token to deposit

The amount of the first token to deposit.

amount1*The amount of the second token to deposit

The amount of the second token to deposit.

address*string

The address of the user. If no secondary address is provided, the primary address must be a taproot address. (P2TR)

secondaryAddressstring

The secondary address of the user. Must be a taproot address. (P2TR)

Response

A hexadecimal string representing the hash of the message to be signed by the user.

Body
string
Request
const response = await fetch('https://api-dev.saturnbtc.io/v0/pool/increase-liquidity/message', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "positionPubKey": "text",
      "poolId": "text",
      "feeRate": 0,
      "pubkey": "text",
      "signedPsbt": "text",
      "amount0": "text",
      "amount1": "text",
      "address": "text"
    }),
});
const data = await response.json();
Response
text

Increase Liquidity

Finalizes the increase of liquidity in an existing position by submitting the signed message and executing the transaction on the network.

POSThttps://api-dev.saturnbtc.io/v0/pool/increase-liquidity
Authorization
Body

The request body containing the liquidity increase request and signature.

signature*The user's signature of the increase liquidity message

The user's signature of the increase liquidity message.

positionPubKey*The pubkey of the position

The pubkey of the position.

poolId*The pubkey of the pool

The pubkey of the pool.

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

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

pubkey*The public key of the user initiating the request

The public key of the user initiating the request.

signedPsbt*The signed PSBT in base64 format

The signed PSBT in base64 format.

amount0*The amount of the first token to deposit

The amount of the first token to deposit.

amount1*The amount of the second token to deposit

The amount of the second token to deposit.

address*string

The address of the user. If no secondary address is provided, the primary address must be a taproot address. (P2TR)

secondaryAddressstring

The secondary address of the user. Must be a taproot address. (P2TR)

Response

The Arch Network transaction ID of the liquidity increase.

Body
string
Request
const response = await fetch('https://api-dev.saturnbtc.io/v0/pool/increase-liquidity', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "signature": "text",
      "positionPubKey": "text",
      "poolId": "text",
      "feeRate": 0,
      "pubkey": "text",
      "signedPsbt": "text",
      "amount0": "text",
      "amount1": "text",
      "address": "text"
    }),
});
const data = await response.json();
Response
text

Last updated