Skip to content

Feat/dynamic surplus rate#114

Merged
passandscore merged 2 commits intomainfrom
feat/dynamic-surplus-rate
Apr 13, 2026
Merged

Feat/dynamic surplus rate#114
passandscore merged 2 commits intomainfrom
feat/dynamic-surplus-rate

Conversation

@passandscore
Copy link
Copy Markdown
Contributor

No description provided.

Replace hardcoded HISTORICAL_SURPLUS_RATE (0.0068) with a dynamic value
fetched from Edge Config and updated monthly by the miles-estimate-gas
cron job.

- Add GET_FASTSWAP_SURPLUS_RATES query computing surplus_eth / output_in_eth
  for processed eth_weth swaps over the last 30 days
- Add computeMedianSurplusRate() to cron job — computes median from the
  query results and writes miles_estimate_surplus_rate to Edge Config
  alongside gas limit and gas used averages (single batch write)
- Update gas-estimate API route to return surplusRate
- Update use-estimated-miles hook to fetch and use dynamic surplus rate
- Add use-surplus-rate hook for dashboard table components
- Thread surplusRate through SwapsTableBody and MilesCell props so the
  pending-row estimator uses the same dynamic value
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

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

Project Deployment Actions Updated (UTC)
fastprotocolapp Ready Ready Preview, Comment Apr 13, 2026 10:18pm

Request Review

@passandscore passandscore merged commit 3394cbe into main Apr 13, 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