STANDARDwalkthrough
Surge Pricing
It is New Year's Eve at midnight. Demand for rides in Times Square spikes 10x while half the drivers go offline.
The constraint: naive surge causes oscillation: surge goes up, riders stop requesting, surge drops, riders flood back, surge spikes again. We chose per-cell surge with EMA smoothing (not global surge, not instantaneous per-cell) because per-cell isolates geographic demand while EMA dampens the oscillation cycle.
“Without surge pricing, riders wait 30+ minutes and most give up.”
Trade-off: we accepted a 2-3 minute delay in surge response in exchange for stable pricing. The formula: compute ride requests per H3 cell over the last 5 minutes, divide by available drivers in that cell.
If the ratio exceeds 2:1, apply a multiplier: . A 4:1 demand-to-supply ratio means a 2.0x surge.
We smooth with an Exponential Moving Average: with . This dampens oscillation while still responding to genuine demand shifts.
Surge computation runs as a batch job every 60 seconds per cell. At 500K H3 cells covering active cities, that is 500K computations per minute.