What you can do
| stake STX for stSTX | Liquid-stake STX, yield compounds into the stSTX/STX ratio. | Read data-stx-v2.get-stx-per-ststx; min = stx-amount*1e6/ratio minus a small buffer; call stacking-dao-core-stx-v2.deposit(stx-amount, min) with an STX post-condition for stx-amount. |
| stake STX for stSTXbtc | Liquid-stake STX and earn sBTC rewards. | stacking-dao-core-ststxbtc-v2.deposit(stx-amount, stx-amount); later claim with ststxbtc-tracking-v2.claim-pending-rewards(you, you). |
| stake sBTC for stBTC | Liquid-stake sBTC. | Read data-stbtc-v1.get-sbtc-per-stbtc; call stacking-dao-core-stbtc-v1.deposit(sbtc-amount, min) with an sBTC post-condition. |
| instant unstake | Exit immediately for a 1% fee if idle liquidity exists. | core.withdraw-idle(amount) on the matching core contract. Alternative: sell on a Stacks DEX (Bitflow), price may differ. |
| standard unstake | Exit at full ratio after the cooldown. | core.init-withdraw(amount) -> nft-id; wait until burn-block-height >= withdraw-data .get-withdrawals-by-nft(nft-id).unlock-burn-height (about 2 weeks for stSTX/stSTXbtc, about 4 weeks for stBTC); then core.withdraw(nft-id) from the NFT owner. |
| switch stSTX <> stSTXbtc | Change yield type without unstaking. | swap-ststx-ststxbtc-v4.swap-ststx-for-ststxbtc(amount, min-out) or swap-ststxbtc-for-ststx(amount, min-out). |
Standard withdrawals take a fixed cooldown: 2,100 Bitcoin blocks (~2 weeks) for stSTX/stSTXbtc and 4,200 (~4 weeks) for stBTC at research time; governance can lengthen it (minimum 2,100 on mainnet). The withdrawal NFT must not be transferred/sold by mistake: only its owner can claim.
Instant unstake charges a 1% fee and only works while the reserve holds enough idle liquidity.
Governance (dao / dao-multisig / dao-executor) can pause deposits and each withdrawal path, change fees, and upgrade contracts by activating new versions; versioned contract names (e.g. core-stx-v2 replaced core-v6) mean integrations must follow the docs.
stBTC depends on the external sBTC token and peg (SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token), outside StackingDAO's control.
Contracts
Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).stSTX Core (stacking-dao-core-stx-v2)staking on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-stx-v2
write deposit(stx-amount uint, min-shares-out uint)
Stake STX for stSTX. stx-amount in micro-STX (1 STX = 1000000). Transfers STX from tx-sender (add an STX post-condition) and mints stSTX = stx-amount * 1e6 / get-stx-per-ststx-up. Reverts with err u26007 if fewer than min-shares-out micro-stSTX would be minted (0 = no slippage check). Returns (ok ststx-amount).
write init-withdraw(ststx-amount uint)
Start a standard withdrawal of ststx-amount micro-stSTX. Moves your stSTX to the core, locks STX at the current ratio and mints a withdrawal NFT (ststx-withdraw-nft-v4) to you. Returns (ok nft-id). Claimable after a fixed cooldown (currently 2,100 Bitcoin blocks, about two weeks; see withdraw-data-stx-v2.get-withdraw-unlock-burn-height).
write withdraw(nft-id uint)
Claim STX for a withdrawal NFT once burn-block-height >= its unlock-burn-height. tx-sender must own the NFT (err u26003 otherwise; err u26002 if still locked). Burns the NFT and the escrowed stSTX, sends STX. Returns (ok {stx-user, stx-fee}).
write withdraw-idle(ststx-amount uint)
Instant unstake: burns ststx-amount micro-stSTX and pays STX from idle reserve liquidity right away, minus the idle fee (get-withdraw-idle-fee, 100 bps = 1% at research time). Reverts err u26006 if the reserve lacks idle STX. Returns (ok {stx-user, stx-fee}).
read get-shutdown-deposits()
true if deposits are paused by governance. Also get-shutdown-init-withdraw(), get-shutdown-withdraw(), get-shutdown-withdraw-idle(). All false at research time.
read get-withdraw-idle-fee()
Instant-unstake fee in basis points (u100 = 1%).
read get-withdraw-fee()
Fee on standard withdrawals in basis points (u0 at research time).
stSTX exchange-rate data (data-stx-v2)other on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.data-stx-v2
read get-stx-per-ststx()
micro-STX backing one stSTX, scaled by 1e6 (e.g. u1199681 = 1.199681 STX per stSTX at research time). Rounded down; use for redemption value and to size min-shares-out.
read get-stx-per-ststx-up()
Same ratio rounded up; this is the value deposit() divides by.
stSTX tokentoken on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststx-token
read get-balance(account principal)
stSTX balance in micro-stSTX (6 decimals). Value-accruing (non-rebasing) token.
read get-total-supply()
Total stSTX supply (6 decimals).
write transfer(amount uint, sender principal, recipient principal, memo (optional (buff 34)))
SIP-010 transfer; sender must be tx-sender.
stSTXbtc Core (stacking-dao-core-ststxbtc-v2)staking on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-ststxbtc-v2
write deposit(stx-amount uint, min-shares-out uint)
Stake micro-STX and receive the same amount of stSTXbtc (minted 1:1). Yield is paid in sBTC via ststxbtc-tracking-v2, not through a ratio. Returns (ok stx-amount).
write init-withdraw(ststxbtc-amount uint)
Start a standard withdrawal (1 stSTXbtc = 1 STX). Mints a ststxbtc-withdraw-nft-v3 to you; returns (ok nft-id). Cooldown is currently 2,100 Bitcoin blocks (ststxbtc-data-v2.get-withdraw-cooldown-blocks).
write withdraw(nft-id uint)
Claim STX for an unlocked withdrawal NFT you own. Returns (ok {stx-user, stx-fee}).
write withdraw-idle(ststxbtc-amount uint)
Instant unstake from idle STX minus the idle fee (1% at research time). Returns (ok {stx-user, stx-fee}).
read get-shutdown-deposits()
Pause flag for deposits (also get-shutdown-init-withdraw / -withdraw / -withdraw-idle).
read get-withdraw-idle-fee()
Instant-unstake fee in basis points.
stSTXbtc tokentoken on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststxbtc-token-v2
read get-balance(account principal)
stSTXbtc balance (6 decimals, 1:1 with STX).
write transfer(amount uint, sender principal, recipient principal, memo (optional (buff 34)))
SIP-010 transfer. Transfers also refresh the holder's sBTC reward tracking.
stSTXbtc sBTC reward tracker (ststxbtc-tracking-v2)other on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststxbtc-tracking-v2
read get-pending-rewards(holder principal, position principal)
Unclaimed sBTC rewards (8 decimals) for a holder. For tokens held in the wallet itself pass position = holder; for stSTXbtc deposited in a supported DeFi position pass that position contract.
write claim-pending-rewards(holder principal, position principal)
Sends pending sBTC rewards to holder (anyone can call for any holder). Returns (ok amount). Fails if claims are disabled (get-claims-enabled).
read get-claims-enabled()
Whether reward claims are currently enabled.
stBTC Core (stacking-dao-core-stbtc-v1)staking on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-stbtc-v1
write deposit(sbtc-amount uint, min-shares-out uint)
Deposit sBTC (SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token, 8 decimals, 1 sBTC = 100000000) and mint stBTC = sbtc-amount * 1e8 / get-sbtc-per-stbtc-up. Reverts if fewer than min-shares-out. Returns (ok stbtc-amount).
write init-withdraw(stbtc-amount uint)
Start a standard withdrawal; mints a stbtc-withdraw-nft to you, returns (ok nft-id). Cooldown currently 4,200 Bitcoin blocks (about four weeks; withdraw-data-stbtc.get-withdraw-cooldown-blocks).
write withdraw(nft-id uint)
Claim sBTC for an unlocked withdrawal NFT you own.
write withdraw-idle(stbtc-amount uint)
Instant withdrawal from idle sBTC, minus the idle fee (1% at research time), if liquidity is available.
read get-shutdown-deposits()
Pause flag for deposits (also get-shutdown-init-withdraw / -withdraw / -withdraw-idle).
read get-withdraw-idle-fee()
Instant-withdrawal fee in basis points.
stBTC exchange-rate data (data-stbtc-v1)other on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.data-stbtc-v1
read get-sbtc-per-stbtc()
sBTC (sats) per one stBTC, scaled by 1e8 (e.g. u100489172 = 1.00489 sBTC per stBTC at research time). Rounded down.
read get-sbtc-per-stbtc-up()
Same, rounded up; the value deposit() divides by.
stBTC tokentoken on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stbtc-token
read get-balance(account principal)
stBTC balance (8 decimals). Value-accruing against sBTC.
write transfer(amount uint, sender principal, recipient principal, memo (optional (buff 34)))
SIP-010 transfer.
stSTX <> stSTXbtc swap (swap-ststx-ststxbtc-v4)exchange on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.swap-ststx-ststxbtc-v4
write swap-ststx-for-ststxbtc(ststx-amount uint, min-out uint)
Instant, fee-free switch of micro-stSTX into stSTXbtc at the data-stx-v2 ratio. Reverts if output < min-out or the reserve lacks liquidity in that direction.
write swap-ststxbtc-for-ststx(ststxbtc-amount uint, min-out uint)
Reverse switch of stSTXbtc into stSTX; same slippage and liquidity rules.
stSTX withdrawal NFT (ststx-withdraw-nft-v4)other on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststx-withdraw-nft-v4
read get-owner(token-id uint)
Owner of a withdrawal NFT. Only the owner can call core withdraw(nft-id).
read get-last-token-id()
Last minted NFT id.
stSTX withdrawal records (withdraw-data-stx-v2)other on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.withdraw-data-stx-v2
read get-withdrawals-by-nft(nft-id uint)
Returns {unlock-burn-height, asset-amount (micro-STX), token-amount (micro-stSTX), withdraw-fee (bps)} for a withdrawal NFT; zeros if unknown or already claimed.
read get-withdraw-cooldown-blocks()
Cooldown in Bitcoin blocks (u2100 at research time).
read get-withdraw-unlock-burn-height()
Unlock height a withdrawal started now would get (burn-block-height + cooldown).
Native STX staking pool (native-pool-v1)staking on stacksSP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.native-pool-v1
write delegate(signer-manager <signer-manager-trait>, amount-ustx uint, num-cycles uint)
Non-custodial native stacking: stakes amount-ustx of your own STX via PoX-5 with StackingDAO's native-pool signer manager (pass SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.native-pool-signer-manager; any other reverts err u36002) for num-cycles. STX stays locked in your wallet; no liquid token. Rewards in BTC/sBTC; 5% fee per docs FAQ.
write delegate-update(signer-manager <signer-manager-trait>, old-signer-manager <signer-manager-trait>, cycles-to-extend uint, amount-increase uint, signer-calldata (optional (buff 500)))
Extend or increase an existing native stake.
write undelegate(old-signer-manager <signer-manager-trait>)
Unstake from the native pool via PoX-5 unstake (STX unlocks per PoX rules).
read is-delegating(staker principal, sm principal)
Transient flag used during delegate calls; not a reliable 'is staked' indicator.
read current-cycle()
Current PoX reward cycle.