File tree Expand file tree Collapse file tree
app/api/cron/update-edge-config/miles-estimate-gas Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ async function computeSurplusRateEstimate(): Promise<number> {
327327 * 4. Returns a JSON summary of the result.
328328 *
329329 * ### Schedule
330- * Configured in `vercel.json` to run at 00:00 UTC on the 1st of every month .
330+ * Configured in `vercel.json` to run daily at 00:00 UTC.
331331 * Can also be triggered manually from the Vercel Dashboard → Cron Jobs tab.
332332 */
333333export async function GET ( request : Request ) {
Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ export function SwapSide({
115115 )
116116}
117117
118+ /**
119+ * Conservative miles estimate for pending rows. Uses the surplus rate
120+ * (from Edge Config, updated daily by cron) and the 90% user share /
121+ * 100k miles-per-ETH constants.
122+ *
123+ * This is a rough floor — actual miles are computed post-settlement and
124+ * will overwrite this value once processed.
125+ */
118126const DEFAULT_SURPLUS_RATE = 0.0056
119127const USER_MEV_SHARE = 0.9
120128const MILES_PER_ETH = 100_000
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export function useEstimatedMiles({
4848 const [ avgGasUsed , setAvgGasUsed ] = useState < bigint > ( DEFAULT_AVG_GAS_USED )
4949 const [ surplusRate , setSurplusRate ] = useState ( DEFAULT_SURPLUS_RATE )
5050
51- // Fetch gas estimates and surplus rate from Edge Config (updated monthly by cron).
51+ // Fetch gas estimates and surplus rate from Edge Config (updated daily by cron).
5252 // Runs on mount — not gated on `enabled` so data is ready before the first quote arrives.
5353 useEffect ( ( ) => {
5454 let cancelled = false
Original file line number Diff line number Diff line change 77 "crons" : [
88 {
99 "path" : " /api/cron/update-edge-config/miles-estimate-gas" ,
10- "schedule" : " 0 0 1 * *"
10+ "schedule" : " 0 0 * * *"
1111 }
1212 ]
1313}
You can’t perform that action at this time.
0 commit comments