Add strategy. Once a strategy is added it can call rebalance and borrow funds from pool and invest those funds in provider/lender.
Recalculate pool level external deposit fee after all state variables are updated.
Pool fund allocation to this strategy
External deposit fee of strategy
OnlyPool:: Helper function for V5 upgrade
Remove strategy and recalculate pool level external deposit fee.
Revoke and remove strategy from array. Update withdraw queue. Withdraw queue order should not change after remove. Strategy can be removed only after it has paid all debt. Use migrate strategy if debt is not paid and want to upgrade strategy.
Recalculate pool external deposit fee. It is calculated using debtRatio and external deposit fee of each strategy.
Whenever debtRatio changes recalculation is required. DebtRatio changes if strategy reports loss and in that case an off chain application can watch for it and take action accordingly. This function is gas heavy hence we do not want to call during reportLoss.
Update withdraw queue. Withdraw queue is list of strategy in the order in which funds should be withdrawn.
Pool always keep some buffer amount to satisfy withdrawal request, any withdrawal request higher than buffer will withdraw from withdraw queue. So withdrawQueue will be the first strategy where withdrawal request will be send.
yield generated by strategy. Strategy get performance fee on this amount
Reduce debt ,also reduce debtRatio, increase loss in record.
strategy willing to payback outstanding above debtLimit. no performance fee on this amount. when governance has reduced debtRatio of strategy, strategy will report profit and payback amount separately.
Get available credit limit of strategy. This is the amount strategy can borrow from pool
Available credit limit is calculated based on current debt of pool and strategy, current debt limit of pool and strategy. credit available = min(pool's debt limit, strategy's debt limit, max debt per rebalance) when some strategy do not pay back outstanding debt, this impact credit line of other strategy if totalDebt of pool >= debtLimit of pool