W13-C2: Pair switch on trade / limit takes 8–10 seconds to fully load — unacceptable latency for a trading interface #180
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#180
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
Switching to a different pair using the pair selector takes approximately 8 seconds before the new pair begins to appear, and up to 10 seconds to fully load the chart and order book. Chrome Lighthouse records an Interaction to Next Paint (INP) of 272ms (needs improvement; threshold: under 200ms is good). For a trading interface where CEX migrants expect near-instant market switching, this latency is a significant usability failure.
Reproduction Steps
Expected Behavior
The UI should respond to the pair switch within ~500ms. The chart and order book should begin loading immediately with a visible loading state, and fully resolve within 1–2 seconds on a local environment.
Actual Behavior
button#trade-pair-select.token-select-trigger) taking up to 120ms just to respond to the click, before any data fetching beginsEnvironment Details
localterra(local Docker)VITE_NETWORK=local npm run devatlocalhost:3000How to Verify When Fixed
Severity / Impact
P2 Performance. An 8–10 second pair switch on a local environment would be significantly worse on a remote network. CEX traders switch markets frequently and expect instant response. A frozen-looking UI during switching erodes trust. Found under W13-C2 (Performance — interaction latency on pair switch).
cc: @PlasticDigits
mentioned in issue #116
mentioned in commit
d118ca8f3bFix shipped on
main(d118ca8)Pair switching on
/tradewas serialized behindgetPairbeforePriceChartmounted, so candles and the chart only started loading after indexer pair metadata returned (~8–10s locally with no loading affordance).What changed
PriceChartmounts as soon aspairAddris valid;getCandles, tape, and limit book queries run in parallel withgetPair(noactivePair &&gate).TradePairSwitchStatus(data-testid="trade-pair-switch-loading") while workspace queries for the active pair are in flight; chart still shows its own Loading chart… spinner.prefetchTradePairWorkspacewarms pair metadata, default1hcandles, tape, and bid/ask book pages on route change, paironChange, andMenuSelectonOptionIntent(hover/focus another row).Docs / agent playbooks
Verification checklist
/tradeonVITE_NETWORK=local npm run devwith LocalTerra indexer up#trade-pair-select; confirmgetPair,candles,trades, andlimit-bookrequests start together (not candles only aftergetPair)trade-pair-switch-loadingappears immediately; chart shows Loading chart…; book spinners; full workspace under ~1–2s locallynpm run test:run -- src/pages/TradePage.test.tsx src/utils/__tests__/tradePairPrefetch.test.ts@totdking — please verify on your M1 / Chrome setup when convenient; leaving the issue open until W13-C2 sign-off.
cc @PlasticDigits
mentioned in issue #179
qa cleared source+test layer @PlasticDigits
verified
d118ca8is on main.TradePage.test.tsx 12/12 PASS — including the #180-specific cases:
tradePairPrefetch.test.ts 2/2 PASS.
Network-tab parallel-fetch eyeball + Lighthouse INP measurement deferred to @totdking on his M1 / Chrome setup per your note above.
mentioned in issue #215
marked as related to #215
mentioned in issue #218
mentioned in issue #226
marked as related to #226
mentioned in issue #354
mentioned in issue #524
mentioned in issue #543
mentioned in issue #705