feat(mm): quote 8 rungs a side so the funding is actually deployed - #67
Merged
Merged
Conversation
The ladder was running out of levels before it ran out of money. With
QUOTE_LEVELS=5 and LEVEL_SIZE_MULT=1.2 the five rungs sum to 148.83 USDC
a side, against 310 USDC and 448,613 cNGN held -- about 340 USDC of the
funding sat idle, which showed up as empty rows in the order book panel.
buildLevels walks outward until the side's budget is spent, and that
budget is the inventory, so the fix is levels rather than size:
levels ask deployed bid deployed idle
5 148.83 148.83 340
6 198.60 198.60 240
7 258.32 258.32 121
8 310.00 327.70 0
9 or more changes nothing; the budget binds first.
Costs 16 resting orders instead of 10, so the 60s expiry roll goes from
~13 to ~21 cancels a minute. Cancels are off-chain.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
The book shows five rungs a side totalling $148.83, against 310 USDC + 448,613 cNGN (~$638) actually held in subaccount 15. Roughly $340 is idle — visible as empty rows above the asks and below the bids.
buildLevelswalks outward placingORDER_SIZE × LEVEL_SIZE_MULT^kuntil the side's budget is spent, and that budget is the inventory, not the ladder. With only 5 levels it exhausts the rungs long before the money:MM_QUOTE_LEVELSSo the fix is levels, not size. Nine or more changes nothing — the inventory binds first.
Change
MM_QUOTE_LEVELS5 → 8.ORDER_SIZE(40) andLEVEL_SIZE_MULT(1.2) are unchanged, so the touch keeps its current size and the geometry is the same; the ladder just doesn't stop early.Live depth roughly doubles, from ~$298 to ~$638.
Cost
16 resting orders instead of 10, re-signed on the 60s rolling expiry: ~21 cancels a minute rather than ~13. Cancels are off-chain and don't touch the executor's gas.
The outermost rungs may clip in the order-book panel — asks are
justify-endand bids top-aligned, bothoverflow-hidden, so what gets cut is the far end of the book, never the touch.Plan
Env-only. No image change, no
desired_count, no other resources.🤖 Generated with Claude Code