# Initialize pool

## Initialize Pool PSBT

> Generates a partially signed Bitcoin transaction (PSBT) for creating the needed UTXOs for creating the accounts\
> for a pool.\
> \
> The request body containing details for creating accounts PSBT.

```json
{"openapi":"3.1.0","info":{"title":"@saturnbtcio/api","version":"0.0.1"},"tags":[{"name":"Pool"}],"servers":[{"url":"https://api-dev.saturnbtc.io","description":"Development Server"},{"url":"https://api.saturnbtc.io","description":"Production Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"InitPoolCreateAccountsPsbtRequestIApiRequest":{"type":"object","properties":{"feeRate":{"type":"integer","minimum":1,"title":"The fee rate for the transaction (in sats per byte)","description":"The fee rate for the transaction (in sats per byte)."},"shardsLength":{"type":"number","title":"The number of accounts to create. Maximum is 10","description":"The number of accounts to create. Maximum is 10."},"token0":{"type":"string","title":"The first token's identifier","description":"The first token's identifier."},"token1":{"type":"string","title":"The second token's identifier","description":"The second token's identifier."},"feeTier":{"type":"number","title":"The fee tier for the pool","description":"The fee tier for the pool."},"runePubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the rune address of the user initiating the request","description":"The public key of the rune address of the user initiating the request."},"paymentPubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the bitcoin address of the user initiating the request","description":"The public key of the bitcoin address of the user initiating the request.\nIf the user doesn't have a bitcoin address, the runePubkey will be used"},"runeAddress":{"type":"string","title":"The rune address of the user. It must be a taproot address. (P2TR)","description":"The rune address of the user. It must be a taproot address. (P2TR).\nIf no bitcoin address is provided, the rune address will be used for bitcoin too."},"paymentAddress":{"type":"string","title":"The bitcoin address of the user","description":"The bitcoin address of the user."}},"required":["feeRate","shardsLength","token0","token1","feeTier","runePubkey","runeAddress"]},"PsbtResponse":{"type":"object","properties":{"psbt":{"type":"string","description":"Psbt base64 encoded to sign"},"fee":{"type":"number","description":"Raw fees in satoshis of the transaction"},"utxosToSign":{"type":"array","items":{"$ref":"#/components/schemas/UtxoToSign"},"description":"Inputs to sign"}},"required":["psbt","fee","utxosToSign"]},"UtxoToSign":{"type":"object","properties":{"address":{"type":"string","description":"Address that should sign the transaction"},"signingIndexes":{"type":"array","items":{"type":"number"},"description":"Indexes of the inputs to sign"},"sigHash":{"type":"number","description":"Sig hash type"},"utxo":{"type":"string","title":"Utxo id (txid:vout) of the utxo used in the psbt","description":"Utxo id (txid:vout) of the utxo used in the psbt."}},"required":["address","signingIndexes","utxo"]},"PoolNotFoundErrorByPoolId":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"PoolNotFoundErrorByToken":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"token0":{"type":"string"},"token1":{"type":"string"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","token0","token1","message"]},"PoolAlreadyExistsError":{"type":"object","properties":{"type":{"const":"PoolAlreadyExists"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"InvalidFeeRateError":{"type":"object","properties":{"type":{"const":"InvalidFeeRate"},"minFeeRate":{"type":"number"},"message":{"type":"string"}},"required":["type","minFeeRate","message"]},"InvalidUtxoError":{"type":"object","properties":{"type":{"const":"InvalidUtxo"},"utxos":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["type","utxos","message"]},"InvalidTokenError":{"type":"object","properties":{"type":{"const":"InvalidToken"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","token","message"]},"NotEnoughFundsError":{"type":"object","properties":{"type":{"const":"NotEnoughFunds"},"maxAmount":{"type":"string"},"minAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","maxAmount","minAmount","token","message"]},"NotEnoughFundsForSplittingRuneError":{"type":"object","properties":{"type":{"const":"NotEnoughFundsForSplittingRune"},"recommendedRuneAmount":{"type":"string"},"currentSatsAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","recommendedRuneAmount","currentSatsAmount","token","message"]},"ShardPubkeysRequiredError":{"type":"object","properties":{"type":{"const":"ShardPubkeysRequired"},"message":{"type":"string"}},"required":["type","message"]},"RequestExpiredError":{"type":"object","properties":{"type":{"const":"RequestExpired"},"message":{"type":"string"}},"required":["type","message"]},"FailedToSendArchTransactionError":{"type":"object","properties":{"type":{"const":"FailedToSendArchTransaction"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAddress":{"type":"object","properties":{"type":{"const":"InvalidAddress"},"message":{"type":"string"}},"required":["type","message"]},"InvalidNumericValue":{"type":"object","properties":{"type":{"const":"InvalidNumericValue"},"message":{"type":"string"}},"required":["type","message"]},"InvalidTxSizeError":{"type":"object","properties":{"type":{"const":"InvalidTxSize"},"message":{"type":"string"}},"required":["type","message"]},"InvalidRunestoneError":{"type":"object","properties":{"type":{"const":"InvalidRunestone"},"message":{"type":"string"}},"required":["type","message"]},"InvalidSignatureError":{"type":"object","properties":{"type":{"const":"InvalidSignature"},"message":{"type":"string"}},"required":["type","message"]},"InvalidPsbtError":{"type":"object","properties":{"type":{"const":"InvalidPsbt"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAmountBelowMinError":{"type":"object","properties":{"type":{"const":"InvalidAmountBelowMin"},"token":{"type":"string"},"minAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","minAmount","message"]},"InvalidAmountError":{"type":"object","properties":{"type":{"const":"InvalidAmount"},"token":{"type":"string"},"expectedAmount":{"type":"string"},"actualAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","expectedAmount","actualAmount","message"]},"InsufficientLiquidityError":{"type":"object","properties":{"type":{"const":"InsufficientLiquidity"},"token":{"type":"string"},"maxAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","maxAmount","message"]},"ShardsUnavailableError":{"type":"object","properties":{"type":{"const":"ShardsUnavailable"},"reason":{"oneOf":[{"const":"MempoolConstraints"},{"const":"NoBalance"}]},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","reason","token","message"]},"InvalidAssetPairError":{"type":"object","properties":{"type":{"const":"InvalidAssetPair"},"message":{"type":"string"}},"required":["type","message"]},"InvalidFeeTierError":{"type":"object","properties":{"type":{"const":"InvalidFeeTier"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","feeTier","message"]},"InvalidPubkeyError":{"type":"object","properties":{"type":{"const":"InvalidPubkey"},"pubkey":{"type":"string"},"message":{"type":"string"}},"required":["type","pubkey","message"]}}},"paths":{"/v0/pool/initialize-pool/psbt":{"post":{"summary":"Initialize Pool PSBT","description":"Generates a partially signed Bitcoin transaction (PSBT) for creating the needed UTXOs for creating the accounts\nfor a pool.\n\nThe request body containing details for creating accounts PSBT.","tags":["Pool"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitPoolCreateAccountsPsbtRequestIApiRequest"}}},"required":true},"responses":{"201":{"description":"An object containing the PSBT, fee, utxos to sign, and the created accounts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PsbtResponse"}}}},"400":{"description":"Pool error","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PoolNotFoundErrorByPoolId"},{"$ref":"#/components/schemas/PoolNotFoundErrorByToken"},{"$ref":"#/components/schemas/PoolAlreadyExistsError"},{"$ref":"#/components/schemas/InvalidFeeRateError"},{"$ref":"#/components/schemas/InvalidUtxoError"},{"$ref":"#/components/schemas/InvalidTokenError"},{"$ref":"#/components/schemas/NotEnoughFundsError"},{"$ref":"#/components/schemas/NotEnoughFundsForSplittingRuneError"},{"$ref":"#/components/schemas/ShardPubkeysRequiredError"},{"$ref":"#/components/schemas/RequestExpiredError"},{"$ref":"#/components/schemas/FailedToSendArchTransactionError"},{"$ref":"#/components/schemas/InvalidAddress"},{"$ref":"#/components/schemas/InvalidNumericValue"},{"$ref":"#/components/schemas/InvalidTxSizeError"},{"$ref":"#/components/schemas/InvalidRunestoneError"},{"$ref":"#/components/schemas/InvalidSignatureError"},{"$ref":"#/components/schemas/InvalidPsbtError"},{"$ref":"#/components/schemas/InvalidAmountBelowMinError"},{"$ref":"#/components/schemas/InvalidAmountError"},{"$ref":"#/components/schemas/InsufficientLiquidityError"},{"$ref":"#/components/schemas/ShardsUnavailableError"},{"$ref":"#/components/schemas/InvalidAssetPairError"},{"$ref":"#/components/schemas/InvalidFeeTierError"},{"$ref":"#/components/schemas/InvalidPubkeyError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"User not found","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## Initialize Pool Message

> Generates a message hash required to initialize a pool.

```json
{"openapi":"3.1.0","info":{"title":"@saturnbtcio/api","version":"0.0.1"},"tags":[{"name":"Pool"}],"servers":[{"url":"https://api-dev.saturnbtc.io","description":"Development Server"},{"url":"https://api.saturnbtc.io","description":"Production Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"InitializePoolMessageRequestIApiRequest":{"type":"object","properties":{"token0":{"type":"string","title":"The first token's identifier","description":"The first token's identifier."},"token1":{"type":"string","title":"The second token's identifier","description":"The second token's identifier."},"feeTier":{"type":"number","title":"The fee tier for the pool","description":"The fee tier for the pool."},"shardsLength":{"type":"number","title":"The number of accounts to create. Maximum is 5","description":"The number of accounts to create. Maximum is 5."},"recentBlockhash":{"type":"string","title":"The recent blockhash of the transaction","description":"The recent blockhash of the transaction."},"feeRate":{"type":"integer","minimum":1,"title":"The fee rate for the transaction (in sats per byte)","description":"The fee rate for the transaction (in sats per byte)."},"signedPsbt":{"type":"string","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$","title":"The signed PSBT in base64 format","description":"The signed PSBT in base64 format."},"runePubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the rune address of the user initiating the request","description":"The public key of the rune address of the user initiating the request."},"paymentPubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the bitcoin address of the user initiating the request","description":"The public key of the bitcoin address of the user initiating the request.\nIf the user doesn't have a bitcoin address, the runePubkey will be used"},"runeAddress":{"type":"string","title":"The rune address of the user. It must be a taproot address. (P2TR)","description":"The rune address of the user. It must be a taproot address. (P2TR).\nIf no bitcoin address is provided, the rune address will be used for bitcoin too."},"paymentAddress":{"type":"string","title":"The bitcoin address of the user","description":"The bitcoin address of the user."}},"required":["token0","token1","feeTier","shardsLength","recentBlockhash","feeRate","signedPsbt","runePubkey","runeAddress"]},"PoolNotFoundErrorByPoolId":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"PoolNotFoundErrorByToken":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"token0":{"type":"string"},"token1":{"type":"string"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","token0","token1","message"]},"PoolAlreadyExistsError":{"type":"object","properties":{"type":{"const":"PoolAlreadyExists"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"InvalidFeeRateError":{"type":"object","properties":{"type":{"const":"InvalidFeeRate"},"minFeeRate":{"type":"number"},"message":{"type":"string"}},"required":["type","minFeeRate","message"]},"InvalidUtxoError":{"type":"object","properties":{"type":{"const":"InvalidUtxo"},"utxos":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["type","utxos","message"]},"InvalidTokenError":{"type":"object","properties":{"type":{"const":"InvalidToken"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","token","message"]},"NotEnoughFundsError":{"type":"object","properties":{"type":{"const":"NotEnoughFunds"},"maxAmount":{"type":"string"},"minAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","maxAmount","minAmount","token","message"]},"NotEnoughFundsForSplittingRuneError":{"type":"object","properties":{"type":{"const":"NotEnoughFundsForSplittingRune"},"recommendedRuneAmount":{"type":"string"},"currentSatsAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","recommendedRuneAmount","currentSatsAmount","token","message"]},"ShardPubkeysRequiredError":{"type":"object","properties":{"type":{"const":"ShardPubkeysRequired"},"message":{"type":"string"}},"required":["type","message"]},"RequestExpiredError":{"type":"object","properties":{"type":{"const":"RequestExpired"},"message":{"type":"string"}},"required":["type","message"]},"FailedToSendArchTransactionError":{"type":"object","properties":{"type":{"const":"FailedToSendArchTransaction"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAddress":{"type":"object","properties":{"type":{"const":"InvalidAddress"},"message":{"type":"string"}},"required":["type","message"]},"InvalidNumericValue":{"type":"object","properties":{"type":{"const":"InvalidNumericValue"},"message":{"type":"string"}},"required":["type","message"]},"InvalidTxSizeError":{"type":"object","properties":{"type":{"const":"InvalidTxSize"},"message":{"type":"string"}},"required":["type","message"]},"InvalidRunestoneError":{"type":"object","properties":{"type":{"const":"InvalidRunestone"},"message":{"type":"string"}},"required":["type","message"]},"InvalidSignatureError":{"type":"object","properties":{"type":{"const":"InvalidSignature"},"message":{"type":"string"}},"required":["type","message"]},"InvalidPsbtError":{"type":"object","properties":{"type":{"const":"InvalidPsbt"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAmountBelowMinError":{"type":"object","properties":{"type":{"const":"InvalidAmountBelowMin"},"token":{"type":"string"},"minAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","minAmount","message"]},"InvalidAmountError":{"type":"object","properties":{"type":{"const":"InvalidAmount"},"token":{"type":"string"},"expectedAmount":{"type":"string"},"actualAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","expectedAmount","actualAmount","message"]},"InsufficientLiquidityError":{"type":"object","properties":{"type":{"const":"InsufficientLiquidity"},"token":{"type":"string"},"maxAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","maxAmount","message"]},"ShardsUnavailableError":{"type":"object","properties":{"type":{"const":"ShardsUnavailable"},"reason":{"oneOf":[{"const":"MempoolConstraints"},{"const":"NoBalance"}]},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","reason","token","message"]},"InvalidAssetPairError":{"type":"object","properties":{"type":{"const":"InvalidAssetPair"},"message":{"type":"string"}},"required":["type","message"]},"InvalidFeeTierError":{"type":"object","properties":{"type":{"const":"InvalidFeeTier"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","feeTier","message"]},"InvalidPubkeyError":{"type":"object","properties":{"type":{"const":"InvalidPubkey"},"pubkey":{"type":"string"},"message":{"type":"string"}},"required":["type","pubkey","message"]}}},"paths":{"/v0/pool/initialize-pool/message":{"post":{"summary":"Initialize Pool Message","description":"Generates a message hash required to initialize a pool.","tags":["Pool"],"parameters":[],"requestBody":{"description":"The request body containing pool initialization details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitializePoolMessageRequestIApiRequest"}}},"required":true},"responses":{"201":{"description":"A hexadecimal string representing the hash of the initialization message.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Pool error","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PoolNotFoundErrorByPoolId"},{"$ref":"#/components/schemas/PoolNotFoundErrorByToken"},{"$ref":"#/components/schemas/PoolAlreadyExistsError"},{"$ref":"#/components/schemas/InvalidFeeRateError"},{"$ref":"#/components/schemas/InvalidUtxoError"},{"$ref":"#/components/schemas/InvalidTokenError"},{"$ref":"#/components/schemas/NotEnoughFundsError"},{"$ref":"#/components/schemas/NotEnoughFundsForSplittingRuneError"},{"$ref":"#/components/schemas/ShardPubkeysRequiredError"},{"$ref":"#/components/schemas/RequestExpiredError"},{"$ref":"#/components/schemas/FailedToSendArchTransactionError"},{"$ref":"#/components/schemas/InvalidAddress"},{"$ref":"#/components/schemas/InvalidNumericValue"},{"$ref":"#/components/schemas/InvalidTxSizeError"},{"$ref":"#/components/schemas/InvalidRunestoneError"},{"$ref":"#/components/schemas/InvalidSignatureError"},{"$ref":"#/components/schemas/InvalidPsbtError"},{"$ref":"#/components/schemas/InvalidAmountBelowMinError"},{"$ref":"#/components/schemas/InvalidAmountError"},{"$ref":"#/components/schemas/InsufficientLiquidityError"},{"$ref":"#/components/schemas/ShardsUnavailableError"},{"$ref":"#/components/schemas/InvalidAssetPairError"},{"$ref":"#/components/schemas/InvalidFeeTierError"},{"$ref":"#/components/schemas/InvalidPubkeyError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"User not found","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## Initialize Pool

> Finalizes the pool initialization process.

```json
{"openapi":"3.1.0","info":{"title":"@saturnbtcio/api","version":"0.0.1"},"tags":[{"name":"Pool"}],"servers":[{"url":"https://api-dev.saturnbtc.io","description":"Development Server"},{"url":"https://api.saturnbtc.io","description":"Production Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"InitializePoolRequestIApiRequest":{"type":"object","properties":{"signature":{"type":"string","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$","title":"The user's signature of the initialization message","description":"The user's signature of the initialization message."},"token0":{"type":"string","title":"The first token's identifier","description":"The first token's identifier."},"token1":{"type":"string","title":"The second token's identifier","description":"The second token's identifier."},"feeTier":{"type":"number","title":"The fee tier for the pool","description":"The fee tier for the pool."},"shardsLength":{"type":"number","title":"The number of accounts to create. Maximum is 5","description":"The number of accounts to create. Maximum is 5."},"recentBlockhash":{"type":"string","title":"The recent blockhash of the transaction","description":"The recent blockhash of the transaction."},"feeRate":{"type":"integer","minimum":1,"title":"The fee rate for the transaction (in sats per byte)","description":"The fee rate for the transaction (in sats per byte)."},"signedPsbt":{"type":"string","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}={2})$","title":"The signed PSBT in base64 format","description":"The signed PSBT in base64 format."},"runePubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the rune address of the user initiating the request","description":"The public key of the rune address of the user initiating the request."},"paymentPubkey":{"type":"string","pattern":"^[0-9a-fA-F]+$","minLength":64,"maxLength":66,"title":"The public key of the bitcoin address of the user initiating the request","description":"The public key of the bitcoin address of the user initiating the request.\nIf the user doesn't have a bitcoin address, the runePubkey will be used"},"runeAddress":{"type":"string","title":"The rune address of the user. It must be a taproot address. (P2TR)","description":"The rune address of the user. It must be a taproot address. (P2TR).\nIf no bitcoin address is provided, the rune address will be used for bitcoin too."},"paymentAddress":{"type":"string","title":"The bitcoin address of the user","description":"The bitcoin address of the user."}},"required":["signature","token0","token1","feeTier","shardsLength","recentBlockhash","feeRate","signedPsbt","runePubkey","runeAddress"]},"InstructionResponse":{"type":"object","properties":{"archTxId":{"type":"string","title":"Transaction id of the transaction in Arch","description":"Transaction id of the transaction in Arch."},"bitcoinTxIds":{"type":"array","items":{"type":"string"},"description":"Some bitcoin transactions ids that we have broadcasted. The Arch Network will\nsubmit a new bitcoin transaction after these ones."}},"required":["archTxId","bitcoinTxIds"]},"PoolNotFoundErrorByPoolId":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"PoolNotFoundErrorByToken":{"type":"object","properties":{"type":{"const":"PoolNotFound"},"token0":{"type":"string"},"token1":{"type":"string"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","token0","token1","message"]},"PoolAlreadyExistsError":{"type":"object","properties":{"type":{"const":"PoolAlreadyExists"},"poolId":{"type":"string"},"message":{"type":"string"}},"required":["type","poolId","message"]},"InvalidFeeRateError":{"type":"object","properties":{"type":{"const":"InvalidFeeRate"},"minFeeRate":{"type":"number"},"message":{"type":"string"}},"required":["type","minFeeRate","message"]},"InvalidUtxoError":{"type":"object","properties":{"type":{"const":"InvalidUtxo"},"utxos":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["type","utxos","message"]},"InvalidTokenError":{"type":"object","properties":{"type":{"const":"InvalidToken"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","token","message"]},"NotEnoughFundsError":{"type":"object","properties":{"type":{"const":"NotEnoughFunds"},"maxAmount":{"type":"string"},"minAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","maxAmount","minAmount","token","message"]},"NotEnoughFundsForSplittingRuneError":{"type":"object","properties":{"type":{"const":"NotEnoughFundsForSplittingRune"},"recommendedRuneAmount":{"type":"string"},"currentSatsAmount":{"type":"string"},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","recommendedRuneAmount","currentSatsAmount","token","message"]},"ShardPubkeysRequiredError":{"type":"object","properties":{"type":{"const":"ShardPubkeysRequired"},"message":{"type":"string"}},"required":["type","message"]},"RequestExpiredError":{"type":"object","properties":{"type":{"const":"RequestExpired"},"message":{"type":"string"}},"required":["type","message"]},"FailedToSendArchTransactionError":{"type":"object","properties":{"type":{"const":"FailedToSendArchTransaction"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAddress":{"type":"object","properties":{"type":{"const":"InvalidAddress"},"message":{"type":"string"}},"required":["type","message"]},"InvalidNumericValue":{"type":"object","properties":{"type":{"const":"InvalidNumericValue"},"message":{"type":"string"}},"required":["type","message"]},"InvalidTxSizeError":{"type":"object","properties":{"type":{"const":"InvalidTxSize"},"message":{"type":"string"}},"required":["type","message"]},"InvalidRunestoneError":{"type":"object","properties":{"type":{"const":"InvalidRunestone"},"message":{"type":"string"}},"required":["type","message"]},"InvalidSignatureError":{"type":"object","properties":{"type":{"const":"InvalidSignature"},"message":{"type":"string"}},"required":["type","message"]},"InvalidPsbtError":{"type":"object","properties":{"type":{"const":"InvalidPsbt"},"message":{"type":"string"}},"required":["type","message"]},"InvalidAmountBelowMinError":{"type":"object","properties":{"type":{"const":"InvalidAmountBelowMin"},"token":{"type":"string"},"minAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","minAmount","message"]},"InvalidAmountError":{"type":"object","properties":{"type":{"const":"InvalidAmount"},"token":{"type":"string"},"expectedAmount":{"type":"string"},"actualAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","expectedAmount","actualAmount","message"]},"InsufficientLiquidityError":{"type":"object","properties":{"type":{"const":"InsufficientLiquidity"},"token":{"type":"string"},"maxAmount":{"type":"string"},"message":{"type":"string"}},"required":["type","token","maxAmount","message"]},"ShardsUnavailableError":{"type":"object","properties":{"type":{"const":"ShardsUnavailable"},"reason":{"oneOf":[{"const":"MempoolConstraints"},{"const":"NoBalance"}]},"token":{"type":"string"},"message":{"type":"string"}},"required":["type","reason","token","message"]},"InvalidAssetPairError":{"type":"object","properties":{"type":{"const":"InvalidAssetPair"},"message":{"type":"string"}},"required":["type","message"]},"InvalidFeeTierError":{"type":"object","properties":{"type":{"const":"InvalidFeeTier"},"feeTier":{"type":"number"},"message":{"type":"string"}},"required":["type","feeTier","message"]},"InvalidPubkeyError":{"type":"object","properties":{"type":{"const":"InvalidPubkey"},"pubkey":{"type":"string"},"message":{"type":"string"}},"required":["type","pubkey","message"]}}},"paths":{"/v0/pool/initialize-pool":{"post":{"summary":"Initialize Pool","description":"Finalizes the pool initialization process.","tags":["Pool"],"parameters":[],"requestBody":{"description":"The request body containing the initialization request and signature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitializePoolRequestIApiRequest"}}},"required":true},"responses":{"201":{"description":"The Arch Network transaction ID of the pool creation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionResponse"}}}},"400":{"description":"Pool error","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PoolNotFoundErrorByPoolId"},{"$ref":"#/components/schemas/PoolNotFoundErrorByToken"},{"$ref":"#/components/schemas/PoolAlreadyExistsError"},{"$ref":"#/components/schemas/InvalidFeeRateError"},{"$ref":"#/components/schemas/InvalidUtxoError"},{"$ref":"#/components/schemas/InvalidTokenError"},{"$ref":"#/components/schemas/NotEnoughFundsError"},{"$ref":"#/components/schemas/NotEnoughFundsForSplittingRuneError"},{"$ref":"#/components/schemas/ShardPubkeysRequiredError"},{"$ref":"#/components/schemas/RequestExpiredError"},{"$ref":"#/components/schemas/FailedToSendArchTransactionError"},{"$ref":"#/components/schemas/InvalidAddress"},{"$ref":"#/components/schemas/InvalidNumericValue"},{"$ref":"#/components/schemas/InvalidTxSizeError"},{"$ref":"#/components/schemas/InvalidRunestoneError"},{"$ref":"#/components/schemas/InvalidSignatureError"},{"$ref":"#/components/schemas/InvalidPsbtError"},{"$ref":"#/components/schemas/InvalidAmountBelowMinError"},{"$ref":"#/components/schemas/InvalidAmountError"},{"$ref":"#/components/schemas/InsufficientLiquidityError"},{"$ref":"#/components/schemas/ShardsUnavailableError"},{"$ref":"#/components/schemas/InvalidAssetPairError"},{"$ref":"#/components/schemas/InvalidFeeTierError"},{"$ref":"#/components/schemas/InvalidPubkeyError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"User not found","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```
