Overview
Before funding an escrow, users want to know how much the Stellar network fee will be, in both XLM and their local currency. A fee estimator widget fetches real-time fee percentile data from Horizon, shows a cost breakdown, and recommends whether a fee-bump might be needed.
What to build
FeeEstimatorWidget component, embedded in the escrow creation wizard and on the escrow detail page before any transaction action
- Data: call
GET /api/v1/fees/estimate (backend endpoint) which aggregates:
- Horizon
fee_stats endpoint (/fee_stats): p10, p50, p95, p99 fee percentiles in stroops
- XLM/USD live rate (from the full-stack oracle, or fallback to Coingecko)
- Soroban resource fee for the specific operation type (from simulation result if available)
- Display:
- Three tiers: "Slow (p10)", "Standard (p50)", "Fast (p95)" — each showing XLM cost and USD equivalent
- Currently selected fee is highlighted; user can click to select a different tier
- "Soroban resource fee" shown separately as a non-negotiable add-on
- Warning badge if
p99 > 3× p50 (network congestion indicator)
- Fee-bump recommendation: if current
p50 < previous_p50 * 0.5 (fee dropped significantly), suggest the user is likely fine without a bump; if p50 > previous_p50 * 2, suggest including a fee-bump budget
- Auto-refresh every 30s; countdown timer showing next refresh
- Backend
GET /api/v1/fees/estimate?operation_type=fund_escrow — returns the combined fee data; caches Horizon fee_stats for 15s in Redis
Acceptance Criteria
Technical notes
- Backend caches
GET /fee_stats response for 15s; key: stellar:fee_stats:{network}
- Soroban resource fee is operation-specific; for the
fund_escrow type, use the 90th-percentile simulation result from the last 100 simulations stored in the DB
Overview
Before funding an escrow, users want to know how much the Stellar network fee will be, in both XLM and their local currency. A fee estimator widget fetches real-time fee percentile data from Horizon, shows a cost breakdown, and recommends whether a fee-bump might be needed.
What to build
FeeEstimatorWidgetcomponent, embedded in the escrow creation wizard and on the escrow detail page before any transaction actionGET /api/v1/fees/estimate(backend endpoint) which aggregates:fee_statsendpoint (/fee_stats):p10,p50,p95,p99fee percentiles in stroopsp99 > 3× p50(network congestion indicator)p50 < previous_p50 * 0.5(fee dropped significantly), suggest the user is likely fine without a bump; ifp50 > previous_p50 * 2, suggest including a fee-bump budgetGET /api/v1/fees/estimate?operation_type=fund_escrow— returns the combined fee data; caches Horizon fee_stats for 15s in RedisAcceptance Criteria
onFeeSelected(fee_stroops: bigint)p99 > 3 * p50; threshold is configurable via env varrole="radio"; congestion warning hasrole="alert"Technical notes
GET /fee_statsresponse for 15s; key:stellar:fee_stats:{network}fund_escrowtype, use the 90th-percentile simulation result from the last 100 simulations stored in the DB