Open
Conversation
Adds a "Pro" execution mode that sends a `topPercentile: 10` field on the /fastswap intent path, requesting top-of-block placement from mev-commit providers. Auto-engages at ≥$250 sell-side USD on permit-path swaps; user can toggle off. ETH-path swaps are not eligible. UI: Pro toggle pill with rotating border highlight in the header row, "Pro Swap" title, "Swap (Pro)" CTA label, Pro-branded switch button, SellCard top-edge gradient, celebration particle burst + sound on auto-engage, and "Execution: Pro — Top 10%" row in the confirmation modal. Also fixes a stale-price bug in useTokenPrice where switching tokens kept the previous token's USD price during the fetch window, causing false Pro triggers and incorrect USD displays.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add edge config key `pro_mode_min_usd` (default 250) so the Pro mode threshold can be tuned in prod without a deploy. New API route at /api/config/pro-threshold, client hook useProThreshold(), and docs covering all edge config keys.
Token prices from the API can be slightly below $1 (e.g., USDC at $0.9998), causing the sell USD value to land just under the threshold (19.996 < 20). Round to the nearest dollar before comparing.
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.
Summary
/fastswapPOST body includestopPercentile: 10, requesting top-of-block placement from mev-commit providerspro_mode: trueinfeature-flags.tsUI
⚡ Protoggle pill in the header row with rotating blue border highlight when active⚡ PRO ↓pill/learn/pro-swapsBackend integration
topPercentile: 10to the/fastswapPOST body when Pro is active (Owen's backend change)src/lib/pro-mode.ts:PRO_MODE_MIN_USD = 250,TOP_OF_BLOCK_PERCENTILE = 10Bug fix
useTokenPrice— previously, switching tokens (e.g., ETH → PEPE) kept the old token's USD price during the fetch window, causing false Pro triggers and incorrect USD displaysTest plan
topPercentile: 10in network tab POST bodypro_mode: falsein feature-flags → all Pro UI completely hidden