Skip to content

Round down position availableBalance to avoid exceeding capacity#314

Merged
turbolent merged 1 commit into
v0from
jribbink/fix-balance-rounding
Apr 9, 2026
Merged

Round down position availableBalance to avoid exceeding capacity#314
turbolent merged 1 commit into
v0from
jribbink/fix-balance-rounding

Conversation

@jribbink

@jribbink jribbink commented Apr 9, 2026

Copy link
Copy Markdown

Description

By rounding the availableBalance of a position up, we will exceed the withdrawable capacity, which could be used by a caller. This PR changes the behaviour to always round down instead.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@jribbink jribbink requested a review from a team as a code owner April 9, 2026 19:33
@turbolent turbolent merged commit 519b6d0 into v0 Apr 9, 2026
1 check passed
@turbolent turbolent deleted the jribbink/fix-balance-rounding branch April 9, 2026 20:47
@turbolent

Copy link
Copy Markdown
Member

Sorry about the merge 🤦 I had confused this with my PR with a similar title. Please let me know if this should be reverted

@jribbink

jribbink commented Apr 9, 2026

Copy link
Copy Markdown
Author

Sorry about the merge 🤦 I had confused this with my PR with a similar title. Please let me know if this should be reverted

No worries!

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