Gas Price Prediction Model Backtester
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Gas Price Prediction Model Backtester evaluates the accuracy of gas price prediction models using historical blockchain data. The tool fetches historical gas prices from a user-specified block range, splits the data into training and test sets, then applies a configurable prediction model to generate forecasts for the test period. It calculates key performance metrics including Mean Absolute Error (MAE), Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and R² score. The tool provides a configurable moving-average based model with parameters for window size, percentile, and multiplier—all adjustable via JSON input. Results are displayed with color-coded metric cards, a detailed sample prediction table showing actual vs predicted values with error indicators, and exportable results. This enables developers and analysts to test and refine gas price prediction strategies before deploying them in production.
HOW TO USE
Enter a starting block number and optionally an ending block number (defaults to latest). Specify the number of blocks to use for training (model fitting) and testing (backtest evaluation). Provide model parameters as a JSON object with fields: "window" (number of recent blocks to average), "percentile" (percentile of the window to use, 0-100), and "multiplier" (scaling factor applied to the prediction). For example, {"window": 20, "percentile": 50, "multiplier": 1.2} uses the median of the last 20 blocks and adds a 20% buffer. Click "Run backtest" to fetch historical data and evaluate the model. Results display four metric cards with color coding, a sample of predictions vs actuals, and a summary of training/test sizes and parameters used.
TECHNICAL MECHANISM: ROLLING WINDOW PREDICTION WITH STATISTICAL AGGREGATION
The tool fetches gas prices from historical blocks using chunked parallel requests to respect RPC rate limits. It then splits the data sequentially: the first N blocks for training and the next M blocks for testing. The prediction model operates as a rolling window: for each test block, it uses the most recent (training + all previous test) prices up to that point, applies the configured window size to select recent prices, computes the specified percentile, and multiplies by the multiplier factor. This simulates a realistic prediction scenario where only past data is available. After generating predictions, the tool calculates MAE (average absolute error), RMSE (square root of mean squared error), MAPE (percentage error), and R² (coefficient of determination). The tool also displays a sample of predictions with actual values and error tags, providing visual insight into model performance. The entire backtest runs client-side, with all data fetched via the connected wallet provider.
WHAT IT CANNOT SEE
Cannot predict future gas prices with certainty—backtest results are historical and may not generalize. Cannot account for sudden network changes or events that affect gas prices (e.g., major protocol launches, network upgrades). Cannot include real-time mempool data in backtests, which would improve short-term predictions. Cannot guarantee that the backtest methodology matches all real-world conditions—the simulation is simplified. Cannot detect overfitting in the prediction model; users must assess whether the model is too tightly tuned to historical data. Cannot compare models automatically; users must run separate tests with different parameters. Cannot validate that the prediction parameters are optimal for the given data. Cannot account for differences in gas price calculation between EIP-1559 and pre-EIP-1559 blocks automatically. Cannot provide live trading or transaction execution recommendations. Cannot ensure the provider's historical data is complete for all queried blocks.
PLEASE NOTE
EVM chains only. This tool reads on-chain data via the connected wallet's provider but does not write anything. Backtest results are for educational and analytical purposes only—they do not guarantee future performance.