Stacking DAO Core V4
Last updated
Last updated
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:
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
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).
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.