Proof of Concept

Gas Price Forecaster

AI-Powered Predictions to Optimize Blockchain Transaction Costs
AI
Machine Learning
Blockchain
Benefits
Savings on Transaction Costs
Reduced Network Congestion
Scalable and Accessible
Consensys
Overview

The AI-driven forecasting model helped predict Ethereum gas price fluctuations 5 minutes into the future, giving users and applications actionable insights to reduce transaction costs and optimize network performance. This solution will introduce cost savings, improved time management, and scalability through API-driven deployment using AWS infrastructure

Live API Coming Soon ...
Context

The Gas Price Forecaster was developed by Flexa as a proof of concept for organizations and developers within the blockchain ecosystem, particularly for those dealing with high transaction costs on Ethereum. With frequent fluctuations in gas prices, blockchain users faced unpredictability and inefficiencies that impacted transaction success rates and costs.

Challenge

Fluctuating Ethereum gas fees presented a critical problem for users and applications trying to optimize costs and performance. Without real-time visibility into future gas prices, transactions were frequently delayed or executed at higher fees. The lack of reliable forecasts resulted in significant cost inefficiencies.

Solution

Flexa's AI-powered forecasting System leveraged TensorFlow, Node.js, Infura and Web3.js to predict transaction costs 5 minutes into the future based on historical blockchain data.

Enabling Smarter Decisions Beyond Gas Prices

The success of this gas price forecaster demonstrates the potential for AI-driven prediction models to optimize costs and operations in blockchain and beyond. Its modular architecture can be extended to other pricing-sensitive domains like decentralized exchanges, staking platforms, and NFT marketplaces, helping users and businesses make informed, cost-effective decisions.

Key Components:
  • Historical Indexer
    Collecting and batching transaction data using Infura APIs
  • Data Processing Pipeline
    Organizing and rebatching data for efficient machine learning input
  • Custom Machine Learning Model
    Trained on Ethereum blockchain data with an adaptive learning rate and custom loss functions to prioritize movement direction accuracy
  • Developer-Friendly Deployment
    A scalable, easy-to-use API was built using AWS services (S3 and Cloudfront CDN), providing real-time, read-only forecasts that developers and dApps can seamlessly integrate into their workflows for instant access to gas price predictions
Training Details
  • Training Data
    Ethereum blockchain data from Goerli testnet and mainnet
  • Data Augmentation
    Historical block frames created at different time resolutions and prediction offsets
  • Randomization
    Data frames were randomly ordered to prevent over-fitting seasonal patterns
  • Custom Loss Function
    Prioritized directional prediction (up/down movement) over magnitude to optimize actionable decisions
Live API Coming Soon ...