Vault Wrapper
Last updated
Was this helpful?
Last updated
Was this helpful?
If you would like to offer existing IPOR Vault to your customers and be compensated by charging fees, you can use a Vault Wrapper.
Plasma Vault Wrapper allows to charge fees on top of existing vaults and is compatible with every vault that allows for instant withdraw.
You can find ready contract here:
With a corresponding test file:
Identify the address of the vault you want to wrap. It can be found on the vault page on the https://app.ipor.io website.
Select the WrapperName
(ERC20 standard)
Select the Ticker
(ERC20 standard)
Appoint feeAccount - address that will claim the fees
select feePercentage
for both performance and management fees
Fee is defined with 2 decimal places (10000 = 100%)
Contract hard caps the fee at 5% for management and 50% on performance
Construct the vault:
Wrapper itself is a ERC4626 vault and emits it's own shares. Those shares are minted and burned along the shares of underlying vault.
The Interface allows to define amount of underlying asset to be deposited:
or number of shares to be minted:
Likewise, to exit the position, user can either appoint amount of underlying asset to be withdrawn:
or number of shares to be redeemed:
As the vault accrue interest, the price of the share accounted in the underlying token changes.
It's important to know that the exchange rate is not updated constantly but rather with every rebalance the amount off assets held in a particular market is updated.
If you would like to simulate the exchange as if the balance was updated you can manually recalculate the cache by dry running update markets and convertToAssets
inside of the multicall. Below you can find an example how to do it using JavaScript;
The deployer of the contract becomes the owner automatically. The owner can run the administrative actions, like changing fees or transferring ownership to another account.
The address appointed as feeAccount will receive fees as shares in the vault. Those shares can be redeemed for the underlying asset of the vault. Simply run theredeem/withdraw
function.
The ownership of the wrapper can be made by executing 2-step transfer process:
And as a new owner
You can change the account that can claim fees along with setting the fee rate.