deep_gas_oracle
deep_gas_oracle copied to clipboard
Unofficial implementation of the paper: "Step on the Gas? A Better Approach for Recommending the Ethereum Gas Price"
Ethereum Deep Gas Price Oracle
This is an unofficial implementation of the paper: Step on the Gas? A Better Approach for Recommending the Ethereum Gas Price (by Sam M. Werner, Paul J. Pritz, Daniel Perez)!
Table of Contents
About The Project
This is a price gas recommender for the Ethereum network. The network is trained to
predict the next S
th prices (with a resampling over 5 minutes periods). As the minimum
gas price is very noisy, the idea is to predict the prices on the next minutes/hours.
From thoses predictions the algorithm will return a recommended price,
taking into account the slope of the predictions.
Few plots from this repository:
Note: We try to forecast the minimum eth gas price over the next 3 hours.
The loss of the GRU model:
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/loss.png)
Model first timestamp predictions (5min) on the test range:
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/predictions_5min.png)
Some predictions over the 3 hours:
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/pred_3h_1.png)
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/pred_3h_2.png)
Results of the simulation between the block 8965759
and the block 8995344
:
DEEP GAS ORACLE :
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/results_deep_gas_oracle.png)
GETH (my implementation):
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/results_geth.png)
As a comparison, here is the paper original results:
![](https://github.com/louisoutin/deep_gas_oracle/raw/master/images/paper_results.png)
Note: I just tried a few different hyper-parameters but didn't have time to tune them yet. My results are not as good as the paper but close to it.
Built With
- Python
- Pytorch
- Pandas & Numpy
- Notebooks for visualisations
Getting Started
Follow the notebooks.
Prerequisites
This run on python 3, you can find the requirements in : requirements.txt
Note: you need to have pip installed
Datasets
To download the raw datasets, you need a google api key to use the BigQuery
service to be able to fetch historical eth blocks information.
Once you have the key, place the json
file in the credentials/
folder.
For the eth price, you can download it here on Kaggle.
You should put the ETH price csv
file in the datasets/
folder.
Installation
1 - Clone this repo
2 - Install the package with pip:
pip install .
Usage
You can run the notebooks to:
- 01 -> Explore the data and preprocess it
- 02 -> Modelise the minimum gas prices (5min avg) with a GRU neural-network
- 03 -> Evaluate the recommendation made by the deep oracle VS "Geth strategy"
License
Distributed under the MIT License. See LICENSE
for more information.