Unstaking & Withdrawals
The unstaking process is a three-stage process:
user requests an exit or unstake (user tx)
exit request is processed and ETH is sourced to pay for the exit
user claims exited ETH (user tx)
When user request an exit, they burn their shares (receipt tokens in their wallet) in exchange for one or exit queue tickets.
These tickets have a status based on wether or not they can be claimed (user is able to claim their ETH), which depends on the liquidity provided to the exit queues by the vPools.
You can find more details about tickets and casks here.
How to initiate an unstake request
Used to request an exit (unstake) of any amount of ETH, up to the maximum user balance.
When initiating an exit, you must specify the quantity of integration tokens to exit. Subsequently, the integration contract will generate one or several tickets in the associated vPool exit queues.
This can only be executed by calling a smart contract method:
Get the status of all exit queue tickets for a user
Used to retrieve all exit queue tickets for a user, providing the status of each ticket. This information enables you to inform the user about the availability of their exited ETH for claiming. Additionally, you have the option to permit users to claim a portion of their exit request if it is partially fulfilled, with the ability to claim the remainder once it becomes available.
Using The Graph
Query
Example results
Here you will retrieve all the different exit tickets of an account.
ticketId
is the id of the ticket, and also the id of the NFT representing this ticketsize
is the size of the ticket in vPool Shares (not ETH !)maxExitable
is the maximum amount of eth that can be retrieved by the ticket. Shares locked inside tickets are not earning rewards anymore.fulfillableAmount
is the amount of vPool shares that are currently fulfillablefulfillableBy
is a list of casks that fulfill a ticketexitQueue.address
is the address of the exit queue contract where the ticket is held
To retrieve the status of the ticket, it's pretty simple:
unfulfillable
whenfulfillableAmount
is 0partially fulfillable
whenfulfillableAmount
<size
fulfillable
whenfulfillableAmount
=size
Claim tickets once their fulfillable
Used to claim the ETH of a user who has requested to exit the pool.
You can use TheGraph query above to retrieve all the required information. In the case where we would want to claim all the tickets from the example query above (assuming we would have a new cask with id 1
that fulfills all the tickets), the transaction would look like
You must pass only one cask ID per ticket, if the ticket is matched by more than one cask, pass the lowest cask id and the code will automatically claim on all the casks matching the ticket
Last updated