# Yearn V2/V3 split ### What can be done in V2? | Task | Description | Responsible| | -- | -- | -- | | ySwaps | Release ySwap to manage token dumping (DCA, OTC, ...) and other swaps | | | New risk profiles for vaults | Release IL strategies in a new vault in diferent website / section (deploy yvUSDC-IL + yvETH-IL) | | | Rebuild and standarize roles with current v2 schema | Reuse governance, guardian, strategist, keeper, and management to implement what we would like in V3 (even if the name does not make sense). This way we can test before implementing and avoid not-thought-of edge cases. |  | | Framework for decision making | Establish framework/rules about buffers, max debtRatio to strats, deploying new vaults, ... || | Deploy in Optimism | Adapt vault code to work with optimism using latest changes of Vyper to be OVM compatible | | | Create PoC of pull approach | Generalize the JointProvider strategy to support other usecases (like building a liquidity pool on top) | | | On-chain debt ratio decision | Create a contract that receives inputs about strategies' APR and allocates accordingly |  | | New accounting common system | Abstract Strategy.sol from accounting management. Implement in BaseStrategy functions | | | | yPortfolio's PoC | Create website and smart contract to deposit all tokens from 1 wallet a la yvEmpire || ### What questions do we need to solve before designing V3? - Yearn's future vision - what are we? - what do we "sell" (why does the user pay fees to us) ? what is our value proposition? - vision/wishlist in each of the categories below - Legal stuff: what are we under current regulation? what would we be under future (expected) regulation? how can we avoid being classified as regulated? - Fees - prog. language ------ ### Categories - YFI token - accounting - active vs passive investing - risk profiles - composability - migrations / updates - funds management - decision decentralisation - scalability - fees - mev - security + roles (+regulation?) - immutability - on/off-chain logic - other #### YFI token - CON: YFI plays no central role and holders don’t have active participation in the vault management or strategy decisions at the moment. #### accounting - CON: Accounting is Vault-version specific, upgrading accounting logic requires new Vault release - CON: Before healthcheck one single bug in a strategy could rekt the entire accounting of a vault - PRO: HealtCheck enable prevents accounting issues - #### active vs passive investing - CON: Inability to selectively invest in different strategies e.g. “halal” investing or avoiding riskier strats, relies on Yearn too much for management of allocations - PRO: No configurable behavior, “deposit and forget” - CON: User can’t claim the dumped reward if they wanted #### risk profiles - CON: risk profile (up-only) restricts strategies to yield farming / token dumping strategies - PRO: Doesn’t support IL strategies, is hard to implement Uniswap v3 strategies with the one token want limitation - #### composability - PRO: Yearn-vaults are composable! - PRO: composability! only-up vaults creates a good framework of assumptions to build on - CON: Integrators are always reimplementing the way to get the value of their shares in underlying instead of the vault providing a helper function to get this, accounting for profit lock, etc. #### migrations / updates - CON: Vault migrations take too much effort and time, plus they rely on the user to perform it (can be improved by abstracting ERC20 from accounting) - #### funds management - CON: When combining too many vaults/strategist harvest is complicated. Sandwich protection - PRO: Vault allows users to withdraw whenever they want - CON: Makes strategies maintain a buffer and sometimes the buffer is cleaned in one go by a whale forcing us out of positions - CON: In an emergency situation there’s no clear way to stop a malicious actor from withdrawing (no pause withdraws option), only resource is to remove all strats from queue - CON: there is no incentive to stay inside the vault for the long term / locking funds inside to ease longer term strategies - CON: When market changes or is down, strategies can’t switch to DCA strategy or change based on market conditions if they are up Only #### decision decentralisation #### scalability - CON: scalability depends on number of strategists and becoming a strategist is not simple. - #### fees - PRO: Zero withdrawal fees - PRO: Management Fees: YFI revenue - CON: Management Fees: less aligned with users - CON: Can’t change fees for partners or integrators to give better rates to specific accounts (is this taboo?) - CON: Can’t change fees to specific addresses like another vault, to avoid fee stacking easily. Current solution is delegated fees calculation which not sure is the simplest #### mev - CON: Strategies are not MEV resistant unless we use taichi or move towards yswap. MEV can eat profits on current system - #### security + roles (+regulation?) - CON: Some roles intersect in functionality and not sure guardian has yet been needed in practice - PRO: Granular roles allow flexibility on access functions and modifiers - CON: Governance can rug users without short notic (although can be mitigated via timelock but its a security choice/trade-off and may not be a vault design concern) - CON: centralization in the key roles for vault management make the system less automated and subject to crazy regulations? (asset managing boomer laws?) - CON: Emergency functions are tricky to get right with underlying strategies and can sometimes can be badly integrated in implemented strategies (affecting liquidation/accounting) - CON: Lack of health check when a user withdraws? maybe some assertions can be added to check if the user has withdrawn too much in short time frame or something is not right #### immutability - PRO: Immutable: trust - CON: Immutable: migrations - CON: Strategies are very mutable and users need to trust governance msig - PRO: Immutability means rugging users is hard - #### on/off-chain logic #### other - CON: Users can front run harvest/airdrops and withdraw after. Very hard stop leeching behaviour. - CON: No incentives for early adopters - PRO: Multi-strategy helps us manage strategy upgrades and diversify yield. Supported DAI at one time with 9 strategies on the top of bull run - CON: Can’t handle distribution of xsushi type snapshots fairly based on time contributed in vault + money - CON: Users might withdraw want but actually want something else. For example, user withdrawing susd with slippage to after trading susd for dai - PRO: Yearn is simple with single want - CON: Single want token support only limits some opportunities - PRO: simple concept easy to understand for users. doesn’t require them to understand underlying strats - CON: token dumping is “bad” for underlying protocols (and profitability?) and maybe it is not sustainable / can disappear in the medium/long-term - PRO: Not that simple for users that just have (any) USD and wants good yield when they don’t know about curve - PRO: Design is very modular and cohesive, has allowed flexible backported solutions to be added incrementally like HealthChecks - CON: Vyper needs audit and more features - PRO: Vyper has strong simple design and removes some security concerns from solidity + brings a moat for stopping forks - CON: Vyper needs L2 support for Optimism/zkEVM for vaults to operate in those Layer 2s (but this is in work!) - CON: Registry only works for one set of vaults (upOnly), if we decide to launch different vaults, it will need a new registry for each flavor of vault (Not CRITICAL) - PRO: Good event structure along with registry pattern has allowed indexing of subgraph to be a lot better compared to v1 - CON: Debt Based/Leveraged strategies are hard to unwind (although not sure is a concern of the vault design) - CON: I want to have a portfolio -> portfolio approach ### Implementation / new tech - new registry with several vaults per token - integrated healthcheck - ySwap (abstract swaps from Strategies) - split design into upgradeable modules (accounting, debt ratio management, fee management, ...) - Vyper vs solidity - separate deposit token from want token?