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
sharesNumber of shares to mintreceiverThe address to receive the minted sharesminSharesOutMinimum amount of shares the caller must receive after fees
Outputs
_assetsArray of addresses for each asset sent to the DTF_amountsArray 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
sharesNumber of shares to redeemreceiverThe address to receive the redeemed assetsassetsAssets to receive, must match basket exactlyminAmountsOutMinimum amount of each asset to receive
Outputs
_amountsActual 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.