Redeem Calculations
The redemption process in Vesto allows users to convert their derivative tokens back into the underlying collateral assets. This document explains the mathematical calculations involved in redemption, including how yield is accounted for and how the protocol ensures fair distribution of assets.
Basic Redemption Formula
When redeeming derivative tokens, the required amount of each collateral asset to be returned is calculated using the same nominal units that were used during minting:
Where:
- = Amount of collateral token
i
to be returned - = Amount of derivative tokens being redeemed
- = Nominal unit for asset
i
- = Precision factor (PRECISION constant in the contract)
Note: This is the same formula used to obtain requiredAmounts
during the minting process.
Yield-Adjusted Redemption
A key feature of Vesto is that collateral assets may accrue yield while locked in the protocol. The redemption process accounts for this yield, potentially returning more of each asset than was originally provided.
The VestoStrategy contract tracks user positions using a share-based accounting system:
Where:
- = Actual amount of tokens to return for asset
i
(including yield) - = User's shares for asset
i
being redeemed - = Total amount of asset
i
in the strategy (including yield) - = Total shares issued for asset
i
Share Calculation
When a user provides collateral, they receive shares proportional to their contribution:
During redemption, these shares are converted back to the appropriate asset amount including any yield:
Fee Calculation
Vesto applies a withdrawal fee when users redeem their derivative tokens. This fee is calculated as:
Where:
- = Fee amount for asset i
- = Fee percentage (5e15 or 0.5% in the contract)
- = 1e18 (precision factor)
- = Final amount of asset i returned to the user
Note: This fee is currently 0.5% but may vary depending on the derivative token in question.
Practical Examples
Example 1: Basic Redemption
Consider a derivative pool with two assets: WETH and USDC.
- Nominal units for WETH: 0.0002 × 10¹⁸
- Nominal units for USDC: 0.4 × 10⁶
- User wants to redeem 100 derivative tokens
Required WETH to return:
Required USDC to return:
Example 2: Yield-Adjusted Redemption
Continuing from Example 1, assume:
- User has 100 shares for both WETH and USDC
- Total shares for WETH: 200
- Total shares for USDC: 200
- Total WETH in strategy (including yield): 0.042 WETH
- Total USDC in strategy (including yield): 84 USDC
WETH to return with yield:
USDC to return with yield:
Example 3: Fee Calculation
From Example 2, calculate the final amount after fees:
WETH fee:
WETH after fee:
USDC fee:
USDC after fee:
Protocol Implementation Flow
The redemption process flows through multiple contracts:
- User calls
redeem
on the VestoPool contract - VestoPool burns the derivative tokens
- For each collateral asset:
- VestoPool calculates the required amount
- VestoPool calls
redeem
on the VestoStrategy contract - VestoStrategy calculates shares and yield-adjusted amounts
- VestoStrategy applies the withdrawal fee
- VestoStrategy returns the assets to the user
This structure ensures that users receive their fair share of the collateral assets plus any yield generated while their assets were in the protocol, minus the applicable withdrawal fee. The burn-first approach ensures that derivative tokens are properly removed from circulation before assets are released, maintaining the protocol's collateralization ratio.