Skip to content

feat(mm): quote 8 rungs a side so the funding is actually deployed - #67

Merged
robertleifke merged 1 commit into
mainfrom
feat/mm-quote-levels-8
Sep 17, 2026
Merged

robertleifke merged 1 commit into
mainfrom
feat/mm-quote-levels-8

Conversation

@robertleifke

Copy link
Copy Markdown
Contributor

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.

buildLevels walks outward placing ORDER_SIZE × LEVEL_SIZE_MULT^k until 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_LEVELS Rungs/side Ask deployed Bid deployed Idle
5 (today) 5 148.83 148.83 ~340
6 6 198.60 198.60 240
7 7 258.32 258.32 121
8 8 310.00 327.70 0
9+ 8 310.00 327.70 0

So the fix is levels, not size. Nine or more changes nothing — the inventory binds first.

Change

MM_QUOTE_LEVELS 5 → 8. ORDER_SIZE (40) and LEVEL_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-end and bids top-aligned, both overflow-hidden, so what gets cut is the far end of the book, never the touch.

Plan

Plan: 1 to add, 1 to change, 1 to destroy
  # aws_ecs_service.market_maker will be updated in-place
  # aws_ecs_task_definition.market_maker must be replaced
    ~ value = "5" -> "8"

Env-only. No image change, no desired_count, no other resources.

🤖 Generated with Claude Code

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>
@robertleifke
robertleifke merged commit 55f315f into main Sep 17, 2026
1 check passed
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