# Potential yield pools / Ukraine design Design goal: - Let people delegate their funds (stables/ETH) and donate the yield - Plug into as many yield sources w/ sufficient TVL - Something like [https://rdai.money/](https://rdai.money/), more flexible Proposed Architecture: accept arbitrary token -> swap for stablecoin -> tokenize stablecoin 1:1 -> deposit stablecoin into vault -> yToken held by proxy -> bot harvests yield and sends to donation add For ETH, BTC and stables - Yearn vaults - DAI, 2.35%, 360M TVL - [https://yearn.finance/#/vault/0xdA816459F1AB5631232FE5e97a05BBBb94970c95](https://yearn.finance/#/vault/0xdA816459F1AB5631232FE5e97a05BBBb94970c95) - USDC, 2.48%, 348M TVL - [https://yearn.finance/#/vault/0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE](https://yearn.finance/#/vault/0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE) - USDT, 2.36%, 106M TVL - [https://yearn.finance/#/vault/0x7Da96a3891Add058AdA2E826306D812C638D87a7](https://yearn.finance/#/vault/0x7Da96a3891Add058AdA2E826306D812C638D87a7) - Curve stETH, 4.26%, 531M TVL - [https://yearn.finance/#/vault/0xdCD90C7f6324cfa40d7169ef80b12031770B4325](https://yearn.finance/#/vault/0xdCD90C7f6324cfa40d7169ef80b12031770B4325) - WBTC, 2.49%, 57M TVL - [https://yearn.finance/#/vault/0xA696a63cc78DfFa1a63E9E50587C197387FF6C7E](https://yearn.finance/#/vault/0xA696a63cc78DfFa1a63E9E50587C197387FF6C7E) - Curve 3Crypto (BTC/USDT/ETH pool), 7.5%, 12M TVL - [https://yearn.finance/#/vault/0xE537B5cc158EB71037D4125BDD7538421981E6AA](https://yearn.finance/#/vault/0xE537B5cc158EB71037D4125BDD7538421981E6AA) - Convex/curve (by size) [https://www.convexfinance.com/stake](https://www.convexfinance.com/stake) ![](https://i.imgur.com/xNAFUVo.png) Yearn vault integration flow: - User deposits stables into a proxy contract, can withdraw at anytime - Proxy contract deposits into yearn, holds yTokens on behalf - Every X hours, a public function which harvests the yield so far (after converting into ETH?) into a pre-defined EOA Proxy contract design notes: * Yearn vault docs: https://docs.yearn.finance/vaults/smart-contracts/VaultAPI Zaps: Yearn Zap In: https://etherscan.io/address/0x92Be6ADB6a12Da0CA607F9d87DB2F9978cD6ec3E Yearn Zap Out: https://etherscan.io/address/0xd6b88257e91e4E4D4E990B3A858c849EF2DFdE8c Deposit Contract Specification: Deposit: Convert sellToken into stablecoin -> tokenize stablecoin 1:1 -> Zap into Yearn vault -> send 1:1 token back to user -> retain yToken in deposit contract Withdraw: Transfer 1:1 token from user to deposit contract -> burn 1:1 token -> compute quantity of stablecoin owed -> withdraw stablecoin from vault -> transfer stablecoin to user Harvest: # Testing Goals Unit Testing - TBD Integration Testing - TBD End to End Testing - TBD Scenario Testing: - Infra setup: forked mainnet - Gotcha: need consistent 0x calldata to pass in, maybe past calldata? - Tests: - arbitrary tokens being swapped - eth being swapped - token swap to stables - stable coin vault - eth swap to stable - stable coin flow through - other coin to stable - eth vault - stable swap to eth - eth flow through - other coins to eth - withdrawls - stable token, and eth - harvesting - actually transfers to donation - if user deposits, yield accrues, harvested, user gets same amount back - ensure that the contract works as expected if someone send vault tokens to it directly - Smocks Needed - Contracts Interacted With - Yearn Vaults