File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
aave-core/sources/aave-logic Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -765,9 +765,12 @@ module aave_pool::flashloan_logic {
765765 pool_logic::set_next_liquidity_index (&mut reserve_cache, next_liquidity_index);
766766
767767 // update accrued to treasury
768+ // Note: Use ray_div_down for conservative treasury accrual
769+ // Ensures protocol treasury doesn't accumulate optimistic amounts
770+ // Aligns with mint_to_treasury's conservative minting approach
768771 let new_reserve_accrued_to_treasury =
769772 reserve_accrued_to_treasury
770- + wad_ray_math::ray_div (premium_to_protocol, next_liquidity_index);
773+ + wad_ray_math::ray_div_down (premium_to_protocol, next_liquidity_index);
771774 pool::set_reserve_accrued_to_treasury (
772775 reserve_data, new_reserve_accrued_to_treasury
773776 );
You can’t perform that action at this time.
0 commit comments