Stacking DAO Core V2
Stacking DAO Core V2 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: https://explorer.hiro.so/txid/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v2?chain=mainnet
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:
Deposit
The deposit method can be initiated using the deposit
method on the SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v2
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-v1`
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-v1`
stx-amount
- a positive integer value for the uSTX (micro-STX, 10^6) amount you want to stack and getstSTX
in return for. For example, passing1000000
will stack 1 STX.referrer
- an optional Stacks address, this accumulates referral points on the leaderboardpool
- should be set tonone
for now
Initiate Withdrawal
When withdrawing, users can follow a two-step process, see https://docs.stackingdao.com/stackingdao/the-stacking-dao-app/withdrawing-stx 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-v1`
ststx-amount
- a positive integer value for the ustSTX (micro-stSTX, 10^6) amount you want to unstack and getSTX
in return for. For example, passing1000000
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).
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-v1`
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 theinit-withdraw
method previously.
After the withdrawal succeeds, the STX principal and yield amounts will be returned to the transaction sender's wallet.
Last updated