DoHardWork (DHW) Implementation

Do Hard Work will run periodically to deposit/withdraw user funds, and collect or compound yield and is executed for every strategy.

Ideally, the strategies are batched together and executed in the fewest transactions possible. Spool V2 supports asynchronous DHW, meaning that DHW for one strategy can be run multiple times without having to wait for another strategy to be finished.

This increases the efficiency of the system, as we only need to run DHW on the strategies that require it.

Every time DHW is run on a strategy its index increments by 1 and the strategy index allows us to track user deposits or withdrawals for a specific DHW, so we can apply exact slippages to the user.

Please note, a Vault containing multiple Strategies will require DHW to run for all the relevant Strategies, and the Vault Flush is required to help calculate and distribute Yield.

100% utilized lending/borrowing

Do Hard Work actions will support partial withdrawals from a strategy if the underlying protocol does not allow users to withdraw all the desired funds.

This may happen if the lending/borrowing protocol is 100% utilized which will “block” users from exiting the protocol, but allow a slow exit when the utilization goes down.

As the strategies in the DHW can be executed asynchronously, this does not block the whole system but only part of the specific strategy.

Last updated