Skip to content

Redemption

Users exit a Dew Vault by redeeming shares for assets.
The vault supports:

  • Sync redeem – immediate withdrawal (subject to limits & liquidity).
  • Async redeem – queued request with price lock and later settlement via Teller.

Withdrawals need to specify:

  • asset – which asset you want to receive.
  • shares – how many shares to redeem.
  • min_asset_amount – slippage guard (minimum net amount after fees).

Sync Redeem

Sync redeem is used when:

  • Requested amount is within max_sync_redeem.
  • Vault has enough available_amount[asset] to pay out immediately.
  • Users want instant settlement.

The flow for sync redeem is as follows:

  1. User calls redeem.
  2. Vault checks:
    • Not emergency-paused.
    • Caller's share balance ≥ shares.
    • Asset is in available_redeem_assets.
    • Access control (whitelist / blacklist).
    • Share price freshness and deviation constraints.
    • Shares ≤ max_sync_redeem (if configured).
    • Withdrawal flow cap (rolling window) will not be exceeded.
  3. Vault calculates asset amount based on current share price.
  4. After validation, Vault burns shares from user and transfers asset to user immediately.

Async Redeem

Async redeem is used when:

  • Users need to withdraw amounts that might exceed sync limits.
  • There's currently insufficient liquidity for sync redeem.

The flow for async redeem is as follows:

  1. User calls request_redeem.
  2. Vault check and validates state and parameters similar to sync redeem.
  3. Shares are burned immediately and vault creates a pending redeem request in the teller state and returns a operation_id.
  4. Later, operators (or Dew Kernel / agents) confirm pending redeems via dew_vault_confirm_pending_redeems. This lock in the share price at request time and calculates the asset amount.
  5. Once the strategist has raised enough liquidity. They can transfer the assets to the vault with attached message to mark redeem requests as processed.
  6. Users can then call claim_assets to receive their assets.

NOTE: Users can cancel their own queued redeem requests before they are processed via cancel_request_redeem.