fix(validation): warn when activeOrders exceeds grid capacity (Range/Incr) - #21
Closed
Impulssi wants to merge 2 commits into
Closed
fix(validation): warn when activeOrders exceeds grid capacity (Range/Incr)#21Impulssi wants to merge 2 commits into
Impulssi wants to merge 2 commits into
Conversation
With Range [1.15x-1.5x] and Incr 1.5% the grid holds ~34 order slots (S:23 max). Target S:27 (33 total) silently becomes 22/27 with no warning (operator assumes funds missing). Add capacity check in collectValidationIssues: estimate levels from Range/Incr/Spread and warn when required > available - buffer.
…rning Estimate buy and sell capacity separately (mirrors createOrderGrid geometry: each side grows geometrically from the center, gap slots split around the boundary). Issue case now reports 'fits ~24 sell orders' vs observed 23. Warning text rewritten to state the symptom (Active 22/27, Slots 23 sell) and the remedies per side.
Owner
|
I see the need to educate the user about a proper DEXBot2 range. Give the user a hint afterwards is not beneficial nor should the active order count play a role about a proper range. User sees now range legend, with color highlight. |
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.
Problem (issue #19)
With
Range [1.15x - 1.5x]andIncr 1.5%the grid cannot holdactiveOrders S:27.dexbot ordershowed:createOrderGrid(modules/order/grid.ts:444-460) generatesln(1.15*1.5)/ln(1.015) ~ 36levels, so the sell side fits only ~23 orders. Target 27 is never reachable — the surplus silently stays unfilled. The startup log confirmed:There was no warning at
dexbot bottime. The operator naturally assumes funds are missing (virtualReservation) when it is actually grid geometry.Fix
Add a per-side capacity check in
collectValidationIssues(modules/bot_settings.ts). The estimate mirrorscreateOrderGridgeometry: each side grows geometrically from the center; gap slots split around the boundary.Now the issue case warns at startup:
The same check covers the buy side, numeric (absolute price) bounds, and skips safely when types are mixed or fields are missing.
Testing
8 cases verified against the compiled output:
[1.15x-1.5x] 1.5% S:27→ warnsfits ~24 sell(observed 23)[1.15x-2.0x] 1.5% S:27→ no warning (the documented workaround)0.65%/3% [1.15x-1.5x] B6/S27→ no warningB:15on1.15x→ warnsbuy fits ~7incrementPercent→ skipped sFixes #19
Note: I'm new to this codebase and worked through this change with an AI
coding assistant (opencode). The bug was hit on my own live instance and
all measurements / reproduction steps are mine — but please flag anything
in the code that looks off and I'll dig in and follow up.