Align trade bid/ask labels and slippage terminology for CEX migrants (#412) #939
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!939
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-412-trade-slippage-labels"
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?
Summary
Addresses #412 for CEX/DEX migrants on the pro trade surface and swap settings:
/tradebid/ask: Buttons and ticket heading now both use CEX-standard Buy {base} / Sell {base} (tradeDirectionSideLabels.ts,TradeOrderTicket.tsx). Ask heading no longer shows the quote symbol.max_spreadfootnote) is unified across Swap Settings, trade summary, pre-sign summary, market panel, hop-spread guards, and humanized chain errors (slippageProtectionCopy.ts,humanizeTerraTxError.ts).deadlineSecondsindex.ts; summary row shows formatted deadline.(i)help tooltip clarifying it is execution-quality, not the protection setting.docs/frontend.md,docs/swap-max-spread-ux.md, and agent playbooks for bid/ask + slippage invariants.Acceptance checklist
cd frontend-dapp && npm run test:unit -- src/utils/__tests__/tradeDirectionSideLabels.test.ts; manual/tradetoggle bid/asktradeDirectionSideLabels.test.tsnpm run test:unit -- src/utils/__tests__/humanizeTerraTxError.test.ts src/components/swap/__tests__/SwapPreSubmitSummary.test.tsx src/services/terraclassic/__tests__/transactions.test.tsslippageProtectionCopy.test.ts; manual Swap SettingsslippageProtectionCopy.test.ts; Expected slippage row + tooltip inSwapPage.tsx/tradeorder ticket bid/ask/trade/→ expand SettingsTest plan
cd frontend-dapp && npm run test:unit -- src/utils/__tests__/tradeDirectionSideLabels.test.ts src/utils/__tests__/slippageProtectionCopy.test.ts src/utils/__tests__/humanizeTerraTxError.test.ts src/components/swap/__tests__/SwapPreSubmitSummary.test.tsx src/pages/TradePage.test.tsx src/pages/SwapPage.test.tsxmake lint-frontendmake test-frontendcosmesPatch127.test.tspatch SHA drift on main (pre-existing)TradePage.test.tsxVerification for third parties
git fetch && git checkout issue-412-trade-slippage-labelscd frontend-dapp && npm run test:unit -- src/utils/__tests__/tradeDirectionSideLabels.test.ts src/utils/__tests__/slippageProtectionCopy.test.ts src/pages/TradePage.test.tsx src/pages/SwapPage.test.tsxmake lint-frontend/trade: Open order ticket → select Buy {base} → heading reads Buy {base} → select Sell {base} → heading reads Sell {base} (buttons and heading agree)./, enter an amount, expand Slippage protection row → confirm presets,max_spreadfootnote, Transaction deadline presets (default 5 min), and Expected slippage(i)tooltip text.Blockers
make test-frontendcosmes patch SHA test failure appears unrelated to this diff.Security review — MR !939
Commit reviewed:
dc7ec3abea7e26e04d17e085ee5db682181ba822Scope: Frontend copy/label alignment (
tradeDirectionSideLabels,slippageProtectionCopy), Swap Settings transaction-deadline UI, SEC-D11 pre-sign label rename, docs/skills updates. No smart-contract, indexer, or auth changes.Outcome:
FINDINGS: 0medium+Method
Traced attacker-controlled inputs (custom deadline minutes, slippage presets, indexer token symbols) to sinks (Zustand
setDeadlineSeconds, on-chaindeadline/max_spreadconstruction, React render paths). Re-checked prior MR threads (none).Areas reviewed (no issues)
handleCustomDeadlineMinutes,dex.ts)/[^\d.]/g); UI range 0.5–60 min; store clampsMath.max(30, Math.min(3600, seconds)). Deadline computed at submit asfloor(now/1000) + deadlineSeconds— no overflow or bypass path.TradeOrderTicket,tradeDirectionSideLabels)bid→ escrow token1,ask→ escrow token0). Aligns CEX Buy/Sell copy; reduces prior heading/button mismatch.max_spreadmath andsetSlippageToleranceclamps unchanged.swap-confirm-*testids preserved. Deadline now visible in trade summary row (swap-deadline-summary); omission from pre-sign panel is pre-existing pattern, not a new trust-boundary regression.dangerouslySetInnerHTML; token symbols remain React text nodes (auto-escaped). Tooltip/title strings are static constants.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
mentioned in commit
35fba18e01