Unstake
Last updated
Last updated
To withdraw your ether from the vault, you need to use the exit queue module.
1. Enter to the exit queue
First you need to lock assets in the exit queue. The shares to assets rate will be locked at the moment of the call.
Parameters
Name | Type | Description |
---|---|---|
Return Values
Name | Type | Description |
---|---|---|
2. Claim assets
Claims assets that were withdrawn by the Vault. It can be called only after the enterExitQueue
call by the receiver
.
Parameters
Return Values
You can fetch current vault exit requests from the Stakewise Graph service.
Return Values
null
- request has not been processed yet
0 - ether can be claimed from the vault
int
- UTC Unix timestamp, the time when Ether will be available for claim.
Check detail in the Withdrawal timestamp calculation section
The withdrawal timestamp is an estimated time when Ether can be claimed. It isn't taken from contracts directly but is periodically calculated by the StakeWise backend service.
Ether withdrawal is initially taken from the free ether in the vault:
Ether that is not yet locked in validators.
New deposits are first used to cover the exit queue, and then for registration of new validators.
If this ether is insufficient, ether withdrawal from active validators in the vault is initiated. The exit of validators is triggered by the Stakewise oracle network.
To calculate the time for ether to be withdrawn from validators:
Fetch validators with status ACTIVE_EXITING or higher.
Iterate through them until enough ether has been accumulated.
Use validator's withdrawable epoch considering current network withdrawals queue length.
The vault may not have sufficient free funds, or there might be less than needed to initiate validator withdrawal. In such cases, use an average time based on rewards accumulation:
10.5 days for Mainnet
One month for Holesky
In any case, there is a delay of 24 hours after entering the Exit Queue before claiming can occur.
Exit Request Withdrawal Timestamp Processing
New requests are processed after block finalization (approximately 15 minutes for Mainnet).
The queue is recalculated every hour as new deposits may speed up request processing.
The official Javascript SDK designed for effortless data retrieval from the StakeWise platform. This SDK provides a streamlined interface over GraphQL requests and contract interactions.
Check Exit requests sections
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Description |
---|---|
shares
uint256
The number of shares to exit
receiver
address
The address that will receive assets upon withdrawal
positionTicket
uint256
The position ticket of the exit queue
positionTicket
uint256
The exit queue ticket received after the enterExitQueue
call
timestamp
uint256
The timestamp when the assets entered the exit queue
exitQueueIndex
uint256
The exit queue index at which the shares were burned. It can be looked up by calling getExitQueueIndex
. Only relevant for V1 positions, otherwise pass 0.
positionTicket
uint256
The position ticket of the exit queue
id
The exit request id. Concatenation of the vault address and position ticket
receiver
The address that will receive assets upon withdrawal
positionTicket
The position ticket of the exit queue
timestamp
The timestamp when the assets entered the exit queue
totalShares
The number of shares that claimed in request. Used only in V1 vaults
totalAssets
The number of assets that claimed in request. Used only in V2 vaults
withdrawalTimestamp
Approximate time when Ether will be available for claim.
owner
The address that owns the shares
vault
The vault address