Skip to content

fix: align sweep bid cost change, fix input reset on retry#147

Merged
owen-eth merged 3 commits into
mainfrom
fastswap-sweep-bid-cost
May 15, 2026
Merged

fix: align sweep bid cost change, fix input reset on retry#147
owen-eth merged 3 commits into
mainfrom
fastswap-sweep-bid-cost

Conversation

@owen-eth
Copy link
Copy Markdown
Contributor

No description provided.

owen-eth and others added 2 commits May 15, 2026 14:51
Mirrors the backend's expanded PerRowOverhead so the upfront miles
estimator deducts the sweep tx's own bid cost. The cron now joins per-
token executor sweep counts × global fastswap bid p75 / user-row counts
and adds the result to the existing gas overhead before writing to
miles_estimate_sweep_overhead_eth_by_token.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
executeSwap clears form.amount the moment the tx is submitted (via
onCloseAfterSuccess), so by the time the failed toast surfaces a Retry
button the form is empty — clicking Retry reopened the confirmation
modal with amount="0". The toast carries the original amountIn, so the
retry request now stashes it alongside the slippage and SwapForm
restores the sell side before refetching the quote.

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

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
fastprotocolapp Ready Ready Preview, Comment May 15, 2026 7:39pm

Request Review

…amounts

executeSwap called onCloseAfterSuccess() immediately after every tx
submission, wiping form.amount before the relayer even responded. That
broke both retry paths — barter-slippage Retry in the toast AND the
modal's Try Again button after a "dropped" / generic failure — because
both reopen the confirmation modal, which snapshots from the form. The
toast already receives onCloseAfterSuccess as its onPreConfirm callback
and fires it when the swap actually preconfirms, so the immediate calls
were redundant. Removing them lets the form retain the user's amounts
through pending/failed states without changing the post-success flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@owen-eth owen-eth merged commit 7703b69 into main May 15, 2026
3 checks passed
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