fix: align sweep bid cost change, fix input reset on retry#147
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.