What is Meta-Pool and other non-Technical Documentation
- BlockSec Audit v1.1, March 1th, 2022
- BlockSec Audit, staking wNEAR with Meta Pool on Aurora, March 20th, 2022
This is the Smart Contract repository. The Web App UI is at https://github.com/Narwallets/metastaking-webapp
- Added active rebalance, to supoprt vote.metapool.app
- NEAR gas computation will change, fix gas computation on dao upgrade instruction
- All audit recommendations implemented
- set all staking pools weights in a single call
- new fn Realize_meta_massive to auto farm $META
- Full functionality
- Simplified user flow
- Desk check testing https://github.com/Narwallets/sc-desk-check-parser
- Initial version based on core-contracts/lockup and core-contracts/staking-pool
- Deposit, withdraw
- Distributed stake/unstake
- NEAR/stNEAR liquidity pool, Add/Remove liquidity
- META Minting with rewards
- Deposit/withdraw
- Buy stNEAR/Stake
- Sell stNEAR/immediate unstake
- Classic unstake-wait-finish-unstake
- User trip-meter, measure rewards
- distribute staking/unstaking
- retrieve unstaked and ready
- NEAR/stNEAR Liquidity Pool, Add/Remove liquidity
- clearing mechanism on stake to restore liquidity in the NSLP
- act as a NEP-xxx MULTI-FUN-TOK (multi-token contract). Implement for NEAR, stNEAR and META
- Dividends-pool stNEAR/META
- Staking-loans to whitelisted validators
- Emergency Staking (from the nslp) to whitelisted validators
- Simulation tests
- Fuzzy Testing
- List selected staking pools, getting weight, staked & unstaked
- add a staking pool, set weight
- Mint and distribute META with rewards
- Phase II - Governing DAO
- External cron to call distribute()
- compute remaining epoch time
- whitelist pools before adding them
- USDNEAR MVP: Create a collateral-based stablecoin similar to Compound's DAI, using NEAR & stNEAR as collateral
All tests are are performed in a separate project with an ad-hoc fuzzy test for metapool.
The test generates random operations. We have a list of "invariants" the contract must satisfy to guarantee the internal accounting is consistent. We use a seeded random generator to create "operations" against the metapool (deposit, liquid-unstake, delayed-unstake, add-liquidity, remove-liquidity, compute-rewards, retrieve-funds-from-pools, rebalance) in any order and amount. After each successful operation we check the contract invariants again. This is our way to tests unprepared operations combinations and make sure the internal accounting remains consistent
The tests are located in the folder metapool/test