> For the complete documentation index, see [llms.txt](https://docs.stackingdao.com/stackingdao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackingdao.com/stackingdao/core-contracts/stbtc-stacking-dao-core.md).

# 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](broken://pages/a226754d64fc0035f39328afd63bd1a1f0a8717c)), operating on sBTC instead of STX. There are four important methods:

{% stepper %}
{% step %}

## 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.
  {% endstep %}

{% step %}

## 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).
{% endstep %}

{% step %}

## 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.
  {% endstep %}

{% step %}

## 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.
  {% endstep %}
  {% endstepper %}

## 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>
