Skip to content

Add withdrawFromStrategy and depositToStrategy methods to vault #937

@DanielVF

Description

@DanielVF

Problem

Current the strategists primary tool is reallocate which can move funds from one strategy to another. (The strategist can also move all funds from a strategy, or have all non allocated funds allocated to their default strategies.) There are a few problems:

  1. This is not always the most gas efficient or slippage way of moving funds. For example, if the strategist needs to move funds from Convex to both AAVE and Compound, this requires the gas expense of two withdraws from Convex, and possibly extra slippage.
  2. When funds are directly held by the vault rather than by a strategy, these funds have to be allocated to their default strategy first, then reallocated, which results in the funds being deposited then withdrawn from the default strategy and finally deposits into the target strategy. It's 3x as much gas as the job actually needs.
  3. The current reallocation setup is complicated to automate reallocation. If we can first withdraw from strategies/coin combos that have too much, and deposit to strategies/coin combos that need more, it gets much simpler.

Possible Solution

I'm thinking two new methods which would replace our vaultAdmin.rellocate():

withdrawFromStrategy(fromStrategy, [coins], [amounts]); - would move coins from one strategy to the vault.

depositToStrategy(toStrategy, [coins], [amounts]); - would move coins from the vault to one strategy.

Metadata

Metadata

Assignees

Labels

P2Small number of users are affected, major cosmetic issuecontractsWorks related to contractsenhancementNew feature or requestplannedIn-scope at the beginning of the sprint

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions