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:
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 getstBTCin return for.min-shares-out- a positive integer for the minimum amount ofstBTCyou 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 pass0to accept any amount.
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 getsBTCin return for.
When this call succeeds, the user will receive an NFT that represents their unstaking position (principal + yield).
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 getsBTCin 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