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#385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
changed title from
UI: Limit ladder crossing guard blocks ASK side only; BID orders above market price still accepted after MR !757 fix (follow up #297)toOE-3 UI: Limit ladder crossing guard blocks ASK side only; BID orders above market price still accepted after MR !757 fix (follow up #297)changed the description
Summary
After MR !757 (merged) ported the crossing guard into
LimitOrderLadderPanel.tsx, manual browser verification on LocalTerra shows the guard is only enforced in one direction. ASK ladders priced below the current market price are correctly blocked with an inline warning. BID ladders priced above the current market price are still accepted and placed on-chain without any warning or block.The Vitest suite in
LimitOrderLadderPanel.crossing.test.tsxpasses 7/7 for both directions, meaning the asymmetry is present in the live runtime but not caught by the component tests.Observed behavior
Tested on the CORAL/EMBER pair (market price approximately 0.8 to 1.1):
Reproduction steps
http://localhost:5173/limitsor/trade/:pairAddrExpected behavior
Both directions should be enforced symmetrically. A BID ladder with any rung priced above the best ask should show the inline crossing warning ("N of M rungs will cross the market...") and disable the submit button, matching the behavior already working for ASK ladders.
Actual behavior
The ASK side crossing guard is active. The BID side crossing guard is not enforced in the live browser. BID rungs priced above market are placed on-chain silently with no warning.
Technical context
The fix in MR !757 ported
describeLimitCrossingBlockerinto the ladder panel via aladderCrossingGatememo and a mutation hard-guard. The Vitest suite exercises both sides and passes. The live asymmetry suggests the BID path in theladderCrossingGatememo or theuseTradeBestBookPriceshook is not resolving correctly at runtime (possibly a stale or undefinedbestAskvalue on the BID path, causing the guard to be silently skipped rather than triggered).The single-order form in
TradeOrderTicket.tsxcallsdescribeLimitCrossingBlocker(side, price, bestBid, bestAsk)symmetrically for both sides. The ladder port should be checked against this reference implementation for parity.Environment
/limits-- Limit Ladder panelSeverity: P2 -- BID crossing orders are submitted silently; users can place unintended taker fills with no slippage UX. The single-order form warns correctly; the ladder form does not for the BID direction.
Related checklist items: OE-3
Regression of: #297 (fix is partial)
Video link in https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/297#note_3459942096
cc: @PlasticDigits
mentioned in issue #291
mentioned in commit
5850aa28bamentioned in merge request !914
mentioned in commit
8a5c9e85a2Verification
Ladder tx execution works as expected. The place-N-rung ladder button is disabled on invalid price range for either bid / ask
Good for a close
Verification — #385 (OE-3 BID ladder crossing guard)
Fix under test:
5850aa28—describeLimitCrossingBlockerWithRef,refToken1PerToken0wiring inLimitOrderLadderPanel, andlimitBookPagecache seed inuseTradeBestBookPrices.Results
LimitOrderLadderPanel.crossing+limitOrderNonCrossingcd frontend-dapp && npm test -- LimitOrderLadderPanel.crossing limitOrderNonCrossing/limits(EMBER/CORAL pair), Simulated Wallet, start=15 end=18 —#ladder-crossing-guardshows "rungs will cross the market", submit disabledbest_ask+ reference fallback (#385 regression)blocks bid ladder when best ask is missing but reference price is below rungs (#385); live EMBER/CORAL book heads were empty (no resting bid/ask) during browser run — guard still blocked BID rungs via reference pathmake dev+ freshdeploy-local+ indexer on:3001AGENTS_LIMIT_ORDER_BATCH_LADDER.md,docs/frontend.md)Environment
main@8a5c9e85http://127.0.0.1:5173/limits)terra16jd56…tdy0g); book heads empty at test time (reference-fallback path exercised for BID)Follow-ups
verify-issue-385-crossing.spec.ts+make verify-issue-385target (mirroring #295) so future regressions are caught in CI smoke without manual LocalTerra setup.Closing — fix verified on main.
mentioned in issue #546
mentioned in issue #617
mentioned in issue #619
mentioned in issue #717