delvtech / hyperdrive

An automated market maker for fixed and variable yield with on-demand terms.
Apache License 2.0
33 stars 4 forks source link

Implement a pass-through ERC4626 vault that allows Morpho rewards to be collected #714

Closed jalextowle closed 10 months ago

jalextowle commented 11 months ago

Historically, we've had functionality to collect rewards on a protocol-by-protocol level using the sweep function and a set of pre-configured sweepTargets. This increased the scope governance's responsibility and is incompatible with the recent changes made to the HyperdriveFactory.

Rather than having a sweep function, it would be better to simply use a custom ERC4626 vault that delegates all functionality to a target vault and has it's own sweep function that can sweep collected rewards to Hyperdrive's governance or fee collector. This architecture decreases Hyperdrive's attack surface and is a more flexible way of solving the problem.

jalextowle commented 10 months ago

We're not going to do this because the pass-through vault would add significant overhead.