Skip to content

fix(mm): give the inventory halt headroom for a cNGN rally - #66

Merged
robertleifke merged 1 commit into
mainfrom
fix/mm-inventory-cap-headroom
Sep 17, 2026
Merged

robertleifke merged 1 commit into
mainfrom
fix/mm-inventory-cap-headroom

Conversation

@robertleifke

Copy link
Copy Markdown
Contributor

What I got wrong in #65

MM_MAX_NET_INVENTORY = 650 was sized against the planned funding valued at today's rate. That's the wrong frame: risk.Evaluate measures inventory in the base asset only (USDC), so the worst case — every cNGN rung fills and the whole cNGN balance becomes USDC — is denominated in cNGN and moves with the price.

Funding @₦1,368 @₦1,300 @₦1,250 @₦1,200
300 USDC + 441,061 cNGN 639 656 670 685

Against a cap of 650, the intended funding halts on roughly a 5% cNGN strengthening — well inside normal movement for this pair. A halt isn't a soft cap: it cancels the entire ladder and the book goes dark until someone notices.

Change

MM_MAX_NET_INVENTORY 650 → 800, which holds the full funding down to about ₦1,150.

Nothing else moves. MM_ORDER_SIZE (40) and MM_MAX_NOTIONAL_PER_SIDE (450,000) are unchanged — they govern quoted depth, and the funding they were sized for is unchanged.

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 = "650" -> "800"

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

🤖 Generated with Claude Code

#65 set MM_MAX_NET_INVENTORY to 650, sized against the funding valued at
today's rate. Inventory counts USDC only, so the worst case -- every
cNGN rung fills and the whole balance becomes USDC -- is denominated in
cNGN and moves with the price:

  300 USDC + 441k cNGN   639 @1368   656 @1300   670 @1250   685 @1200

So the intended funding would have halted the bot on roughly a 5% cNGN
strengthening, cancelling the whole ladder. 800 holds down to ~1150.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@robertleifke
robertleifke merged commit 95ebd65 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