Open position

Open Position PSBT

Generates a PSBT for opening a new liquidity position by sending funds to the pool.

post

/v0/pool/open-position/psbt

Authorizations
Body
token0The first token's identifier. Must be the name of the tokenrequired

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

token1The second token's identifier. Must be the name of the tokenrequired

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

amount0The amount of the first token to depositrequired

The amount of the first token to deposit.

Pattern: ^[1-9][0-9]*$
amount1The amount of the second token to depositrequired

The amount of the second token to deposit.

Pattern: ^[1-9][0-9]*$
initializeAccountUtxoA boolean indicating whether to initialize the account UTXOrequired

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

feeRateThe fee rate for the transaction (in sats per byte)required

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

runePubkeyThe public key of the rune address of the user initiating the requestrequired

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

Pattern: ^[0-9a-fA-F]+$
paymentPubkeyThe public key of the bitcoin address of the user initiating the request

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]+$
runeAddressThe rune address of the user. It must be a taproot address. (P2TR)required

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.

paymentAddressThe bitcoin address of the user

The bitcoin address of the user.

Responses
curl -L \
  --request POST \
  --url 'https://api-dev.saturnbtc.io/v0/pool/open-position/psbt' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"token0":"text","token1":"text","amount0":"text","amount1":"text","initializeAccountUtxo":true,"feeRate":1,"runePubkey":"text","runeAddress":"text"}'
{
  "account": {
    "privkey": "text",
    "pubkey": "text",
    "address": "text"
  },
  "mergeUtxoPsbt": {
    "psbt": "text",
    "fee": 1,
    "utxosToSign": [
      {
        "address": "text",
        "sigHash": 1,
        "utxo": "text",
        "signingIndexes": [
          1
        ]
      }
    ]
  },
  "psbt": "text",
  "fee": 1,
  "utxosToSign": [
    {
      "address": "text",
      "sigHash": 1,
      "utxo": "text",
      "signingIndexes": [
        1
      ]
    }
  ]
}

Open Position Message

Generates a message hash for opening a new liquidity position, which the user should sign.

post

/v0/pool/open-position/message

Authorizations
Body
poolIdThe pubkey of the poolrequired

The pubkey of the pool.

Pattern: ^[0-9a-fA-F]+$
amount0The amount of the first token to depositrequired

The amount of the first token to deposit.

Pattern: ^[1-9][0-9]*$
amount1The amount of the second token to depositrequired

The amount of the second token to deposit.

Pattern: ^[1-9][0-9]*$
feeRateThe fee rate for the transaction (in sats per byte)required

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

signedPsbtThe signed PSBT in base64 formatrequired

The signed PSBT in base64 format.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
accountThe created account received in the '/psbt' endpointrequired

The created account received in the '/psbt' endpoint.

mergeUtxoPsbtThe merge UTXO PSBT in base64 format

The merge UTXO PSBT in base64 format.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
runePubkeyThe public key of the rune address of the user initiating the requestrequired

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

Pattern: ^[0-9a-fA-F]+$
paymentPubkeyThe public key of the bitcoin address of the user initiating the request

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]+$
runeAddressThe rune address of the user. It must be a taproot address. (P2TR)required

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.

paymentAddressThe bitcoin address of the user

The bitcoin address of the user.

Responses
curl -L \
  --request POST \
  --url 'https://api-dev.saturnbtc.io/v0/pool/open-position/message' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"poolId":"text","amount0":"text","amount1":"text","feeRate":1,"signedPsbt":"text","account":{"privkey":"text","pubkey":"text","address":"text"},"runePubkey":"text","runeAddress":"text"}'
text

Open Position

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

post

/v0/pool/open-position

Authorizations
Body
signatureThe user's signature of the open position messagerequired

The user's signature of the open position message.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
poolIdThe pubkey of the poolrequired

The pubkey of the pool.

Pattern: ^[0-9a-fA-F]+$
amount0The amount of the first token to depositrequired

The amount of the first token to deposit.

Pattern: ^[1-9][0-9]*$
amount1The amount of the second token to depositrequired

The amount of the second token to deposit.

Pattern: ^[1-9][0-9]*$
feeRateThe fee rate for the transaction (in sats per byte)required

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

signedPsbtThe signed PSBT in base64 formatrequired

The signed PSBT in base64 format.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
accountThe created account received in the '/psbt' endpointrequired

The created account received in the '/psbt' endpoint.

mergeUtxoPsbtThe merge UTXO PSBT in base64 format

The merge UTXO PSBT in base64 format.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$
runePubkeyThe public key of the rune address of the user initiating the requestrequired

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

Pattern: ^[0-9a-fA-F]+$
paymentPubkeyThe public key of the bitcoin address of the user initiating the request

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]+$
runeAddressThe rune address of the user. It must be a taproot address. (P2TR)required

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.

paymentAddressThe bitcoin address of the user

The bitcoin address of the user.

Responses
curl -L \
  --request POST \
  --url 'https://api-dev.saturnbtc.io/v0/pool/open-position' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"signature":"text","poolId":"text","amount0":"text","amount1":"text","feeRate":1,"signedPsbt":"text","account":{"privkey":"text","pubkey":"text","address":"text"},"runePubkey":"text","runeAddress":"text"}'
{
  "archTxId": "text",
  "bitcoinTxIds": [
    "text"
  ]
}

Last updated