Minting & Redeeming
Minting and redeeming of Index DTFs
Minting & Redeeming
DTFs are always instantly exchangeable for a pro-rata share of their underlying assets through minting and redeeming. The mint()
and redeem()
functions can be called by anyone at any time.
Minting
function mint(uint256 shares, address receiver, uint256 minSharesOut) returns (address[] memory _assets, uint256[] memory _amounts);
Solidity Code: Folio.mint()
Be sure to approve each asset to the DTF before minting.
Inputs
shares
Number of shares to mintreceiver
The address to receive the minted sharesminSharesOut
Minimum amount of shares the caller must receive after fees
Outputs
_assets
Array of addresses for each asset sent to the DTF_amounts
Array of amounts of each asset used to mint the DTF
Redeeming
function redeem(uint256 shares, address receiver, address[] calldata assets, uint256[] calldata minAmountsOut) returns (uint256[] memory _amounts);
Solidity Code: Folio.redeem()
Inputs
shares
Number of shares to redeemreceiver
The address to receive the redeemed assetsassets
Assets to receive, must match basket exactlyminAmountsOut
Minimum amount of each asset to receive
Outputs
_amounts
Actual amounts transferred of each asset
Zapper
In order to make life easier for users, ABC Labs provides use of a Zapper via the Reserve App UI. Users can zap from a single token into a DTF and vice versa. The Zapper will route the input token through DeFi and into the DTF. The Zapper will also intelligently choose to purhcase the DTF directly from the market if it is more efficient than collecting the underlying.
When minting via the Zapper, it is common to receive dust amounts of certain tokens due to DEX volatility. Generally, the amount of dust is on the order of 1-10bps of the input value.