StackingDAO
StackingDAO
StackingDAO
  • The basics
    • Stacking DAO Overview
    • The Importance of Liquid Stacking
    • Immediate and Continuous Yield with Stacking DAO
    • Points
  • The Stacking DAO app
    • stSTX - Liquid Stacking with STX Rewards
      • stSTX Basics
      • Depositing & Switching for stSTX
      • Withdrawing from stSTX
    • stSTXbtc - Liquid Stacking with BTC rewards
      • stSTXbtc Basics
      • Depositing & Switching for stSTXbtc
      • Withdrawing from stSTXbtc
      • stSTXbtc Transfers Issues
    • Native Stacking with BTC Yield
      • Native Stacking with BTC Yield Basics
      • Depositing STX in Native Stacking Pool
      • Withdrawing STX From Native Stacking Pool
    • Signer Delegations & Analytics
    • What are the risks of using Stacking DAO?
    • Frequently Asked Questions
  • Core Contracts
    • Stacking DAO Core V4
    • Signer Onboarding
  • Audits
  • Miscellaneous
    • Essential links
    • Restricted countries
    • Disclaimer
Powered by GitBook
On this page
  1. Core Contracts

Stacking DAO Core V4

PreviousFrequently Asked QuestionsNextSigner Onboarding

Last updated 3 months ago

Stacking DAO Core V4 is the main entry point for all user-related actions such as depositing and withdrawing STX, looking up the stSTX/STX ratio or a withdrawal NFT position of a user.

The contract can be found here:

Integrations

For wallets, CEXes and other protocols who want to integrate the Stacking DAO deposit/withdrawal logic, there are three important methods to take into account:

  1. Deposit

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

This contract expects the following parameters

  • reserve-contract - this is the Stacking DAO reserve contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.reserve-v1`

  • commission-contract - this is the Stacking DAO commission contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.commission-v2`

  • staking-contract - this is the Stacking DAO staking contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.staking-v0`

  • direct-helpers - this is the Stacking DAO direct helpers contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.direct-helpers-v2`

  • stx-amount - a positive integer value for the uSTX (micro-STX, 10^6) amount you want to stack and get stSTX in return for. For example, passing 1000000 will stack 1 STX.

  • referrer - an optional Stacks address, this accumulates referral points on the leaderboard

  • pool - should be set to none for now

  1. Initiate Withdrawal

When withdrawing, users can follow a two-step process, see for more information.

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

  • reserve-contract - this is the Stacking DAO reserve contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.reserve-v1`

  • direct-helpers - this is the Stacking DAO direct helpers contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.direct-helpers-v2`

  • ststx-amount - a positive integer value for the ustSTX (micro-stSTX, 10^6) amount you want to unstack and get STX in return for. For example, passing 1000000 will unstack 1 stSTX.

When this call succeeds, the user will receive an NFT that represents their unstacking position and indicates the amount of STX they should receive after a given PoX cycle ends (this is always principal + yield).

  1. Withdrawal

Finally, once the PoX cycle ends after a given init-withdrawal call (but always before the last 288 blocks of a given cycle), the STX principal + yield can be withdrawn from Stacking DAO.

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

  • reserve-contract - this is the Stacking DAO reserve contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.reserve-v1`

  • commission-contract - this is the Stacking DAO commission contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.commission-v2`

  • staking-contract - this is the Stacking DAO staking contract, and should always be set to `SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.staking-v0`

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

After the withdrawal succeeds, the STX principal and yield amounts will be returned to the transaction sender's wallet.

https://explorer.hiro.so/txid/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v4?chain=mainnet
https://docs.stackingdao.com/stackingdao/the-stacking-dao-app/withdrawing-stx