Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(margin): update qty_step nibble expectation for floor-before-4x (KI-31)#74

Merged
luisleo526 merged 1 commit into
mainfrom
test/ki31-margin-nibble-expectation
Jul 7, 2026
Merged

test(margin): update qty_step nibble expectation for floor-before-4x (KI-31)#74
luisleo526 merged 1 commit into
mainfrom
test/ki31-margin-nibble-expectation

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Fixes the CI failure introduced by #73. test_short_margin_call_qty_step asserted the old floor-after value (3.5); the engine now floors the restore qty to the lot step before the 4x over-liquidation (TV-validated, 19/19 alpha-wizard nibbles bit-exact), so the synthetic first lot is 4*floor(0.95238/0.5)*0.5 = 2.0. Test-only; ctest 79/79 locally with freshly-built binaries.

🤖 Generated with Claude Code

…(KI-31)

test_short_margin_call_qty_step asserted the old floor-AFTER value (first
forced lot 3.5 = floor(4*shortfall/step)*step). PR #73 corrected the engine to
floor the restore qty to the lot step BEFORE the 4x over-liquidation (matching
TradingView, 19/19 alpha-wizard nibbles bit-exact). The synthetic scenario's
first lot is now 4*floor(0.95238095/0.5)*0.5 = 4*0.5 = 2.0 (still an exact step
multiple, still <= the 3.80952381 unquantized cap). Test-only; ctest 79/79.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@luisleo526 luisleo526 merged commit dc209a0 into main Jul 7, 2026
5 checks passed
@luisleo526 luisleo526 deleted the test/ki31-margin-nibble-expectation branch July 7, 2026 08:55
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.

1 participant