You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(supply-logic): use ray_mul_down for withdraw balance calculation
Apply directional rounding for conservative withdrawal balance calculation.
Changes:
- Calculate user_balance using ray_mul_down instead of ray_mul in withdraw function
- Modified: supply_logic.move line 199-206
Rationale:
- User withdrawal balance should never be overestimated for protocol safety
- Conservative calculation prevents users from withdrawing more than actual balance
- Consistent with a_token_factory::balance_of behavior
- Aligns with Solidity Aave V3 implementation pattern
Impact:
- Withdrawal balance calculations become more conservative
- User may need to query real-time balance for complete withdrawal
- Better protection against over-withdrawal scenarios
- Consistent with balance_of external API behavior
0 commit comments