mstable / metavaults Goto Github PK
View Code? Open in Web Editor NEWmStable EIP-4626 Tokenized Vaults
License: GNU Affero General Public License v3.0
mStable EIP-4626 Tokenized Vaults
License: GNU Affero General Public License v3.0
calculate current assetsPerShare
to be consumed in asserPerShare watcher
Note: To be done after pausable
is implemented.
Actions: Add a unit-test scenario where assetPerShare
is dramatically reduced because underlyingVault is paused.
This will lead to not enough assets
revert invariant to trigger on redeem
call for PeriodicAllocationAbstractVault
.
Now that the metavaults repo is public, the packages can also be moved to a npm.
This applies for both the server-side and frontend packages published from the metavaults repository.
This should include changing the Defender repo to use the new public npm package.
The upgrade includes the following changes
removeVault
.PeriodicAllocationPerfFeeMetaVault
contract0x9614a4C61E45575b56c7e0251f63DCDe797d93C5
For Description go here: #29
Finding and implementing missing scenarios/tests for integration
Missing Scenarios
assetsPerShare
in _afterAddVault
hook for PeriodicAllocationAbstractVault
PerfFeesAbstractVault
PerdiodicAllocationPerfFeesMetaVault
update assetsPerShare
in following
PerfFeeAbstractVault
behavior in PerdiodicAllocationPerfFeesMetaVault
Scenario analysis remaining for Convex3CrvLiquidatorVault
Donating small amounts of DAI back to the mUSD, FRAX and BUSD vaults is very expensive. For example, it cost 3,264,357 gas (70 USD) to donate 63 DAI back to the mUSD, FRAX and BUSD vaults. https://etherscan.io/tx/0xfb0042c2425a27f4705fc76b1810be015c2d4bf43565f5e3c66a1c78255c054a
Normally this will be held back until there is a significant reward but last week we ran through the liquidation cycle for testing purposes. It's also worth considering that if rewards are not streaming then the APY will close to 0.
The donate
function will convert DAI/USDC/USDT to 3Crv using the 3Pool, but will not add liquidity to the Curve Metapool and deposit the Metapool LP token to the Convex pool. This will be delayed until the next mint or deposit.
The 3Crv can sit in the vault but have no impact on the assets per share. This is effectively an unrealised gain like accrued rewards.
The next time a mint or deposit is done, it will check if the vault has a 3Crv balance. This balance will be added to the mint/deposit 3Crv that is added to the Metapool and LP deposited to the Convex pool. The resulting shares will be proportionally split between the minter/depositor and the vault. The existing streaming process will then work to burn the vault shares over the next week.
Bring the fraxBP vaults here and update to latest codebase.
add _afterRemoveVault
hook to SameAssetsUnderlyingAbstractVault
that will be utilized by PeriodicAllocationAbstractVault
to update assetsPerShare
after an underlying vault is removed.
Describe the bug
assetPerShare should be updated after rebalance
in PeriodicAllocationAbstractVault
and after performanceFees has been charged for PeriodicAllocationPerfFeeMetaVault
Issue: totalUnderlyingAssets < requiredAssets
will lead to significant less assets returned to user in redeem
call for PeriodicAllocationAbstractVault
Code changes for PR:
redeem
_convertToAssets
call for mint/redeem
assetsWithdrawn > vaultBalance
for redeem
Describe the bug
Liquidator is unable to re-try CRV async swaps, as CRV reverts while increasing the allowance when previous allowance is not zero
IERC20(rewardToken).safeIncreaseAllowance(address(asyncSwapper), rewards);
CRV Approve Token has the following restrictions :
@notice Approve `_spender` to transfer `_value` tokens on behalf of `msg.sender`
@dev Approval may only be from zero -> nonzero or from nonzero -> zero in order
to mitigate the potential race condition described here:
https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
File and line
A link to the line containing the bug.
To Reproduce
Steps to reproduce the behavior:
Liquidator.initiateSwap
with rewardToken
as CRV when the transfer
flag is false
yarn task liq-init-swap --from CRV --to DAI --transfer false
initiateSwap
with rewardToken
as CRV when the transfer
flag is false
or true
.Expected behavior
As the process is async , it cannot be guaranteed that initiateSwap
will be sucessful all the time , so it should be possible to re-try a swap order .
With the launch of the Meta Vault we should maintain good developer experience. https://developers.mstable.org/
Is your feature request related to a problem? Please describe.
The implementation of the OneInch Dex swapper is not fully implemented, only the smart contract is done.
Things to do :
the data structure of the SingleSlotMapper
can be complicated to understand as it uses bit operations against a single uint256 storage slot to map 62 index numbers to 4 bit values.
Adding a diagram of the structure to the README will help developers understand how this works.
Need to document what's in the @mstable/metavaults-web package including the JS utility functions.
SameAssetUnderlyingsAbstractVault.removeVault
currently calls SingleSlotMapper.removeValue
with the removedValue
parameter being the index of the _activeUnderlyingVaults
array.
It would be more gas efficient if SameAssetUnderlyingsAbstractVault.removeVault
called a new SingleSlotMapper.removeIndex
function padding in the vaultIndex
that is passed to the SameAssetUnderlyingsAbstractVault.removeVault
function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.