fix(orderbook): reject and recover unfillable limit orders #1409
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cl8y-dex-terraclassic!1409
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-1399-unfillable-orders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Reject economically unfillable orders on single/batch/ladder placement and repricing, then park legacy unfillable rows during bounded matching or permissionless cleaning even with zero dust thresholds. Makers retain owner-only escrow claims; zero-value claims omit CW20 transfers. Post-fill economic tails park without evicting healthy orders merely because a taker budget is small.
Align indexer book simulation with contract Decimal18 reciprocal rounding, the 500-step scan cap, and legacy expired/zero row scan positions. Add 21 regressions, numbered UF1399 invariants, integrator documentation, and an agent verifier with explicit unavailable-check skip policy.
Why
Tiny in-band orders previously remained linked indefinitely and consumed every bounded head scan, hiding useful liquidity. Placement size and price bounds alone did not prevent the clog. Escrow, FIFO, maker/scan/park caps, pause, blacklist, freeze, slippage and opt-in greedy behavior are preserved.
Fixes #1399; implements the remaining source remediation from closed #1225.
Testing
make verify-issue-1399: 8 PASS, 0 FAIL, 0 SKIP in source scope. Focused contract and indexer tests run twice.-D warnings; changed Rust formatting and documentation crosslinks. Commit hooks also passed full contract lint and staged Gitleaks.Checklist
Agents should read the verification checklist and receipt and UF1399 playbook, run
make verify-issue-1399, and check only criteria supported by evidence. Unavailable checks may be SKIP with an observed reason and overall PASS WITH SKIPS when every executed check passes. Executed failures remain FAIL until corrected and retested; skipped rollout does not establish deployment.After merge, deploy the updated indexer and migrate pair wasm, then verify clean/claim behavior and gas before live acceptance. Initial fixture/diagnostic failures were corrected and retested; none were hidden as skips.