Skip to content

Round down availableBalance to prevent health violation on max withdrawal#317

Open
jordanschalm wants to merge 5 commits intomainfrom
jord/available-balance-round-down
Open

Round down availableBalance to prevent health violation on max withdrawal#317
jordanschalm wants to merge 5 commits intomainfrom
jord/available-balance-round-down

Conversation

@jordanschalm
Copy link
Copy Markdown
Member

availableBalance was using toUFix64Round (round-half-up) to convert the UFix128 result of maxWithdraw to UFix64. This could return a value slightly above the true maximum, causing withdrawals of the full reported amount to fail with "Insufficient funds" due to breaching minHealth.

jordanschalm and others added 2 commits April 9, 2026 14:02
…awal

availableBalance was using toUFix64Round (round-half-up) to convert the
UFix128 result of maxWithdraw to UFix64. This could return a value slightly
above the true maximum, causing withdrawals of the full reported amount to
fail with "Insufficient funds" due to breaching minHealth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jordanschalm jordanschalm requested a review from a team as a code owner April 9, 2026 22:25
@jordanschalm jordanschalm requested a review from jribbink April 9, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants