W7-C4: Size input has three gaps — no USD notional estimate, amount carries over on side switch, MAX does not recalculate on side switch #155
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#155
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?
Issue Summary
The Amount field in the Place Limit panel has three related gaps affecting how traders size their orders:
No USD notional estimate (https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/154)— entering an amount shows no USD value equivalent, so the trader cannot evaluate the notional size of their order in a familiar unit
Amount carries over on Bid → Ask switch — when switching sides, the entered amount is preserved in the field even though the token and available balance have changed; the stale value may exceed the balance on the new side with no warning
Before
After
MAX does not recalculate on side switch — clicking MAX on Bid fills the Bid token balance, but switching to Ask does not recalculate MAX for the Ask token; the field retains the Bid MAX value, which may be higher than the Ask balance
MAX ON ASK
MAX ON BID
Reproduction Steps
Finding 1 — No USD notional:
/trade, select EMBER / CORAL, connect wallet5)Finding 2 — Amount carries over on side switch:
5)5; the field is not cleared or recalculated for the new tokenFinding 3 — MAX does not recalculate on side switch:
9.7828)9.7828(Bid MAX); it does not recalculate to the Ask token balance (e.g.9.9988)Expected Behavior
Actual Behavior
Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devatlocalhost:3000make indexer-dev)make deploy-localWallet / Device Details
terra1...sl7cvvterra146...c9mjav)Severity / Impact
Medium. Findings 2 and 3 have the highest priority: a trader who clicks MAX on Bid, switches to Ask, and submits without noticing the stale value may attempt to place an order larger than their Ask balance — burning gas on a guaranteed-to-fail transaction . Finding 1 (https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/154 no USD notional) means the trader cannot sanity-check their order size in a familiar unit before signing. Found under W7-C4 (Size input — Display and Updates dimensions).
cc: @PlasticDigits
mentioned in issue #116
mentioned in commit
8623c9fef4Update (merged to
main)Implemented all three W7-C4 sizing gaps from this issue on
/tradeand/limits(see commit onmain).What changed
escrowAmountUsdAnchorNotionalinlimitOrderPriceReference.ts(same tape headline +refToken1PerToken0as the limit price “Headline-scaled USD” line). Shows — when headline/ref are unavailable (e.g. pool-only ref without tape), matching the price field’s coverage.useLimitOrderFormtracksLimitEscrowAmountSource(manualvsmax). After Max, switching sides clears until the new CW20 balance loads, then re-fills full balance for the new escrow token.Docs / agent cross-links
docs/frontend.md— new anchor § Limit place — escrow amount (#limit-place-escrow-amount)docs/limit-orders.md— dApp bullet for #155skills/AGENTS_FRONTEND_LIMIT_ORDER_PRICE.md+skills/AGENTS_FRONTEND_LIMIT_ORDER_SIDE_SELECTOR.mdChecklist for verification
/trade→ Limit → enter amount with indexer tape + headlinepricepresent → USD line appears and moves as you type./limitsplace form behaves the same (side selector + amount + Max).@totdking — could you confirm on your EMBER/CORAL local setup (or any pair with tape)? Leaving the issue open until you sign off.
Verification complete (agent)
Verified all W7-C4 checklist items on local infra (LocalTerra, host Postgres :5432, indexer :3001, frontend :3000, EMBER/CORAL pair, simulated dev wallet).
Checklist results
/trade→ Limit — entering amount5on Bid (CORAL) shows Headline USD (escrow): ≈ $5.000; updates as typed.escrowAmountUsdAnchorNotionalreturns null; UI renders — (no crash). Limits page shows — for price USD anchor before pair/tape loads.5→ switch Ask → field clears (EMBER context)./limits— same USD line, side-switch clear, and side selector behavior on EMBER/CORAL.1.047838…and amount135.27791as manual draft (not max mode).Tests
limitOrderPriceReference.test.ts— 16/16 passed (includesescrowAmountUsdAnchorNotional).No regressions found; fix already on
main. Closing as verified.mentioned in issue #524
marked as related to #524
mentioned in issue #563
mentioned in issue #693