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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Highlights
Prevents repeated sell-share over-cashout by projecting the user's post-sale position before both quote and settlement.
Keeps the public API contract unchanged: unsafe sell attempts continue to use the existing 422 INSUFFICIENT_SHARES path.
Keeps quote behavior aligned with settlement by applying the same projection invariant to /v0/sell/quote and /v0/sell.
Preserves dust semantics: gross saleValue reduces position value, only netProceeds are credited to the user, and retained dust stays in market accounting.
Ensures rejected over-cashout attempts do not mutate balance, position, market dust, market volume, or the sell ledger.
Testing and Coverage
Added backend regression tests for valid dust sells, full-position sells, unsafe projected sells, and the reported buy/sell replay.
Added transaction-scoped repository coverage for sell projection.
Added executable HTTP integration coverage in integrationtest/scripts/sell-shares-overcashout.mjs, with a matching case document under integrationtest/cases/.
Other Changes Since v3.5.2
Traffic badge update workflow now opens pull requests instead of attempting to push directly to protected main.
README traffic badge metrics were refreshed through protected-branch PRs.