For the complete documentation index, see llms.txt. This page is also available as Markdown.

stBTC: Stacking DAO Core

Stacking DAO Core for stBTC is the main entry point for all user-related actions on the stBTC token: depositing sBTC to mint stBTC, and withdrawing. stBTC is Stacking DAO's sBTC liquid staking token; its value grows against sBTC as bond yield accrues.

The contract can be found here: https://explorer.hiro.so/txid/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-stbtc-v1?chain=mainnet

Integrations

The interface mirrors the stSTX core (see stSTX: Stacking DAO Core), operating on sBTC instead of STX. There are four important methods:

1

Deposit

The deposit method can be initiated using the deposit method on the SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-stbtc-v1 contract.

This contract expects the following parameters:

  • sbtc-amount - a positive integer value for the sBTC amount (in the sBTC base unit, 10^8) you want to stake and get stBTC in return for.

  • min-shares-out - a positive integer for the minimum amount of stBTC you are willing to receive. The transaction reverts if fewer shares would be minted (slippage protection). Compute it from the current ratio (see "Reading the ratio" below), or pass 0 to accept any amount.

2

Initiate Withdrawal

The initialisation of a withdrawal can be called using init-withdraw and expects the following parameters:

  • stbtc-amount - a positive integer value for the stBTC amount you want to unstake and get sBTC in return for.

When this call succeeds, the user will receive an NFT that represents their unstaking position (principal + yield).

3

Withdrawal

Once the cooldown has passed, the sBTC principal + yield can be withdrawn using withdraw:

  • nft-id - the ID of the NFT that was minted in the init-withdraw method previously.

4

Instant Withdrawal

Instant withdrawal lets you withdraw your sBTC immediately using idle liquidity from the protocol, if available. A 1% fee applies.

The instant withdrawal can be called using withdraw-idle and expects the following parameters:

  • stbtc-amount - a positive integer value for the stBTC amount you want to unstake and get sBTC in return for.

Reading the ratio

The stBTC/sBTC exchange rate is read from the data contract at SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.data-stbtc-v1, using the get-sbtc-per-stbtc read-only method. Use it to size min-shares-out.

The data contract can be found here: https://explorer.hiro.so/txid/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.data-stbtc-v1?chain=mainnet