Boring Queue UI Integration
Facilitates user withdrawal requests from vaults, fulfilled by external parties at a discount.
Introduction
When a user submits their withdraw intent on chain, they need to sign to allow a permit, and submit a withdraw transaction. Once submitted, the tokens leave their wallet and go to the queue. Once fulfilled, the requested assets out will be sent back to their account directly with no action required on their part. If a request is cancelled before fulfillment, the vault tokens will get sent back to the user in the same cancellation tx.
-
API ->
https://api.sevenseas.capital/boringQueue/<network>/<vault_address>/<user_address>?string_values=true
requestOnChainWithdrawWithPermit
Transaction example:
https://etherscan.io/tx/0x1eb6b6cea02c973eee025c69236057207c4688532cc4b541147a725d5f45af2a
Inputs
- assetOut (string): the address of the token
- amountOfShares (uint128): the amount of shares the user wants to withdraw in the base denom of the vault
- discount (uint16): the discount to apply to the withdraw in bps adjusted to 5 decimals (e.g. 1% = 10000)
- secondsToDeadline (uint24): the time in seconds the request is valid for after it is available to solve
- permitDeadline (uint256): the unix second deadline at which the permit expires
Recommendations
- Set all inputs as strings to prevent any rounding issues
- Set permitDeadline to the current unix time +
secondsToDeadline
- The withdraw time for each withdraw asset can vary. Query
withdrawAssets(assetOut)
to get the withdraw info for that assetsecondsToMaturity
the amount of time it takes for the withdraw to be claimed/solvedminimumSecondsToDeadline
the minimumsecondsToDeadline
a user can specify. This is the amount of time aftersecondsToMaturity
that the request is solvable for.- If the withdraw has not been claimed/solved within that time, the request is expired and will need to be requeued.
Example
cancelOnChainWithdraw
Transaction example:
https://etherscan.io/tx/0x2e93fb4668587768714d341683cc9f8b698955366f17417adfcd28f2f59f394e
Inputs
- request (tuple)
- nonce (uint96): unique identifier
- user (string): users address to cancel withdraw for
- assetOut (string): the address of the token being withdrawn
- amountOfShares (uint128): number of shares being withdrawn in the base denom
- amountOfAssets (uint128 ): the number of assets to be received by the user
- creationTime (uint40): timestamp the request was created
- secondsToMaturity (uint24): the seconds until the request becomes mature
- secondsToDeadline (uint24): the seconds until the request expires and becomes invalid
Recommendations
- Grab all relevant input data from the API open_requests “metadata” field for the relevant request the user wants to cancel to submit the tx.