Overview
Add a GET /api/fees/recommend endpoint that reads the latest fee stats already stored in SQLite and returns an optimal fee suggestion based on current network congestion. No new Horizon calls needed — all data is derived from what we already collect.
Recommendation Logic
Congestion is derived from the ratio of avg_fee to base_fee:
- LOW (ratio < 1.5×) → recommend
p20
- MEDIUM (ratio 1.5–3×) → recommend
p50
- HIGH (ratio > 3×) → recommend
p70
Response Shape
{
"recommended_fee": 120,
"congestion": "LOW",
"basis": "p20",
"base_fee": 100,
"avg_fee": 110,
"timestamp": "2026-03-21T10:00:00Z"
}
Acceptance Criteria
Notes
- No new database tables or migrations needed
- Congestion thresholds can be made configurable via env vars in a future iteration
- Related frontend issue:
[Phase 2] feat(ui): dashboard — fee recommendation widget
Overview
Add a
GET /api/fees/recommendendpoint that reads the latest fee stats already stored in SQLite and returns an optimal fee suggestion based on current network congestion. No new Horizon calls needed — all data is derived from what we already collect.Recommendation Logic
Congestion is derived from the ratio of
avg_feetobase_fee:p20p50p70Response Shape
{ "recommended_fee": 120, "congestion": "LOW", "basis": "p20", "base_fee": 100, "avg_fee": 110, "timestamp": "2026-03-21T10:00:00Z" }Acceptance Criteria
GET /api/fees/recommendreturns the above response shapeNotes
[Phase 2] feat(ui): dashboard — fee recommendation widget