GetUnite / investment-strategies

2 stars 1 forks source link

Balancer Strategy Interface + ETH Pool implementation #9

Closed 0xtuytuy closed 2 years ago

0xtuytuy commented 2 years ago

Summary

  1. Name: Balancer Strategy Interface
  2. About: Implementing the standard for investing funds into Balancer pools and its first implementation for an ETH pool

Is your proposal related to a problem?

No problem, just enabling the protocol

Describe the solution you'd like

To go along with the IbAlluoETH we need to enable the DAO to invest funds into ETH pools, at the same time, it would be ideal to add the ability for the DAO to have access to all the pools on Balancer.finance.

The Strategy should be able to invest and unwind strategies invested into Balancer pools.

The first implementation should be this pool: https://app.balancer.fi/#/pool/0x1e19cf2d73a72ef1332c882f20534b6519be0276000200000000000000000112

Balancer seems pretty standard, you are able to enter all Balancer pools via the Balancer vault here: https://etherscan.io/address/0xba12222222228d8ba445958a75a0704d566bf2c8#code

by simply calling joinPool() and passing the poolId. Ideally when executing the Votes, we should not need to know the actual pool ID and this should be stored somewhere by the VoteExecutor. Here is an example tx: https://etherscan.io/tx/0xff2f8c98075e68c6652a14fa7092227ad8a36396e493b5a0262fe79ab359d807

To get the max APY, on some pools, we need to have the option to stake the APY, the Strategy should be able to handle this as an input, here are the 2 tx to stake the ETH lp: https://etherscan.io/tx/0x0ecb9ca5f1600aca80fbdaef6a1ee91a1e0911c498e0f111edec7ad92f5a73fb https://etherscan.io/tx/0xc421fedd73cbc523ad53d7a349886ce2b482eda5ec2c0166ca5ad299b5e625a9

To unwind, we first need to unstake, then withdraw (WIP @0xtuytuy to update the tx on here), this will be linked to https://github.com/GetAlluo/alluo-exchange/issues/7 in the exchange repo where the strategy should also use Exchange.sol to convert the rETH into ETH directly.

Additional context

alexanderem49 commented 2 years ago

Executed in #10