Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion aave-core/sources/aave-logic/supply_logic.move
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ module aave_pool::supply_logic {
// update pool state
pool_logic::update_state(reserve_data, &mut reserve_cache);

// Note: Use ray_mul_down for conservative withdrawal balance calculation
// Ensures user cannot withdraw more than their actual balance
// Consistent with a_token_factory::balance_of behavior
let user_balance =
wad_ray_math::ray_mul(
wad_ray_math::ray_mul_down(
a_token_factory::scaled_balance_of(account_address, a_token_address),
pool_logic::get_next_liquidity_index(&reserve_cache)
);
Expand Down
Loading