Skip to content

Optimize swap quoting debounce timings#89

Merged
techgangboss merged 1 commit intomainfrom
optimize-debounce-timings
Mar 30, 2026
Merged

Optimize swap quoting debounce timings#89
techgangboss merged 1 commit intomainfrom
optimize-debounce-timings

Conversation

@techgangboss
Copy link
Copy Markdown
Contributor

Summary

  • Barter validation debounce: 1500ms → 300ms (fires after quote RPC already absorbed typing latency)
  • Min "Calculating..." display: 1500ms → 500ms (prevents flicker without artificial delay)
  • Quote fetch debounce: 500ms → 300ms (faster feedback while typing)

Shaves ~2s off the input → validated quote pipeline. All existing deduplication and staleness guards (requestIdRef, AbortController, inputKey dedup) handle the tighter timings correctly.

Context: Owen's #claws investigation confirmed the 1.5s is a frontend input debounce artifact, not execution latency. Three debounces were stacking to add ~2.5s of artificial wait before the user sees a validated quote.

Test plan

  • Type a swap amount — quote should appear ~2s faster than before
  • Rapid typing — no duplicate or stale quotes should flash
  • Token switch — quote updates smoothly (still uses 400ms structural debounce)
  • "Calculating..." spinner should not flicker on/off (500ms minimum holds)
  • Barter "Amount too small" detection still works for dust amounts

🤖 Generated with Claude Code

Reduce artificial delays in the input → validated quote pipeline.
The 1.5s barter debounce was unnecessary since it fires after the
quote RPC already absorbed typing latency. The 1.5s minimum display
timer forced users to wait even when results were ready instantly.

- Barter validation debounce: 1500ms → 300ms
- Min "Calculating..." display: 1500ms → 500ms
- Quote fetch debounce: 500ms → 300ms

Expected improvement: ~2s faster quote display after user stops typing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fastprotocolapp Ready Ready Preview, Comment Mar 30, 2026 11:56pm

Request Review

@techgangboss techgangboss merged commit 120e0c0 into main Mar 30, 2026
1 of 3 checks passed
@techgangboss techgangboss deleted the optimize-debounce-timings branch March 30, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant