Align trade bid/ask labels and slippage terminology for CEX migrants #412
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#412
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?
Parent
#411 — Updated Gap Analysis (bundle: recommendations 1 + 4)
Current codebase
frontend-dapp/src/utils/tradeDirectionSideLabels.tsreturnsbidLabel: "Buy {base}"andaskLabel: "Buy {quote}"whileTradeOrderTicket.tsxrenders the heading as{verb} {receive}— on the ask side that is "Sell {base}", so the bid/ask buttons and ticket title use contradictory verbs.LimitOrderBidAskSideSelector.tsxandTradeOrderTicket.tsxconsume the labels.SwapPage.tsx), pre-sign / chain paths use "max spread" (humanizeTerraTxError.ts,stores/dex.ts→maxSpreadStr), and route metrics expose "expected slippage" /routeSlippagePercent(swapRouteSlippage.ts, indexerroute_slippage.rs#293).deadlineSeconds: 300instores/dex.ts) is never surfaced in Swap Settings.Why needed
CEX/DEX migrants map Buy/Sell to base-asset semantics. Contradictory bid/ask vs ticket copy erodes trust on the highest-traffic pro surface (
/trade). Split slippage terminology causes users to misconfigure protection and misread chain rejections.Constraints / guardrails
limitOrderNonCrossing.tsor post-only guards.humanizeTerraTxError.tschain-log mapping accurate — retail label unification must not regress #134 / #135 error copy.hidden lg:blockinTradeOrderTicket.tsx— any copy fix should remain readable on small screens.Relevant files
frontend-dapp/src/utils/tradeDirectionSideLabels.tsfrontend-dapp/src/utils/__tests__/tradeDirectionSideLabels.test.tsfrontend-dapp/src/components/trade/LimitOrderBidAskSideSelector.tsxfrontend-dapp/src/components/trade/TradeOrderTicket.tsxfrontend-dapp/src/pages/SwapPage.tsx(Settings slippage block)frontend-dapp/src/utils/swapRouteSlippage.tsfrontend-dapp/src/utils/humanizeTerraTxError.tsfrontend-dapp/src/stores/dex.tsdocs/swap-max-spread-ux.mdRecommended direction
max_spread.Acceptance criteria
/tradeorder ticket — bid selected, ask selected — buttons and heading agree.Test plan
cd frontend-dapp && npm run test:unit— extendtradeDirectionSideLabels.test.ts;humanizeUserFacingError.test.tsif error strings change.make lint-frontend/tradetoggle bid/ask; confirm heading + buttons; place no tx required.Attack / abuse test plan
Verification criteria
TradePage.test.tsxbid/ask / limit tab tests.make test-frontendgreen.mentioned in issue #411
mentioned in commit
dc7ec3abeamentioned in merge request !939
mentioned in commit
35fba18e01Verification — #412 (PASS)
Verified on
main@6ffd7f44(implementation merged indc7ec3ab).Acceptance criteria
http://127.0.0.1:5173/trade/terra17w9r…m79v6(EMBER/COBALT): bid Buy EMBER ↔ heading Buy EMBER; ask Sell EMBER ↔ heading Sell EMBER. Screenshots:/tmp/issue-412-screenshots/trade-bid-selected.png,trade-ask-selected.pngtradeDirectionSideLabels.test.ts— Buy/Sell base for both sidesslippageProtectionCopy.ts(Slippage protection);SwapPage.tsx,SwapPreSubmitSummary.tsx,humanizeTerraTxError.ts; tests inslippageProtectionCopy.test.ts,humanizeTerraTxError.test.ts,humanizeUserFacingError.test.tsstores/dex.tsdeadlineSeconds: 300; Swap Settings presets + custom input;SwapPage.test.tsxretail panel testROUTE_EXECUTION_SLIPPAGE_TOOLTIP) vs Slippage protection in Settings/tradebid + ask/tmp/issue-412-screenshots/swap-settings-slippage-deadline.pngTradePage.test.tsxbid/ask / limit tab — no regressionmake test-frontendmake test-frontendgreenmake lint-frontendcd frontend-dapp && npm run test:unitManual QA notes
make setup-cloud-localterra --fresh --skip-build), indexer + Vite dev server for browser checks.Repo changes
None — verification only; no MR opened.
mentioned in issue #524
marked as related to #524
mentioned in issue #528
marked as related to #528
mentioned in issue #563