In this notebook we perform Exploratory Data Analysis (EDA) on FIL's gas fee mechanism. The goal is to observe the gas fee as a signal and attempt to understand what may be driving it.
Access was obtained to Sentinel from Filecoin, and based on previous Block Science data work, we believe the the gas information is in the messages or message_gas_economy tables. Update: based on discussion with Filecoin, the derived_gas_outputs table is used as the primary data gathering table. Sentinel's Data Dictionary was obtained on 6/28/2021 and will drive subsquent analysis.
Note: this description is copied from the official Filecoin documentation
Executing messages, for example by including transactions or proofs in the chain, consumes both computation and storage resources on the network. Gas is a measure of resources consumed by messages. The gas consumed by a message directly affects the cost that the sender has to pay for it to be included in a new block by a miner.
Historically in other blockchains, miners specify a GasFee in a unit of native currency and then pay the block producing miners a priority fee based on how much gas is consumed by the message. Filecoin works similarly, except an amount of the fees is burned (sent to an irrecoverable address) to compensate for the network expenditure of resources, since all nodes need to validate the messages. The idea is based on Ethereum's EIP1559.
The amount of fees burned in the Filecoin network comes given by a dynamic BaseFee which gets automatically adjusted according to the network congestion parameters (block sizes). The current value can be obtained from one of the block explorers or by inspecting the current head.
Additionally, a number of gas-related parameters are attached to each message and determine the amount of rewards that miners get. Here's an overview of the terms and concepts:
GasUsage: the amount of gas that a message's execution actually consumes. Current protocol does not know how much gas a message will exactly consume ahead of execution, but it can be estimated (see prices (opens new window)). GasUsage measured in units of Gas.
BaseFee: the amount of FIL that gets burned per unit of gas consumed for the execution of every message. It is measured in units of attoFIL/Gas.
GasLimit: the limit on the amount of gas that a message's execution can consume, estimated and specified by a message sender. It is measured in units of Gas. The sum of GasLimit for all messages included in a block must not exceed the BlockGasLimit. Messages will fail to execute if they run out of Gas, and any effects of the execution will be reverted.
GasFeeCap: the maximum token amount that a sender is willing to pay per GasUnit for including a message in a block. It is measured in units of attoFIL/Gas. A message sender must have a minimum balance of GasFeeCap * GasLimit when sending a message, even though not all of that will be consumed. GasFeeCap can serve as a safeguard against high, unexpected BaseFee fluctuations.
GasPremium: a priority fee that is paid to the block-producing miner. This is capped by GasFeeCap. The BaseFee has a higher priority. It is measured in units of attoFIL/Gas and can be as low as 1 attoFIL/Gas.
Overestimation burn: an additional amount of gas to burn that grows larger when the difference between GasLimit and GasUsage is large.
The total cost of a message for a sender will be:
An important detail is that a message will always pay the burn fee, regardless of the GasFeeCap used. Thus, a low GasFeeCap may result in a reduced GasPremium or even a negative one! In that case, the miners that include a message will have to pay the needed amounts out of their own pockets, which means they are unlikely to include such messages in new blocks.
Filecoin implementations may choose the heuristics of how their miners select messages for inclusion in new blocks, but they will usually attempt to maximize the miner's rewards.

We are performing a vector autoregression (VAR) to determine if a casual or multi-causal relationship exists between the gas signals moves. This will help us understand the system-level dynamics of Filecoin.
Vector autoregression (VAR) is a type of statistical model used to capture the relationship between multiple time series signals as they change over time. VAR models are extensions of univariate autoregression models allowing for multivariate time series analysis.
Autoregressive models use lagged past values of the variable and have an order based on how many times the variable has been lagged, i.e. VAR(2) means two lagged values. Lagged values help to determine if seasonality or reoccurring patterns exist in the data.
A pth-order VAR model is written as: $$y_t = c + A_1 y_{t-1} + A_2 y_{t-2} + \cdots + A_p y_{t-p} + e_t,$$
In vector notation, a VAR(1) with 2 variables is:
$$\begin{bmatrix}y_{1,t} \\ y_{2,t}\end{bmatrix} = \begin{bmatrix}c_{1} \\ c_{2}\end{bmatrix} + \begin{bmatrix}a_{1,1}&a_{1,2} \\ a_{2,1}&a_{2,2}\end{bmatrix}\begin{bmatrix}y_{1,t-1} \\ y_{2,t-1}\end{bmatrix} + \begin{bmatrix}e_{1,t} \\ e_{2,t}\end{bmatrix}$$For our VAR model, we will have a vector of gas signals.
Non-parametric Bayesian VAR models have been under development and appear to perform well and can operate on nonlinear relationships, heteroscedasticity, and non-Gaussian error data[1,2].
Another popular time series analysis modeling technique is the Autoregressive Integrated Moving Average (ARIMA) model. These models are often used in forecasting or when the data shows evidence of non-stationarity. For multiple time series vectors, as we have here, extensions of the ARIMA model are available, such ARIMAX model that has exogenous variable inputs. ARIMAX models do not have an assumption of Gaussian errors as it uses a maximum likelihood estimation function to fit.
We have taken the trade-off in assumption for this first version correlation model vs a non-parametric approach for simplicity's sake, that current robust python VAR implementations exist, and for illustrative purposes around the concepts, we are addressing.
# import libraries
from sqlalchemy import create_engine
import pandas as pd
from datetime import datetime
from statsmodels.tsa.api import VAR
from sklearn.preprocessing import StandardScaler
from statsmodels.tsa.stattools import adfuller
from math import sqrt
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as stats
import numpy as np
from Cryptoeconomics_signal_processing import time_analysis, fourier_transform, phase_shift_overlay
%matplotlib inline
import warnings
warnings.simplefilter('ignore')
# load connection string
CONN_STRING_PATH = '../config/sentinel_conn_string_andrew.txt'
with open(CONN_STRING_PATH, 'r') as fid:
conn_string = fid.read()
# create database connection.
connection = create_engine(conn_string, pool_recycle=3600).connect()
Below we download hourly averages from the derived_gas_outputs table from May 1st, 2021 to present (last refreshed 6/28/2021). After downloading the data, we few the first and lasts 5 rows, and perform basic statistics on the data.
derived_gas_outputs - coped from Sentinel's Data Dictionary¶Derived gas costs resulting from execution of a message in the VM.
| Name | Type | Nullable | Description |
|---|---|---|---|
actor_name |
text |
NO | Human readable identifier for the type of the actor. |
base_fee_burn |
text |
NO | The amount of FIL (in attoFIL) to burn as a result of the base fee. It is parent_base_fee (or gas_fee_cap if smaller) multiplied by gas_used. Note: successfull window PoSt messages are not charged this burn. |
cid |
text |
NO | CID of the message. |
exit_code |
bigint |
NO | The exit code that was returned as a result of executing the message. Exit code 0 indicates success. Codes 0-15 are reserved for use by the runtime. Codes 16-31 are common codes shared by different actors. Codes 32+ are actor specific. |
from |
text |
NO | Address of actor that sent the message. |
gas_burned |
bigint |
NO | The overestimated units of gas to burn. It is a portion of the difference between gas_limit and gas_used. |
gas_fee_cap |
text |
NO | The maximum price that the message sender is willing to pay per unit of gas. |
gas_limit |
bigint |
YES | A hard limit on the amount of gas (i.e., number of units of gas) that a message’s execution should be allowed to consume on chain. It is measured in units of gas. |
gas_premium |
text |
NO | The price per unit of gas (measured in attoFIL/gas) that the message sender is willing to pay (on top of the BaseFee) to "tip" the miner that will include this message in a block. |
gas_refund |
bigint |
NO | The overestimated units of gas to refund. It is a portion of the difference between gas_limit and gas_used. |
gas_used |
bigint |
NO | A measure of the amount of resources (or units of gas) consumed, in order to execute a message. |
height |
bigint |
NO | Epoch this message was executed at. |
method |
bigint |
YES | The method number to invoke. Only unique to the actor the method is being invoked on. A method number of 0 is a plain token transfer - no method exectution. |
miner_penalty |
text |
NO | Any penalty fees (in attoFIL) the miner incured while executing the message. |
miner_tip |
text |
NO | The amount of FIL (in attoFIL) the miner receives for executing the message. Typically it is gas_premium * gas_limit but may be lower if the total fees exceed the gas_fee_cap. |
nonce |
bigint |
YES | The message nonce, which protects against duplicate messages and multiple messages with the same values. |
over_estimation_burn |
text |
NO | The fee to pay (in attoFIL) for overestimating the gas used to execute a message. The overestimated gas to burn (gas_burned) is a portion of the difference between gas_limit and gas_used. The over_estimation_burn value is gas_burned * parent_base_fee. |
parent_base_fee |
text |
NO | The set price per unit of gas (measured in attoFIL/gas unit) to be burned (sent to an unrecoverable address) for every message execution. |
refund |
text |
NO | The amount of FIL (in attoFIL) to refund to the message sender after base fee, miner tip and overestimation amounts have been deducted. |
size_bytes |
bigint |
YES | Size in bytes of the serialized message. |
state_root |
text |
NO | CID of the parent state root. |
to |
text |
NO | Address of actor that received the message. |
value |
text |
NO | The FIL value transferred (attoFIL) to the message receiver. |
QUERY = """
SELECT
date_trunc('minute',
to_timestamp(height_to_unix(d.height))) AS timestamp,
AVG(CAST(gas_fee_cap AS FLOAT)) AS mean_gas_fee_cap,
AVG(CAST(gas_premium AS FLOAT)) as mean_gas_premium,
AVG(CAST(gas_limit AS FLOAT)) as mean_gas_limit,
AVG(CAST(gas_used AS FLOAT)) as mean_gas_used,
AVG(CAST(parent_base_fee AS FLOAT)) as mean_parent_base_fee,
AVG(CAST(base_fee_burn AS FLOAT)) as mean_base_fee_burn,
AVG(CAST(over_estimation_burn AS FLOAT)) as mean_over_estimation_burn,
AVG(CAST(gas_refund AS FLOAT)) as mean_gas_refund,
AVG(CAST(gas_burned AS FLOAT)) as mean_gas_burned
FROM derived_gas_outputs d
WHERE
to_timestamp(height_to_unix(d.height)) BETWEEN '2021-06-01' AND '2021-06-30'
GROUP BY
timestamp
"""
derived_gas_outputs_minutes = (pd.read_sql(QUERY, connection))
derived_gas_outputs_minutes
| timestamp | mean_gas_fee_cap | mean_gas_premium | mean_gas_limit | mean_gas_used | mean_parent_base_fee | mean_base_fee_burn | mean_over_estimation_burn | mean_gas_refund | mean_gas_burned | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2021-06-01 00:00:00+00:00 | 8.029010e+09 | 101728.474840 | 3.853911e+07 | 3.154444e+07 | 107.508692 | 3.344824e+09 | 1.379284e+08 | 5.712949e+06 | 1.281725e+06 |
| 1 | 2021-06-01 00:01:00+00:00 | 5.514969e+09 | 101091.411072 | 3.551579e+07 | 2.902460e+07 | 104.134276 | 2.964455e+09 | 1.137286e+08 | 5.395994e+06 | 1.095194e+06 |
| 2 | 2021-06-01 00:02:00+00:00 | 1.391597e+09 | 101666.874747 | 3.925006e+07 | 3.176285e+07 | 106.288889 | 3.336958e+09 | 1.693683e+08 | 5.889824e+06 | 1.597390e+06 |
| 3 | 2021-06-01 00:03:00+00:00 | 1.757485e+10 | 97440.471254 | 3.993927e+07 | 3.258712e+07 | 107.122526 | 3.442124e+09 | 1.394680e+08 | 6.046530e+06 | 1.305622e+06 |
| 4 | 2021-06-01 00:04:00+00:00 | 6.449984e+09 | 100270.025472 | 3.896426e+07 | 3.207390e+07 | 100.000000 | 3.121567e+09 | 1.184643e+08 | 5.705719e+06 | 1.184643e+06 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 41752 | 2021-06-29 23:56:00+00:00 | 1.964213e+09 | 104006.563006 | 3.663438e+07 | 3.001272e+07 | 100.000000 | 2.928661e+09 | 1.311436e+08 | 5.310222e+06 | 1.311436e+06 |
| 41753 | 2021-06-29 23:57:00+00:00 | 1.862782e+09 | 98093.022059 | 3.920272e+07 | 3.209269e+07 | 100.000000 | 3.124513e+09 | 1.395432e+08 | 5.714594e+06 | 1.395432e+06 |
| 41754 | 2021-06-29 23:58:00+00:00 | 1.844506e+09 | 85967.566602 | 3.556848e+07 | 2.892415e+07 | 100.000000 | 2.812896e+09 | 1.484183e+08 | 5.160143e+06 | 1.484183e+06 |
| 41755 | 2021-06-29 23:59:00+00:00 | 1.908790e+09 | 102404.667047 | 3.641373e+07 | 2.956544e+07 | 100.000000 | 2.875591e+09 | 1.360852e+08 | 5.487441e+06 | 1.360852e+06 |
| 41756 | 2021-06-30 00:00:00+00:00 | 1.850816e+09 | 103272.226103 | 3.715575e+07 | 3.063663e+07 | 104.000000 | 3.151263e+09 | 1.049957e+08 | 5.509554e+06 | 1.009574e+06 |
41757 rows × 10 columns
derived_gas_outputs = derived_gas_outputs_minutes
derived_gas_outputs.describe()
| mean_gas_fee_cap | mean_gas_premium | mean_gas_limit | mean_gas_used | mean_parent_base_fee | mean_base_fee_burn | mean_over_estimation_burn | mean_gas_refund | mean_gas_burned | |
|---|---|---|---|---|---|---|---|---|---|
| count | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 | 4.175700e+04 |
| mean | 8.521364e+09 | 1.323306e+06 | 3.973375e+07 | 3.216062e+07 | 5.359236e+08 | 1.706906e+16 | 9.507279e+14 | 5.790445e+06 | 1.782680e+06 |
| std | 4.602994e+09 | 7.320768e+06 | 4.017905e+06 | 2.095491e+06 | 5.213674e+08 | 1.673393e+16 | 1.268424e+15 | 4.528739e+05 | 3.087213e+06 |
| min | 5.746347e+08 | 8.200945e+04 | 2.428070e+07 | 1.408784e+07 | 1.000000e+02 | 2.016133e+09 | 7.553782e+07 | 2.687929e+06 | 6.165379e+05 |
| 25% | 5.243073e+09 | 1.093387e+05 | 3.779685e+07 | 3.086167e+07 | 8.113382e+07 | 2.473543e+15 | 1.209163e+14 | 5.504593e+06 | 1.252241e+06 |
| 50% | 8.228072e+09 | 2.773531e+05 | 3.921610e+07 | 3.193073e+07 | 4.449355e+08 | 1.418880e+16 | 6.355366e+14 | 5.749836e+06 | 1.494860e+06 |
| 75% | 1.108246e+10 | 8.126711e+05 | 4.097014e+07 | 3.319091e+07 | 9.149371e+08 | 2.960857e+16 | 1.432300e+15 | 6.026875e+06 | 1.855327e+06 |
| max | 2.011381e+11 | 7.990103e+08 | 1.974523e+08 | 5.744429e+07 | 6.147238e+09 | 1.944513e+17 | 9.875548e+16 | 9.705887e+06 | 1.746765e+08 |
We will plot each signal, save for the timestamp, below and perform Fourier transforms to search for periodicity.
A Fourier transform (FT) is a mathematical method for decomposing a signal into a sum of periodic components. Used frequently in signal processing to understand trends and for filtering. we will use the common Fast Fourier Transform (FFT) algorithm to calculate discrete Fourier transform (DFT) of each signal.
derived_gas_outputs, mean_gas_fee_cap_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_fee_cap',10)
Fourier Transform of mean_gas_fee_cap with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_gas_fee_cap',kind='line',title='Mean Gas Fee Cap')
print('The maximum price that the message sender is willing to pay per unit of gas')
The maximum price that the message sender is willing to pay per unit of gas
derived_gas_outputs.plot(x='timestamp',y='mean_gas_premium',kind='line',title='Mean Gas Premium')
print('The price per unit of gas (measured in attoFIL/gas) that the message sender is willing to pay (on top of the BaseFee) to "tip" the miner that will include this message in a block.')
The price per unit of gas (measured in attoFIL/gas) that the message sender is willing to pay (on top of the BaseFee) to "tip" the miner that will include this message in a block.
derived_gas_outputs, mean_gas_premium_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_premium',10)
Fourier Transform of mean_gas_premium with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_gas_limit',kind='line',title='Mean Gas Limit')
print('A hard limit on the amount of gas (i.e., number of units of gas) that a message’s execution should be allowed to consume on chain. It is measured in units of gas.')
A hard limit on the amount of gas (i.e., number of units of gas) that a message’s execution should be allowed to consume on chain. It is measured in units of gas.
derived_gas_outputs, mean_gas_limit_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_limit',10)
Fourier Transform of mean_gas_limit with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_gas_used',kind='line',title='Mean Gas Used')
print('A measure of the amount of resources (or units of gas) consumed, in order to execute a message.')
A measure of the amount of resources (or units of gas) consumed, in order to execute a message.
derived_gas_outputs, mean_gas_used_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_used',10)
Fourier Transform of mean_gas_used with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_parent_base_fee',kind='line',title='Mean Parent Base Fee')
print('he set price per unit of gas (measured in attoFIL/gas unit) to be burned (sent to an unrecoverable address) for every message execution.')
he set price per unit of gas (measured in attoFIL/gas unit) to be burned (sent to an unrecoverable address) for every message execution.
derived_gas_outputs, mean_parent_base_fee_decomposed = fourier_transform(derived_gas_outputs,'mean_parent_base_fee',10)
Fourier Transform of mean_parent_base_fee with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_base_fee_burn',kind='line',title='Mean Base Fee Burn')
print('he amount of FIL (in attoFIL) to burn as a result of the base fee. It is parent_base_fee (or gas_fee_cap if smaller) multiplied by gas_used. Note: successfull window PoSt messages are not charged this burn.')
he amount of FIL (in attoFIL) to burn as a result of the base fee. It is parent_base_fee (or gas_fee_cap if smaller) multiplied by gas_used. Note: successfull window PoSt messages are not charged this burn.
derived_gas_outputs, mean_base_fee_burn_decomposed = fourier_transform(derived_gas_outputs,'mean_base_fee_burn',10)
Fourier Transform of mean_base_fee_burn with 10 components.
derived_gas_outputs.plot(x='timestamp',y='mean_gas_burned',kind='line',title='Mean Gas Burned')
print('The overestimated units of gas to burn. It is a portion of the difference between gas_limit and gas_used.')
The overestimated units of gas to burn. It is a portion of the difference between gas_limit and gas_used.
derived_gas_outputs, mean_gas_burned_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_burned',10)
Fourier Transform of mean_gas_burned with 10 components.
derived_gas_outputs, mean_over_estimation_burn_decomposed = fourier_transform(derived_gas_outputs,'mean_over_estimation_burn',10)
Fourier Transform of mean_over_estimation_burn with 10 components.
derived_gas_outputs, mean_gas_refund_decomposed = fourier_transform(derived_gas_outputs,'mean_gas_refund',10)
Fourier Transform of mean_gas_refund with 10 components.
The data is a relatively consistent, stochastic trend save for several orders of magnitude spike one June 3rd. Mean_gas_burned shows the spike in gas burned the best, with mean_gas_burned being the hourly average of the overestimated units of gas. We will need to examine the meta-information from the messages to understand in more detail to understand why the spike occured. This will also mean querying disaggregated data to understand who the actors are and what transactions they are making.
derived_gas_outputs.query('mean_gas_burned > 4000000')
| timestamp | mean_gas_fee_cap | mean_gas_premium | mean_gas_limit | mean_gas_used | mean_parent_base_fee | mean_base_fee_burn | mean_over_estimation_burn | mean_gas_refund | mean_gas_burned | mean_gas_fee_cap_decomposed | mean_gas_premium_decomposed | mean_gas_limit_decomposed | mean_gas_used_decomposed | mean_parent_base_fee_decomposed | mean_base_fee_burn_decomposed | mean_gas_burned_decomposed | mean_over_estimation_burn_decomposed | mean_gas_refund_decomposed | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2236 | 2021-06-02 13:17:00+00:00 | 6.880334e+09 | 1.028916e+05 | 4.379041e+07 | 3.303338e+07 | 5.892028e+04 | 1.910384e+12 | 2.849939e+11 | 5.908677e+06 | 4.848352e+06 | 7.394618e+09-3.328597e+08j | 1.968436e+06+1.503250e+04j | 4.016501e+07-9.817112e+04j | 3.162625e+07-1.379628e+05j | 1.527365e+08-4.283727e+07j | 4.789688e+15-1.461539e+15j | 2.937958e+06+7.888874e+04j | 4.969613e+14-6.890039e+13j | 5.600810e+06-3.909709e+04j |
| 3039 | 2021-06-03 02:40:00+00:00 | 6.216043e+09 | 1.086384e+05 | 3.943075e+07 | 2.905696e+07 | 2.320815e+08 | 6.618230e+15 | 1.230400e+15 | 5.070770e+06 | 5.303028e+06 | 8.045598e+09+6.761111e+07j | 2.343323e+06+8.486203e+04j | 4.040886e+07-8.242652e+04j | 3.176705e+07-6.666149e+04j | 1.856327e+08+2.930799e+07j | 5.854399e+15+8.567352e+14j | 3.057075e+06+1.253799e+04j | 5.817623e+14+5.007173e+13j | 5.584741e+06-2.830302e+04j |
| 3040 | 2021-06-03 02:41:00+00:00 | 7.759289e+09 | 1.063103e+05 | 3.819974e+07 | 2.917434e+07 | 2.242377e+08 | 6.481789e+15 | 9.452613e+14 | 4.851530e+06 | 4.173869e+06 | 8.046298e+09+6.812564e+07j | 2.343695e+06+8.493460e+04j | 4.040907e+07-8.238632e+04j | 3.176723e+07-6.655141e+04j | 1.856717e+08+2.939666e+07j | 5.855668e+15+8.596045e+14j | 3.057109e+06+1.244717e+04j | 5.818439e+14+5.021755e+13j | 5.584728e+06-2.828208e+04j |
| 3041 | 2021-06-03 02:42:00+00:00 | 6.149556e+09 | 5.103965e+06 | 4.105038e+07 | 2.960600e+07 | 2.280098e+08 | 6.650433e+15 | 1.428333e+15 | 5.200284e+06 | 6.244093e+06 | 8.046998e+09+6.864013e+07j | 2.344066e+06+8.500712e+04j | 4.040928e+07-8.234608e+04j | 3.176742e+07-6.644129e+04j | 1.857106e+08+2.948532e+07j | 5.856936e+15+8.624733e+14j | 3.057142e+06+1.235634e+04j | 5.819255e+14+5.036334e+13j | 5.584716e+06-2.826113e+04j |
| 3042 | 2021-06-03 02:43:00+00:00 | 4.483476e+09 | 5.208213e+06 | 3.972884e+07 | 3.054804e+07 | 2.446428e+08 | 7.372305e+15 | 9.584429e+14 | 5.137952e+06 | 4.042844e+06 | 8.047698e+09+6.915459e+07j | 2.344438e+06+8.507959e+04j | 4.040948e+07-8.230578e+04j | 3.176760e+07-6.633113e+04j | 1.857496e+08+2.957396e+07j | 5.858205e+15+8.653417e+14j | 3.057175e+06+1.226551e+04j | 5.820071e+14+5.050910e+13j | 5.584704e+06-2.824015e+04j |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 40036 | 2021-06-28 19:20:00+00:00 | 3.895368e+09 | 1.036406e+05 | 3.353871e+07 | 2.438100e+07 | 9.208987e+07 | 2.177260e+15 | 4.481456e+14 | 4.334035e+06 | 4.823676e+06 | 3.306311e+09+2.298777e+08j | -1.076618e+05-3.573204e+04j | 3.826904e+07+9.731593e+04j | 3.124257e+07+1.225814e+05j | -4.698576e+07+2.364208e+07j | -1.545628e+15+8.479236e+14j | 1.318906e+06-6.271755e+04j | -1.225238e+14+3.718095e+13j | 5.707558e+06+3.745210e+04j |
| 40041 | 2021-06-28 19:25:00+00:00 | 7.125505e+09 | 2.357576e+05 | 3.829947e+07 | 2.887418e+07 | 1.518404e+08 | 4.286679e+15 | 6.463920e+14 | 5.194119e+06 | 4.231175e+06 | 3.309859e+09+2.274398e+08j | -1.066158e+05-3.619609e+04j | 3.827025e+07+9.726542e+04j | 3.124271e+07+1.221893e+05j | -4.675369e+07+2.319375e+07j | -1.538308e+15+8.335624e+14j | 1.320029e+06-6.232627e+04j | -1.219731e+14+3.644069e+13j | 5.707516e+06+3.740244e+04j |
| 40050 | 2021-06-28 19:34:00+00:00 | 6.195647e+09 | 1.016941e+05 | 3.723291e+07 | 2.779434e+07 | 2.200852e+08 | 6.019152e+15 | 9.346961e+14 | 5.188579e+06 | 4.249998e+06 | 3.316272e+09+2.230433e+08j | -1.047172e+05-3.703008e+04j | 3.827245e+07+9.717103e+04j | 3.124295e+07+1.214791e+05j | -4.633449e+07+2.238592e+07j | -1.525085e+15+8.076827e+14j | 1.322064e+06-6.161974e+04j | -1.209772e+14+3.510693e+13j | 5.707439e+06+3.731171e+04j |
| 40051 | 2021-06-28 19:35:00+00:00 | 6.146174e+09 | 1.080770e+05 | 3.612844e+07 | 2.686453e+07 | 2.174846e+08 | 5.761894e+15 | 9.562606e+14 | 4.819727e+06 | 4.444183e+06 | 3.316987e+09+2.225541e+08j | -1.045049e+05-3.712264e+04j | 3.827270e+07+9.716027e+04j | 3.124298e+07+1.213998e+05j | -4.628780e+07+2.229610e+07j | -1.523613e+15+8.048048e+14j | 1.322291e+06-6.154107e+04j | -1.208662e+14+3.495864e+13j | 5.707430e+06+3.730153e+04j |
| 40066 | 2021-06-28 19:50:00+00:00 | 5.917843e+09 | 2.308893e+05 | 3.503719e+07 | 2.506527e+07 | 3.522965e+08 | 8.664560e+15 | 1.957967e+15 | 4.410808e+06 | 5.561113e+06 | 3.327764e+09+2.152022e+08j | -1.012918e+05-3.850850e+04j | 3.827642e+07+9.699222e+04j | 3.124340e+07+1.202028e+05j | -4.558465e+07+2.094728e+07j | -1.501432e+15+7.615836e+14j | 1.325723e+06-6.035674e+04j | -1.191918e+14+3.273187e+13j | 5.707299e+06+3.714621e+04j |
496 rows × 19 columns
Based on the message cost calculation outliend by Filecoin's official documentation, we will map the data obtained to this calculation.
Filecoin:
message_cost_calculation = GasUsage * BaseFee FIL (burned) + GasLimit * GasPremium FIL (miner reward) + OverEstimationBurn * BaseFee FIL
Our downloaded data:
message_cost = derived_gas_outputs.mean_gas_used * derived_gas_outputs.mean_base_fee_burn + derived_gas_outputs.mean_gas_limit * derived_gas_outputs.mean_gas_premium + derived_gas_outputs.mean_over_estimation_burn * derived_gas_outputs.mean_base_fee_burn
# create field
derived_gas_outputs['mean_message_cost'] = derived_gas_outputs.mean_gas_used * derived_gas_outputs.mean_base_fee_burn + derived_gas_outputs.mean_gas_limit * derived_gas_outputs.mean_gas_premium + derived_gas_outputs.mean_over_estimation_burn * derived_gas_outputs.mean_base_fee_burn
derived_gas_outputs.plot(x='timestamp',y='mean_message_cost',kind='line',title='Mean Message Cost')
<AxesSubplot:title={'center':'Mean Message Cost'}, xlabel='timestamp'>
derived_gas_outputs, mean_message_cost_decomposed = fourier_transform(derived_gas_outputs,'mean_message_cost',10)
Fourier Transform of mean_message_cost with 10 components.
Based on the Fourier decompositions, it appears that there is some periodicity to the data, with two spikes a week, approximately on Monday and Thursday.
To understand which signals may be leading or lagging indicators, we will overlay the fourier decomposed components, in pairs, for analysis.
phase_shift_overlay(derived_gas_outputs.timestamp,mean_gas_fee_cap_decomposed,mean_gas_premium_decomposed,
'mean_gas_fee_cap','mean_gas_premium')
Gas premium appears to be a leading indicator for gas fee cap. There is no phase shift (peak to peak distances line up).
phase_shift_overlay(derived_gas_outputs.timestamp,mean_gas_limit_decomposed,mean_gas_used_decomposed,
'mean_gas_limit','mean_gas_used')
Gas limit, at times, appears to be a slight leading indicator.
phase_shift_overlay(derived_gas_outputs.timestamp,mean_parent_base_fee_decomposed,mean_base_fee_burn_decomposed,
'mean_parent_base_fee','mean_base_fee')
phase_shift_overlay(derived_gas_outputs.timestamp,mean_message_cost_decomposed,mean_gas_refund_decomposed,
'mean_message_cost','mean_gas_refund')
Message cost, at times, appears to be a slight leading indicator.
phase_shift_overlay(derived_gas_outputs.timestamp,mean_gas_burned_decomposed,mean_gas_fee_cap_decomposed,
'mean_gas_burned','mean_gas_fee_Cap')
Gas burned appears to be a direct leading indicator. No phase shift present
Below we will normalize the signals by their individual max peaks so we can plot on one graph. We will use Matplotlib instead of Plotly due to the fact that Matplotlib handles complex numbers better.
def peak_normalization(array):
'''
'''
normalized = array / np.max(array)
return normalized
# normalize peaks
mean_gas_fee_cap_decomposed_normalized = peak_normalization(mean_gas_fee_cap_decomposed)
mean_gas_premium_decomposed_normalized = peak_normalization(mean_gas_premium_decomposed)
mean_gas_limit_decomposed_normalized = peak_normalization(mean_gas_limit_decomposed)
mean_gas_used_decomposed_normalized = peak_normalization(mean_gas_used_decomposed)
mean_base_fee_burn_decomposed_normalized = peak_normalization(mean_base_fee_burn_decomposed)
mean_message_cost_decomposed = peak_normalization(mean_message_cost_decomposed)
mean_gas_refund_decomposed = peak_normalization(mean_gas_refund_decomposed)
mean_gas_burned_decomposed = peak_normalization(mean_gas_burned_decomposed)
mean_gas_fee_cap_decomposed = peak_normalization(mean_gas_fee_cap_decomposed)
timestamps = derived_gas_outputs.timestamp
plt.figure(figsize=(15, 8))
plt.plot(timestamps,mean_gas_fee_cap_decomposed_normalized,label = 'mean_gas_fee_cap_decomposed_normalized')
plt.plot(timestamps,mean_gas_premium_decomposed_normalized, label ='mean_gas_premium_decomposed_normalized')
plt.plot(timestamps,mean_gas_limit_decomposed_normalized, label ='mean_gas_limit_decomposed_normalized')
plt.plot(timestamps,mean_gas_used_decomposed_normalized, label ='mean_gas_used_decomposed_normalized')
plt.plot(timestamps,mean_base_fee_burn_decomposed_normalized, label ='mean_base_fee_burn_decomposed_normalized')
plt.plot(timestamps,mean_message_cost_decomposed, label ='mean_message_cost_decomposed')
plt.plot(timestamps,mean_gas_refund_decomposed, label ='mean_gas_refund_decomposed')
plt.plot(timestamps,mean_gas_burned_decomposed, label ='mean_gas_burned_decomposed')
plt.plot(timestamps,mean_gas_fee_cap_decomposed, label ='mean_gas_fee_cap_decomposed')
plt.legend(bbox_to_anchor=(1.35, 1), loc='upper right', ncol=1)
plt.title('Decomposed Phase Shifts Overlay, normalize by max peaks')
Text(0.5, 1.0, 'Decomposed Phase Shifts Overlay, normalize by max peaks')
We will now remove the timestamp field and examine the data distributions and determine if any transformations are required prior to our VAR modeling.
del derived_gas_outputs['timestamp']
derived_gas_outputs = derived_gas_outputs[['mean_gas_fee_cap','mean_gas_premium','mean_gas_limit',
'mean_gas_used','mean_parent_base_fee','mean_base_fee_burn',
'mean_over_estimation_burn','mean_gas_refund','mean_gas_burned',
'mean_message_cost']]
derived_gas_outputs.hist(bins=30, figsize=(15, 10))
array([[<AxesSubplot:title={'center':'mean_gas_fee_cap'}>,
<AxesSubplot:title={'center':'mean_gas_premium'}>,
<AxesSubplot:title={'center':'mean_gas_limit'}>],
[<AxesSubplot:title={'center':'mean_gas_used'}>,
<AxesSubplot:title={'center':'mean_parent_base_fee'}>,
<AxesSubplot:title={'center':'mean_base_fee_burn'}>],
[<AxesSubplot:title={'center':'mean_over_estimation_burn'}>,
<AxesSubplot:title={'center':'mean_gas_refund'}>,
<AxesSubplot:title={'center':'mean_gas_burned'}>],
[<AxesSubplot:title={'center':'mean_message_cost'}>,
<AxesSubplot:>, <AxesSubplot:>]], dtype=object)
We can see from the above historgrams that besides mean_gas_used and mean_gas_refund our data is not normally distributed and will need to be transformed prior to modeling. We will take the log of the data to reduce the skewness and take the first difference to make the data stationary.
log_differenced = pd.DataFrame()
## Difference and log values
for i in derived_gas_outputs.columns:
log_differenced[i +'_log_differenced'] = np.log(derived_gas_outputs[i]).diff()
log_differenced.hist(bins=30, figsize=(15, 10))
array([[<AxesSubplot:title={'center':'mean_gas_fee_cap_log_differenced'}>,
<AxesSubplot:title={'center':'mean_gas_premium_log_differenced'}>,
<AxesSubplot:title={'center':'mean_gas_limit_log_differenced'}>],
[<AxesSubplot:title={'center':'mean_gas_used_log_differenced'}>,
<AxesSubplot:title={'center':'mean_parent_base_fee_log_differenced'}>,
<AxesSubplot:title={'center':'mean_base_fee_burn_log_differenced'}>],
[<AxesSubplot:title={'center':'mean_over_estimation_burn_log_differenced'}>,
<AxesSubplot:title={'center':'mean_gas_refund_log_differenced'}>,
<AxesSubplot:title={'center':'mean_gas_burned_log_differenced'}>],
[<AxesSubplot:title={'center':'mean_message_cost_log_differenced'}>,
<AxesSubplot:>, <AxesSubplot:>]], dtype=object)
# replace any NA values with zero
log_differenced.fillna(0,inplace=True)
As a final check prior to modeling, we will run the Augmented Dickey-Fuller test to ensure that our data is stationary (non-unit root - A unit root is a stochastic trend in a time series). The test's hypothesis are:
for i in log_differenced.columns:
print(i)
result = adfuller(log_differenced[i].values)
print('ADF Statistic: %f' % result[0])
print('p-value: %f' % result[1])
if result[1] > 0.05:
decision = "fail to reject - unit root present"
else:
decision = "reject, no unit root present"
print(decision)
print('----------------------------------')
mean_gas_fee_cap_log_differenced ADF Statistic: -35.830920 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_gas_premium_log_differenced ADF Statistic: -38.928561 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_gas_limit_log_differenced ADF Statistic: -36.661904 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_gas_used_log_differenced ADF Statistic: -41.286654 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_parent_base_fee_log_differenced ADF Statistic: -31.958570 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_base_fee_burn_log_differenced ADF Statistic: -26.964904 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_over_estimation_burn_log_differenced ADF Statistic: -26.470550 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_gas_refund_log_differenced ADF Statistic: -41.273145 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_gas_burned_log_differenced ADF Statistic: -39.830846 p-value: 0.000000 reject, no unit root present ---------------------------------- mean_message_cost_log_differenced ADF Statistic: -24.924426 p-value: 0.000000 reject, no unit root present ----------------------------------
Based on the Augmented Dickey-Fuller, our preprocessing was successful and none of our univariate time series signals as a unit root. We can now proceed to the VAR model.
To determine the ideal number of lags for our model, we will perform a heuristic SVD. We will fit our model with an autocorrelation between 1 and 15 to ascertain which VAR order has the best Akaike information criterion(AIC) score.
The Akaike information criterion (AIC) is an estimator of prediction error, rooted in information theory. Given a collection of models for the data, AIC estimates the quality of each model, relative to each of the other models as a means for model selection.
When a statistical model is used to represent the process that generated the data, the representation will rarely be exact; so some information will be lost by using the model to represent the process. AIC estimates the relative amount of information lost by a given model: the less information a model loses, the higher the quality of that model.
In estimating the amount of information lost by a model, AIC deals with the trade-off between the goodness of fit of the model and the simplicity of the model. In other words, AIC deals with both the risk of overfitting and the risk of underfitting.
Below is the equation for AIC where $\hat L$ is the maximum value of the likelihood function for the model:
$$\mathrm{AIC} \, = \, 2k - 2\ln(\hat L)$$Given a set of candidate models for the data, the preferred model is the one with the minimum AIC value, the sign of the data does not matter. AIC optimizes for the goodness of fit but also includes a penalty for each additional parameter, which discourages overfitting.
Paraphrased sources: * https://en.wikipedia.org/wiki/Akaike_information_criterionaic = []
for i in range(1,16):
model = VAR(log_differenced)
results = model.fit(i)
aic.append(results.aic)
plt.figure(figsize=(10, 8))
plt.plot(aic, 'r+')
plt.legend(['AIC'])
plt.xlabel('Autocorrelation Lag')
plt.ylabel('AIC')
plt.title('Plot of sweeps over lag depths over AIC Loss function')
plt.show()
Based on our analysis, a lag of 4 appears to be the optimal.
# instantiate the var model object from statsmodels
model = VAR(log_differenced)
# fit model with determined lag values
results = model.fit(4)
results.summary()
Summary of Regression Results
==================================
Model: VAR
Method: OLS
Date: Mon, 09, Aug, 2021
Time: 14:31:15
--------------------------------------------------------------------
No. of Equations: 10.0000 BIC: -59.5649
Nobs: 41753.0 HQIC: -59.6229
Log likelihood: 653238. FPE: 1.24298e-26
AIC: -59.6497 Det(Omega_mle): 1.23084e-26
--------------------------------------------------------------------
Results for equation mean_gas_fee_cap_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000088 0.001756 -0.050 0.960
L1.mean_gas_fee_cap_log_differenced -0.926166 0.004812 -192.451 0.000
L1.mean_gas_premium_log_differenced 0.002004 0.001623 1.235 0.217
L1.mean_gas_limit_log_differenced -0.019859 0.090517 -0.219 0.826
L1.mean_gas_used_log_differenced 0.817372 0.178225 4.586 0.000
L1.mean_parent_base_fee_log_differenced 1.517063 0.326686 4.644 0.000
L1.mean_base_fee_burn_log_differenced -1.578755 0.265188 -5.953 0.000
L1.mean_over_estimation_burn_log_differenced -0.213835 0.366469 -0.584 0.560
L1.mean_gas_refund_log_differenced -0.029044 0.044644 -0.651 0.515
L1.mean_gas_burned_log_differenced -0.453125 0.295238 -1.535 0.125
L1.mean_message_cost_log_differenced 0.638516 0.218598 2.921 0.003
L2.mean_gas_fee_cap_log_differenced -0.712913 0.006282 -113.479 0.000
L2.mean_gas_premium_log_differenced 0.001567 0.001967 0.796 0.426
L2.mean_gas_limit_log_differenced -0.152035 0.104146 -1.460 0.144
L2.mean_gas_used_log_differenced 1.272968 0.207643 6.131 0.000
L2.mean_parent_base_fee_log_differenced 1.329094 0.396134 3.355 0.001
L2.mean_base_fee_burn_log_differenced -1.429564 0.297407 -4.807 0.000
L2.mean_over_estimation_burn_log_differenced 0.405473 0.432918 0.937 0.349
L2.mean_gas_refund_log_differenced -0.045558 0.054669 -0.833 0.405
L2.mean_gas_burned_log_differenced -0.598998 0.361061 -1.659 0.097
L2.mean_message_cost_log_differenced 0.203629 0.240442 0.847 0.397
L3.mean_gas_fee_cap_log_differenced -0.463263 0.006290 -73.651 0.000
L3.mean_gas_premium_log_differenced -0.000339 0.001969 -0.172 0.863
L3.mean_gas_limit_log_differenced -0.043492 0.103970 -0.418 0.676
L3.mean_gas_used_log_differenced 0.892662 0.207701 4.298 0.000
L3.mean_parent_base_fee_log_differenced 0.634164 0.395952 1.602 0.109
L3.mean_base_fee_burn_log_differenced -0.640917 0.297493 -2.154 0.031
L3.mean_over_estimation_burn_log_differenced 0.906210 0.432628 2.095 0.036
L3.mean_gas_refund_log_differenced -0.043388 0.054622 -0.794 0.427
L3.mean_gas_burned_log_differenced -0.616812 0.360970 -1.709 0.087
L3.mean_message_cost_log_differenced -0.258234 0.240450 -1.074 0.283
L4.mean_gas_fee_cap_log_differenced -0.219684 0.004838 -45.405 0.000
L4.mean_gas_premium_log_differenced 0.001344 0.001627 0.826 0.409
L4.mean_gas_limit_log_differenced -0.004766 0.090170 -0.053 0.958
L4.mean_gas_used_log_differenced 0.166923 0.178080 0.937 0.349
L4.mean_parent_base_fee_log_differenced 0.049902 0.327087 0.153 0.879
L4.mean_base_fee_burn_log_differenced 0.461497 0.265014 1.741 0.082
L4.mean_over_estimation_burn_log_differenced 0.957590 0.365786 2.618 0.009
L4.mean_gas_refund_log_differenced -0.016484 0.044938 -0.367 0.714
L4.mean_gas_burned_log_differenced -0.296540 0.295240 -1.004 0.315
L4.mean_message_cost_log_differenced -0.621754 0.218564 -2.845 0.004
===============================================================================================================
Results for equation mean_gas_premium_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const 0.000004 0.004935 0.001 0.999
L1.mean_gas_fee_cap_log_differenced -0.008302 0.013526 -0.614 0.539
L1.mean_gas_premium_log_differenced -0.825817 0.004563 -180.996 0.000
L1.mean_gas_limit_log_differenced 1.252554 0.254404 4.923 0.000
L1.mean_gas_used_log_differenced -1.803649 0.500910 -3.601 0.000
L1.mean_parent_base_fee_log_differenced 1.426237 0.918167 1.553 0.120
L1.mean_base_fee_burn_log_differenced 0.594702 0.745323 0.798 0.425
L1.mean_over_estimation_burn_log_differenced -0.929215 1.029979 -0.902 0.367
L1.mean_gas_refund_log_differenced 0.070910 0.125474 0.565 0.572
L1.mean_gas_burned_log_differenced 0.967950 0.829782 1.167 0.243
L1.mean_message_cost_log_differenced -0.157100 0.614381 -0.256 0.798
L2.mean_gas_fee_cap_log_differenced -0.014022 0.017657 -0.794 0.427
L2.mean_gas_premium_log_differenced -0.673377 0.005530 -121.774 0.000
L2.mean_gas_limit_log_differenced 1.672261 0.292706 5.713 0.000
L2.mean_gas_used_log_differenced -4.309350 0.583592 -7.384 0.000
L2.mean_parent_base_fee_log_differenced -2.016475 1.113353 -1.811 0.070
L2.mean_base_fee_burn_log_differenced 2.299147 0.835877 2.751 0.006
L2.mean_over_estimation_burn_log_differenced -0.630473 1.216736 -0.518 0.604
L2.mean_gas_refund_log_differenced -0.040695 0.153649 -0.265 0.791
L2.mean_gas_burned_log_differenced 0.142538 1.014781 0.140 0.888
L2.mean_message_cost_log_differenced 0.333443 0.675775 0.493 0.622
L3.mean_gas_fee_cap_log_differenced -0.004518 0.017678 -0.256 0.798
L3.mean_gas_premium_log_differenced -0.528652 0.005533 -95.552 0.000
L3.mean_gas_limit_log_differenced 1.362622 0.292212 4.663 0.000
L3.mean_gas_used_log_differenced -5.607881 0.583754 -9.607 0.000
L3.mean_parent_base_fee_log_differenced -4.470472 1.112842 -4.017 0.000
L3.mean_base_fee_burn_log_differenced 4.093440 0.836119 4.896 0.000
L3.mean_over_estimation_burn_log_differenced -0.109552 1.215923 -0.090 0.928
L3.mean_gas_refund_log_differenced -0.175764 0.153519 -1.145 0.252
L3.mean_gas_burned_log_differenced -0.352189 1.014525 -0.347 0.728
L3.mean_message_cost_log_differenced 0.343847 0.675795 0.509 0.611
L4.mean_gas_fee_cap_log_differenced -0.008553 0.013598 -0.629 0.529
L4.mean_gas_premium_log_differenced -0.368423 0.004573 -80.572 0.000
L4.mean_gas_limit_log_differenced 1.559643 0.253428 6.154 0.000
L4.mean_gas_used_log_differenced -5.471858 0.500504 -10.933 0.000
L4.mean_parent_base_fee_log_differenced -3.703211 0.919295 -4.028 0.000
L4.mean_base_fee_burn_log_differenced 3.582747 0.744833 4.810 0.000
L4.mean_over_estimation_burn_log_differenced -1.611280 1.028060 -1.567 0.117
L4.mean_gas_refund_log_differenced -0.276707 0.126300 -2.191 0.028
L4.mean_gas_burned_log_differenced 0.756320 0.829786 0.911 0.362
L4.mean_message_cost_log_differenced 0.717799 0.614284 1.169 0.243
===============================================================================================================
Results for equation mean_gas_limit_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000004 0.000299 -0.014 0.989
L1.mean_gas_fee_cap_log_differenced -0.009174 0.000820 -11.186 0.000
L1.mean_gas_premium_log_differenced -0.001340 0.000277 -4.844 0.000
L1.mean_gas_limit_log_differenced -0.626490 0.015427 -40.611 0.000
L1.mean_gas_used_log_differenced -0.079911 0.030375 -2.631 0.009
L1.mean_parent_base_fee_log_differenced -0.288266 0.055677 -5.178 0.000
L1.mean_base_fee_burn_log_differenced 0.295966 0.045196 6.549 0.000
L1.mean_over_estimation_burn_log_differenced 0.179035 0.062457 2.867 0.004
L1.mean_gas_refund_log_differenced -0.039940 0.007609 -5.249 0.000
L1.mean_gas_burned_log_differenced -0.024445 0.050317 -0.486 0.627
L1.mean_message_cost_log_differenced -0.154138 0.037255 -4.137 0.000
L2.mean_gas_fee_cap_log_differenced -0.011683 0.001071 -10.912 0.000
L2.mean_gas_premium_log_differenced -0.001136 0.000335 -3.388 0.001
L2.mean_gas_limit_log_differenced -0.396130 0.017749 -22.318 0.000
L2.mean_gas_used_log_differenced -0.080577 0.035388 -2.277 0.023
L2.mean_parent_base_fee_log_differenced -0.231061 0.067512 -3.423 0.001
L2.mean_base_fee_burn_log_differenced 0.332964 0.050687 6.569 0.000
L2.mean_over_estimation_burn_log_differenced 0.210742 0.073782 2.856 0.004
L2.mean_gas_refund_log_differenced -0.042925 0.009317 -4.607 0.000
L2.mean_gas_burned_log_differenced 0.002097 0.061535 0.034 0.973
L2.mean_message_cost_log_differenced -0.217057 0.040978 -5.297 0.000
L3.mean_gas_fee_cap_log_differenced -0.009355 0.001072 -8.726 0.000
L3.mean_gas_premium_log_differenced -0.001115 0.000335 -3.324 0.001
L3.mean_gas_limit_log_differenced -0.275707 0.017719 -15.560 0.000
L3.mean_gas_used_log_differenced -0.061385 0.035398 -1.734 0.083
L3.mean_parent_base_fee_log_differenced -0.167393 0.067481 -2.481 0.013
L3.mean_base_fee_burn_log_differenced 0.331483 0.050701 6.538 0.000
L3.mean_over_estimation_burn_log_differenced 0.234893 0.073732 3.186 0.001
L3.mean_gas_refund_log_differenced -0.024087 0.009309 -2.587 0.010
L3.mean_gas_burned_log_differenced -0.015854 0.061520 -0.258 0.797
L3.mean_message_cost_log_differenced -0.230568 0.040979 -5.626 0.000
L4.mean_gas_fee_cap_log_differenced -0.005653 0.000825 -6.856 0.000
L4.mean_gas_premium_log_differenced -0.000834 0.000277 -3.007 0.003
L4.mean_gas_limit_log_differenced -0.060090 0.015368 -3.910 0.000
L4.mean_gas_used_log_differenced -0.030293 0.030350 -0.998 0.318
L4.mean_parent_base_fee_log_differenced -0.037220 0.055745 -0.668 0.504
L4.mean_base_fee_burn_log_differenced 0.122270 0.045166 2.707 0.007
L4.mean_over_estimation_burn_log_differenced 0.148089 0.062340 2.375 0.018
L4.mean_gas_refund_log_differenced -0.023896 0.007659 -3.120 0.002
L4.mean_gas_burned_log_differenced -0.023988 0.050317 -0.477 0.634
L4.mean_message_cost_log_differenced -0.135580 0.037250 -3.640 0.000
===============================================================================================================
Results for equation mean_gas_used_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000004 0.000266 -0.014 0.989
L1.mean_gas_fee_cap_log_differenced -0.007328 0.000729 -10.055 0.000
L1.mean_gas_premium_log_differenced -0.001293 0.000246 -5.258 0.000
L1.mean_gas_limit_log_differenced -0.046716 0.013707 -3.408 0.001
L1.mean_gas_used_log_differenced -0.671433 0.026989 -24.878 0.000
L1.mean_parent_base_fee_log_differenced -0.257945 0.049470 -5.214 0.000
L1.mean_base_fee_burn_log_differenced 0.250465 0.040157 6.237 0.000
L1.mean_over_estimation_burn_log_differenced 0.167918 0.055494 3.026 0.002
L1.mean_gas_refund_log_differenced -0.007466 0.006760 -1.104 0.269
L1.mean_gas_burned_log_differenced -0.026235 0.044708 -0.587 0.557
L1.mean_message_cost_log_differenced -0.139793 0.033102 -4.223 0.000
L2.mean_gas_fee_cap_log_differenced -0.009178 0.000951 -9.648 0.000
L2.mean_gas_premium_log_differenced -0.001294 0.000298 -4.345 0.000
L2.mean_gas_limit_log_differenced -0.008832 0.015771 -0.560 0.575
L2.mean_gas_used_log_differenced -0.467026 0.031443 -14.853 0.000
L2.mean_parent_base_fee_log_differenced -0.162917 0.059986 -2.716 0.007
L2.mean_base_fee_burn_log_differenced 0.293296 0.045036 6.512 0.000
L2.mean_over_estimation_burn_log_differenced 0.189179 0.065557 2.886 0.004
L2.mean_gas_refund_log_differenced -0.027501 0.008278 -3.322 0.001
L2.mean_gas_burned_log_differenced 0.017260 0.054675 0.316 0.752
L2.mean_message_cost_log_differenced -0.208089 0.036410 -5.715 0.000
L3.mean_gas_fee_cap_log_differenced -0.007903 0.000952 -8.298 0.000
L3.mean_gas_premium_log_differenced -0.001281 0.000298 -4.297 0.000
L3.mean_gas_limit_log_differenced -0.071385 0.015744 -4.534 0.000
L3.mean_gas_used_log_differenced -0.265187 0.031452 -8.431 0.000
L3.mean_parent_base_fee_log_differenced -0.057610 0.059959 -0.961 0.337
L3.mean_base_fee_burn_log_differenced 0.256298 0.045049 5.689 0.000
L3.mean_over_estimation_burn_log_differenced 0.152031 0.065513 2.321 0.020
L3.mean_gas_refund_log_differenced -0.002022 0.008271 -0.244 0.807
L3.mean_gas_burned_log_differenced 0.040189 0.054662 0.735 0.462
L3.mean_message_cost_log_differenced -0.198079 0.036411 -5.440 0.000
L4.mean_gas_fee_cap_log_differenced -0.004467 0.000733 -6.097 0.000
L4.mean_gas_premium_log_differenced -0.000766 0.000246 -3.110 0.002
L4.mean_gas_limit_log_differenced 0.013365 0.013654 0.979 0.328
L4.mean_gas_used_log_differenced -0.106121 0.026967 -3.935 0.000
L4.mean_parent_base_fee_log_differenced -0.003629 0.049531 -0.073 0.942
L4.mean_base_fee_burn_log_differenced 0.081139 0.040131 2.022 0.043
L4.mean_over_estimation_burn_log_differenced 0.134455 0.055391 2.427 0.015
L4.mean_gas_refund_log_differenced -0.012155 0.006805 -1.786 0.074
L4.mean_gas_burned_log_differenced -0.021616 0.044708 -0.483 0.629
L4.mean_message_cost_log_differenced -0.119062 0.033097 -3.597 0.000
===============================================================================================================
Results for equation mean_parent_base_fee_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000001 0.000279 -0.002 0.998
L1.mean_gas_fee_cap_log_differenced -0.018909 0.000766 -24.694 0.000
L1.mean_gas_premium_log_differenced 0.001667 0.000258 6.453 0.000
L1.mean_gas_limit_log_differenced -0.098647 0.014403 -6.849 0.000
L1.mean_gas_used_log_differenced -0.072518 0.028359 -2.557 0.011
L1.mean_parent_base_fee_log_differenced 0.254353 0.051982 4.893 0.000
L1.mean_base_fee_burn_log_differenced -0.197970 0.042197 -4.692 0.000
L1.mean_over_estimation_burn_log_differenced -0.098254 0.058312 -1.685 0.092
L1.mean_gas_refund_log_differenced 0.215954 0.007104 30.400 0.000
L1.mean_gas_burned_log_differenced -0.055627 0.046978 -1.184 0.236
L1.mean_message_cost_log_differenced 0.189822 0.034783 5.457 0.000
L2.mean_gas_fee_cap_log_differenced -0.014446 0.001000 -14.451 0.000
L2.mean_gas_premium_log_differenced 0.000904 0.000313 2.888 0.004
L2.mean_gas_limit_log_differenced -0.068173 0.016572 -4.114 0.000
L2.mean_gas_used_log_differenced -0.040936 0.033040 -1.239 0.215
L2.mean_parent_base_fee_log_differenced -0.075544 0.063033 -1.198 0.231
L2.mean_base_fee_burn_log_differenced -0.114728 0.047323 -2.424 0.015
L2.mean_over_estimation_burn_log_differenced -0.155187 0.068886 -2.253 0.024
L2.mean_gas_refund_log_differenced 0.128429 0.008699 14.764 0.000
L2.mean_gas_burned_log_differenced 0.030088 0.057452 0.524 0.600
L2.mean_message_cost_log_differenced 0.152296 0.038259 3.981 0.000
L3.mean_gas_fee_cap_log_differenced -0.009235 0.001001 -9.227 0.000
L3.mean_gas_premium_log_differenced 0.000396 0.000313 1.265 0.206
L3.mean_gas_limit_log_differenced -0.055733 0.016544 -3.369 0.001
L3.mean_gas_used_log_differenced -0.026784 0.033049 -0.810 0.418
L3.mean_parent_base_fee_log_differenced 0.036115 0.063004 0.573 0.566
L3.mean_base_fee_burn_log_differenced -0.027064 0.047337 -0.572 0.568
L3.mean_over_estimation_burn_log_differenced -0.099633 0.068840 -1.447 0.148
L3.mean_gas_refund_log_differenced 0.097511 0.008692 11.219 0.000
L3.mean_gas_burned_log_differenced 0.060435 0.057438 1.052 0.293
L3.mean_message_cost_log_differenced 0.059422 0.038260 1.553 0.120
L4.mean_gas_fee_cap_log_differenced -0.004656 0.000770 -6.048 0.000
L4.mean_gas_premium_log_differenced 0.000015 0.000259 0.057 0.954
L4.mean_gas_limit_log_differenced -0.034914 0.014348 -2.433 0.015
L4.mean_gas_used_log_differenced 0.032432 0.028336 1.145 0.252
L4.mean_parent_base_fee_log_differenced -0.012270 0.052046 -0.236 0.814
L4.mean_base_fee_burn_log_differenced -0.058593 0.042169 -1.389 0.165
L4.mean_over_estimation_burn_log_differenced -0.010444 0.058204 -0.179 0.858
L4.mean_gas_refund_log_differenced 0.030174 0.007151 4.220 0.000
L4.mean_gas_burned_log_differenced -0.027939 0.046979 -0.595 0.552
L4.mean_message_cost_log_differenced 0.051674 0.034778 1.486 0.137
===============================================================================================================
Results for equation mean_base_fee_burn_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000005 0.000406 -0.012 0.990
L1.mean_gas_fee_cap_log_differenced -0.026978 0.001112 -24.265 0.000
L1.mean_gas_premium_log_differenced -0.000199 0.000375 -0.531 0.596
L1.mean_gas_limit_log_differenced -0.149438 0.020911 -7.146 0.000
L1.mean_gas_used_log_differenced -0.080124 0.041173 -1.946 0.052
L1.mean_parent_base_fee_log_differenced 0.664808 0.075471 8.809 0.000
L1.mean_base_fee_burn_log_differenced -0.599652 0.061264 -9.788 0.000
L1.mean_over_estimation_burn_log_differenced 0.044799 0.084662 0.529 0.597
L1.mean_gas_refund_log_differenced 0.211574 0.010314 20.514 0.000
L1.mean_gas_burned_log_differenced -0.057519 0.068206 -0.843 0.399
L1.mean_message_cost_log_differenced 0.050714 0.050501 1.004 0.315
L2.mean_gas_fee_cap_log_differenced -0.024081 0.001451 -16.592 0.000
L2.mean_gas_premium_log_differenced -0.000632 0.000455 -1.391 0.164
L2.mean_gas_limit_log_differenced -0.075534 0.024060 -3.139 0.002
L2.mean_gas_used_log_differenced -0.056881 0.047970 -1.186 0.236
L2.mean_parent_base_fee_log_differenced 0.211877 0.091515 2.315 0.021
L2.mean_base_fee_burn_log_differenced -0.274463 0.068707 -3.995 0.000
L2.mean_over_estimation_burn_log_differenced 0.013085 0.100013 0.131 0.896
L2.mean_gas_refund_log_differenced 0.102226 0.012630 8.094 0.000
L2.mean_gas_burned_log_differenced 0.059457 0.083412 0.713 0.476
L2.mean_message_cost_log_differenced -0.047421 0.055547 -0.854 0.393
L3.mean_gas_fee_cap_log_differenced -0.017705 0.001453 -12.184 0.000
L3.mean_gas_premium_log_differenced -0.000795 0.000455 -1.748 0.081
L3.mean_gas_limit_log_differenced -0.133143 0.024019 -5.543 0.000
L3.mean_gas_used_log_differenced 0.043052 0.047983 0.897 0.370
L3.mean_parent_base_fee_log_differenced 0.312176 0.091473 3.413 0.001
L3.mean_base_fee_burn_log_differenced -0.094845 0.068727 -1.380 0.168
L3.mean_over_estimation_burn_log_differenced 0.040851 0.099946 0.409 0.683
L3.mean_gas_refund_log_differenced 0.096303 0.012619 7.632 0.000
L3.mean_gas_burned_log_differenced 0.111584 0.083391 1.338 0.181
L3.mean_message_cost_log_differenced -0.138158 0.055549 -2.487 0.013
L4.mean_gas_fee_cap_log_differenced -0.009306 0.001118 -8.326 0.000
L4.mean_gas_premium_log_differenced -0.001123 0.000376 -2.987 0.003
L4.mean_gas_limit_log_differenced -0.023682 0.020831 -1.137 0.256
L4.mean_gas_used_log_differenced 0.138161 0.041140 3.358 0.001
L4.mean_parent_base_fee_log_differenced 0.197008 0.075564 2.607 0.009
L4.mean_base_fee_burn_log_differenced -0.187991 0.061223 -3.071 0.002
L4.mean_over_estimation_burn_log_differenced 0.115771 0.084504 1.370 0.171
L4.mean_gas_refund_log_differenced 0.017410 0.010382 1.677 0.094
L4.mean_gas_burned_log_differenced -0.044321 0.068206 -0.650 0.516
L4.mean_message_cost_log_differenced -0.064474 0.050493 -1.277 0.202
===============================================================================================================
Results for equation mean_over_estimation_burn_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000009 0.001408 -0.006 0.995
L1.mean_gas_fee_cap_log_differenced -0.068635 0.003858 -17.792 0.000
L1.mean_gas_premium_log_differenced 0.001049 0.001301 0.806 0.420
L1.mean_gas_limit_log_differenced 0.380946 0.072558 5.250 0.000
L1.mean_gas_used_log_differenced -0.589849 0.142864 -4.129 0.000
L1.mean_parent_base_fee_log_differenced 0.929297 0.261870 3.549 0.000
L1.mean_base_fee_burn_log_differenced 0.963369 0.212573 4.532 0.000
L1.mean_over_estimation_burn_log_differenced -1.040511 0.293759 -3.542 0.000
L1.mean_gas_refund_log_differenced 0.241782 0.035786 6.756 0.000
L1.mean_gas_burned_log_differenced 0.693489 0.236661 2.930 0.003
L1.mean_message_cost_log_differenced -0.295227 0.175227 -1.685 0.092
L2.mean_gas_fee_cap_log_differenced -0.069748 0.005036 -13.850 0.000
L2.mean_gas_premium_log_differenced 0.001446 0.001577 0.917 0.359
L2.mean_gas_limit_log_differenced 0.624889 0.083482 7.485 0.000
L2.mean_gas_used_log_differenced -0.624182 0.166446 -3.750 0.000
L2.mean_parent_base_fee_log_differenced -0.587082 0.317538 -1.849 0.064
L2.mean_base_fee_burn_log_differenced 1.109350 0.238400 4.653 0.000
L2.mean_over_estimation_burn_log_differenced -0.389387 0.347024 -1.122 0.262
L2.mean_gas_refund_log_differenced 0.046201 0.043822 1.054 0.292
L2.mean_gas_burned_log_differenced 0.355508 0.289425 1.228 0.219
L2.mean_message_cost_log_differenced -0.444482 0.192737 -2.306 0.021
L3.mean_gas_fee_cap_log_differenced -0.048536 0.005042 -9.626 0.000
L3.mean_gas_premium_log_differenced 0.000999 0.001578 0.633 0.527
L3.mean_gas_limit_log_differenced 0.463157 0.083342 5.557 0.000
L3.mean_gas_used_log_differenced -0.454966 0.166492 -2.733 0.006
L3.mean_parent_base_fee_log_differenced 0.049112 0.317393 0.155 0.877
L3.mean_base_fee_burn_log_differenced 1.254913 0.238469 5.262 0.000
L3.mean_over_estimation_burn_log_differenced -0.035542 0.346792 -0.102 0.918
L3.mean_gas_refund_log_differenced 0.059168 0.043785 1.351 0.177
L3.mean_gas_burned_log_differenced 0.512205 0.289352 1.770 0.077
L3.mean_message_cost_log_differenced -0.814841 0.192743 -4.228 0.000
L4.mean_gas_fee_cap_log_differenced -0.032410 0.003878 -8.357 0.000
L4.mean_gas_premium_log_differenced -0.001692 0.001304 -1.297 0.195
L4.mean_gas_limit_log_differenced 0.280027 0.072280 3.874 0.000
L4.mean_gas_used_log_differenced -0.066747 0.142748 -0.468 0.640
L4.mean_parent_base_fee_log_differenced -0.235119 0.262191 -0.897 0.370
L4.mean_base_fee_burn_log_differenced 0.563492 0.212433 2.653 0.008
L4.mean_over_estimation_burn_log_differenced 0.222740 0.293212 0.760 0.447
L4.mean_gas_refund_log_differenced -0.035848 0.036022 -0.995 0.320
L4.mean_gas_burned_log_differenced 0.015846 0.236662 0.067 0.947
L4.mean_message_cost_log_differenced -0.420662 0.175200 -2.401 0.016
===============================================================================================================
Results for equation mean_gas_refund_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000005 0.000324 -0.017 0.987
L1.mean_gas_fee_cap_log_differenced -0.007651 0.000887 -8.621 0.000
L1.mean_gas_premium_log_differenced -0.001093 0.000299 -3.651 0.000
L1.mean_gas_limit_log_differenced -0.086695 0.016693 -5.194 0.000
L1.mean_gas_used_log_differenced 0.159675 0.032867 4.858 0.000
L1.mean_parent_base_fee_log_differenced -0.158287 0.060246 -2.627 0.009
L1.mean_base_fee_burn_log_differenced 0.260819 0.048904 5.333 0.000
L1.mean_over_estimation_burn_log_differenced 0.192847 0.067582 2.854 0.004
L1.mean_gas_refund_log_differenced -0.791072 0.008233 -96.085 0.000
L1.mean_gas_burned_log_differenced 0.004490 0.054446 0.082 0.934
L1.mean_message_cost_log_differenced -0.198462 0.040313 -4.923 0.000
L2.mean_gas_fee_cap_log_differenced -0.009346 0.001159 -8.067 0.000
L2.mean_gas_premium_log_differenced -0.000964 0.000363 -2.658 0.008
L2.mean_gas_limit_log_differenced -0.045757 0.019206 -2.382 0.017
L2.mean_gas_used_log_differenced 0.144307 0.038292 3.769 0.000
L2.mean_parent_base_fee_log_differenced -0.081959 0.073053 -1.122 0.262
L2.mean_base_fee_burn_log_differenced 0.259246 0.054846 4.727 0.000
L2.mean_over_estimation_burn_log_differenced 0.138653 0.079836 1.737 0.082
L2.mean_gas_refund_log_differenced -0.595417 0.010082 -59.059 0.000
L2.mean_gas_burned_log_differenced 0.067911 0.066585 1.020 0.308
L2.mean_message_cost_log_differenced -0.211103 0.044341 -4.761 0.000
L3.mean_gas_fee_cap_log_differenced -0.008316 0.001160 -7.169 0.000
L3.mean_gas_premium_log_differenced -0.001122 0.000363 -3.089 0.002
L3.mean_gas_limit_log_differenced -0.073599 0.019174 -3.839 0.000
L3.mean_gas_used_log_differenced 0.131734 0.038303 3.439 0.001
L3.mean_parent_base_fee_log_differenced 0.027144 0.073019 0.372 0.710
L3.mean_base_fee_burn_log_differenced 0.241166 0.054862 4.396 0.000
L3.mean_over_estimation_burn_log_differenced 0.090702 0.079783 1.137 0.256
L3.mean_gas_refund_log_differenced -0.391354 0.010073 -38.851 0.000
L3.mean_gas_burned_log_differenced 0.113192 0.066568 1.700 0.089
L3.mean_message_cost_log_differenced -0.213040 0.044342 -4.804 0.000
L4.mean_gas_fee_cap_log_differenced -0.005320 0.000892 -5.962 0.000
L4.mean_gas_premium_log_differenced -0.000833 0.000300 -2.778 0.005
L4.mean_gas_limit_log_differenced 0.009280 0.016629 0.558 0.577
L4.mean_gas_used_log_differenced 0.078867 0.032841 2.401 0.016
L4.mean_parent_base_fee_log_differenced -0.001628 0.060320 -0.027 0.978
L4.mean_base_fee_burn_log_differenced 0.063864 0.048872 1.307 0.191
L4.mean_over_estimation_burn_log_differenced 0.077455 0.067456 1.148 0.251
L4.mean_gas_refund_log_differenced -0.202784 0.008287 -24.470 0.000
L4.mean_gas_burned_log_differenced 0.015685 0.054446 0.288 0.773
L4.mean_message_cost_log_differenced -0.100199 0.040306 -2.486 0.013
===============================================================================================================
Results for equation mean_gas_burned_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000008 0.001343 -0.006 0.995
L1.mean_gas_fee_cap_log_differenced -0.049646 0.003681 -13.487 0.000
L1.mean_gas_premium_log_differenced -0.000597 0.001242 -0.481 0.631
L1.mean_gas_limit_log_differenced 0.478010 0.069238 6.904 0.000
L1.mean_gas_used_log_differenced -0.515052 0.136326 -3.778 0.000
L1.mean_parent_base_fee_log_differenced -0.126030 0.249886 -0.504 0.614
L1.mean_base_fee_burn_log_differenced 1.158424 0.202845 5.711 0.000
L1.mean_over_estimation_burn_log_differenced -0.144209 0.280316 -0.514 0.607
L1.mean_gas_refund_log_differenced 0.024826 0.034149 0.727 0.467
L1.mean_gas_burned_log_differenced -0.051361 0.225831 -0.227 0.820
L1.mean_message_cost_log_differenced -0.482627 0.167208 -2.886 0.004
L2.mean_gas_fee_cap_log_differenced -0.055192 0.004805 -11.485 0.000
L2.mean_gas_premium_log_differenced 0.000567 0.001505 0.377 0.706
L2.mean_gas_limit_log_differenced 0.691113 0.079662 8.676 0.000
L2.mean_gas_used_log_differenced -0.578044 0.158829 -3.639 0.000
L2.mean_parent_base_fee_log_differenced -1.116189 0.303007 -3.684 0.000
L2.mean_base_fee_burn_log_differenced 1.219776 0.227490 5.362 0.000
L2.mean_over_estimation_burn_log_differenced 0.370142 0.331144 1.118 0.264
L2.mean_gas_refund_log_differenced -0.083541 0.041817 -1.998 0.046
L2.mean_gas_burned_log_differenced -0.280792 0.276180 -1.017 0.309
L2.mean_message_cost_log_differenced -0.594964 0.183917 -3.235 0.001
L3.mean_gas_fee_cap_log_differenced -0.039155 0.004811 -8.138 0.000
L3.mean_gas_premium_log_differenced 0.000599 0.001506 0.398 0.691
L3.mean_gas_limit_log_differenced 0.521153 0.079528 6.553 0.000
L3.mean_gas_used_log_differenced -0.434030 0.158873 -2.732 0.006
L3.mean_parent_base_fee_log_differenced -0.395995 0.302868 -1.307 0.191
L3.mean_base_fee_burn_log_differenced 1.287506 0.227556 5.658 0.000
L3.mean_over_estimation_burn_log_differenced 0.469596 0.330922 1.419 0.156
L3.mean_gas_refund_log_differenced -0.038746 0.041781 -0.927 0.354
L3.mean_gas_burned_log_differenced 0.047167 0.276110 0.171 0.864
L3.mean_message_cost_log_differenced -0.875463 0.183923 -4.760 0.000
L4.mean_gas_fee_cap_log_differenced -0.027698 0.003701 -7.484 0.000
L4.mean_gas_premium_log_differenced -0.001693 0.001244 -1.361 0.174
L4.mean_gas_limit_log_differenced 0.318731 0.068972 4.621 0.000
L4.mean_gas_used_log_differenced -0.102035 0.136216 -0.749 0.454
L4.mean_parent_base_fee_log_differenced -0.418261 0.250193 -1.672 0.095
L4.mean_base_fee_burn_log_differenced 0.622827 0.202712 3.072 0.002
L4.mean_over_estimation_burn_log_differenced 0.428419 0.279794 1.531 0.126
L4.mean_gas_refund_log_differenced -0.066478 0.034373 -1.934 0.053
L4.mean_gas_burned_log_differenced -0.151582 0.225832 -0.671 0.502
L4.mean_message_cost_log_differenced -0.472638 0.167182 -2.827 0.005
===============================================================================================================
Results for equation mean_message_cost_log_differenced
===============================================================================================================
coefficient std. error t-stat prob
---------------------------------------------------------------------------------------------------------------
const -0.000013 0.001645 -0.008 0.994
L1.mean_gas_fee_cap_log_differenced -0.094561 0.004509 -20.973 0.000
L1.mean_gas_premium_log_differenced 0.000818 0.001521 0.538 0.591
L1.mean_gas_limit_log_differenced 0.226525 0.084806 2.671 0.008
L1.mean_gas_used_log_differenced -0.668813 0.166979 -4.005 0.000
L1.mean_parent_base_fee_log_differenced 1.568092 0.306072 5.123 0.000
L1.mean_base_fee_burn_log_differenced 0.862773 0.248454 3.473 0.001
L1.mean_over_estimation_burn_log_differenced -0.486014 0.343344 -1.416 0.157
L1.mean_gas_refund_log_differenced 0.451645 0.041827 10.798 0.000
L1.mean_gas_burned_log_differenced 0.623842 0.276608 2.255 0.024
L1.mean_message_cost_log_differenced -0.740753 0.204804 -3.617 0.000
L2.mean_gas_fee_cap_log_differenced -0.092489 0.005886 -15.714 0.000
L2.mean_gas_premium_log_differenced 0.000793 0.001843 0.430 0.667
L2.mean_gas_limit_log_differenced 0.544181 0.097574 5.577 0.000
L2.mean_gas_used_log_differenced -0.674722 0.194541 -3.468 0.001
L2.mean_parent_base_fee_log_differenced -0.379631 0.371137 -1.023 0.306
L2.mean_base_fee_burn_log_differenced 1.186582 0.278640 4.258 0.000
L2.mean_over_estimation_burn_log_differenced -0.015244 0.405600 -0.038 0.970
L2.mean_gas_refund_log_differenced 0.147647 0.051219 2.883 0.004
L2.mean_gas_burned_log_differenced 0.409043 0.338278 1.209 0.227
L2.mean_message_cost_log_differenced -0.845656 0.225270 -3.754 0.000
L3.mean_gas_fee_cap_log_differenced -0.065173 0.005893 -11.059 0.000
L3.mean_gas_premium_log_differenced 0.000195 0.001844 0.106 0.916
L3.mean_gas_limit_log_differenced 0.326578 0.097409 3.353 0.001
L3.mean_gas_used_log_differenced -0.405224 0.194595 -2.082 0.037
L3.mean_parent_base_fee_log_differenced 0.359301 0.370966 0.969 0.333
L3.mean_base_fee_burn_log_differenced 1.357914 0.278721 4.872 0.000
L3.mean_over_estimation_burn_log_differenced 0.208175 0.405329 0.514 0.608
L3.mean_gas_refund_log_differenced 0.154362 0.051176 3.016 0.003
L3.mean_gas_burned_log_differenced 0.621763 0.338192 1.838 0.066
L3.mean_message_cost_log_differenced -1.152964 0.225277 -5.118 0.000
L4.mean_gas_fee_cap_log_differenced -0.041055 0.004533 -9.057 0.000
L4.mean_gas_premium_log_differenced -0.002799 0.001524 -1.836 0.066
L4.mean_gas_limit_log_differenced 0.255053 0.084480 3.019 0.003
L4.mean_gas_used_log_differenced 0.072933 0.166843 0.437 0.662
L4.mean_parent_base_fee_log_differenced -0.035504 0.306447 -0.116 0.908
L4.mean_base_fee_burn_log_differenced 0.505824 0.248291 2.037 0.042
L4.mean_over_estimation_burn_log_differenced 0.467342 0.342704 1.364 0.173
L4.mean_gas_refund_log_differenced -0.018282 0.042102 -0.434 0.664
L4.mean_gas_burned_log_differenced -0.026783 0.276609 -0.097 0.923
L4.mean_message_cost_log_differenced -0.615359 0.204772 -3.005 0.003
===============================================================================================================
Correlation matrix of residuals
mean_gas_fee_cap_log_differenced mean_gas_premium_log_differenced mean_gas_limit_log_differenced mean_gas_used_log_differenced mean_parent_base_fee_log_differenced mean_base_fee_burn_log_differenced mean_over_estimation_burn_log_differenced mean_gas_refund_log_differenced mean_gas_burned_log_differenced mean_message_cost_log_differenced
mean_gas_fee_cap_log_differenced 1.000000 -0.013591 -0.110000 -0.100524 -0.041908 -0.103094 -0.109161 -0.093298 -0.105941 -0.118415
mean_gas_premium_log_differenced -0.013591 1.000000 0.022864 0.006713 0.074433 0.054394 0.037662 0.013468 0.024371 0.045621
mean_gas_limit_log_differenced -0.110000 0.022864 1.000000 0.902268 0.089076 0.659047 0.627840 0.779015 0.639698 0.698410
mean_gas_used_log_differenced -0.100524 0.006713 0.902268 1.000000 0.075931 0.713654 0.413719 0.798918 0.417824 0.529393
mean_parent_base_fee_log_differenced -0.041908 0.074433 0.089076 0.075931 1.000000 0.738642 0.326096 0.093800 0.134449 0.459603
mean_base_fee_burn_log_differenced -0.103094 0.054394 0.659047 0.713654 0.738642 1.000000 0.507044 0.591369 0.378159 0.678954
mean_over_estimation_burn_log_differenced -0.109161 0.037662 0.627840 0.413719 0.326096 0.507044 1.000000 0.434046 0.980381 0.976733
mean_gas_refund_log_differenced -0.093298 0.013468 0.779015 0.798918 0.093800 0.591369 0.434046 1.000000 0.435435 0.515649
mean_gas_burned_log_differenced -0.105941 0.024371 0.639698 0.417824 0.134449 0.378159 0.980381 0.435435 1.000000 0.928299
mean_message_cost_log_differenced -0.118415 0.045621 0.698410 0.529393 0.459603 0.678954 0.976733 0.515649 0.928299 1.000000
results.plot()
Granger causality is a hypothesis test for determining whether one-time series is useful in forecasting another. We can say that a variable X, or variables, evolves Granger-causes another evolving variable Y if predictions of the value of Y based on its past values and the past values of X are better than predictions of Y based only on Y's past values.
Granger Causality is relationship based on the following principles:
Given these two assumptions about causality, Granger proposed to test the following hypothesis for identification of a causal effect of $X$ on $Y$: $${P}[Y(t+1) \in A\mid \mathcal{I}(t)] \neq \mathbb{P}[Y(t+1) \in A\mid \mathcal{I}_{-X}(t)]$$ where $\mathbb{P}$ refers to probability, $A$ is an arbitrary non-empty set, and $\mathcal{I}(t)$ and $\mathcal{I}_{-X}(t)$ respectively denote the information available as of time $t$ in the entire universe, and that in the modified universe in which $X$ is excluded. If the above hypothesis is accepted, we say that $X$ Granger causes $Y$.
In our analysis, we present the hypothesis that gas_used is a driver of message cost. In statistical parlance, we have the following:
Granger Causality assumes that the time series are non-stationary, which we checked and passed above, and autoregressive lags greater than 1.
We will perform now perform the Granger Causality hypothesis test with an $\alpha = 0.05$ value using an F test to determine if the gas used has any casual component for predicting the message cost. If the p-value (the probability of obtaining test results at least as extreme as the results observed) of the test is less than or equal to $\alpha$ we will reject the null hypothesis and determine that gas used is a driver of message cost.
As we have many signals with the analysis, we will loop through all the signals, perform the Granger Causality test, and save the results for analysis.
alpha = 0.05
result_dfs = []
variables = list(log_differenced.columns)
for i in variables:
for j in variables:
if i==j:
pass
else:
results_summary = results.test_causality(i,j,
kind='f',signif=alpha).summary()
df = pd.read_html(results_summary.as_html(),header=0, index_col=0)[0]
df['alpha'] = alpha
df['caused'] = i
df['causing'] = j
result_dfs.append(df)
Grangers_df = pd.concat(result_dfs)
Grangers_df.reset_index(inplace=True)
Grangers_df['result'] = Grangers_df['p-value'].apply(lambda x: 'reject H0' if x < alpha else 'fail to reject H0' )
Grangers_df
| Test statistic | Critical value | p-value | df | alpha | caused | causing | result | |
|---|---|---|---|---|---|---|---|---|
| 0 | 0.9222 | 2.372 | 0.450 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_gas_premium_log_differenced | fail to reject H0 |
| 1 | 0.7108 | 2.372 | 0.584 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_gas_limit_log_differenced | fail to reject H0 |
| 2 | 10.9300 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_gas_used_log_differenced | reject H0 |
| 3 | 5.9780 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_parent_base_fee_log_differenced | reject H0 |
| 4 | 13.1600 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_base_fee_burn_log_differenced | reject H0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 85 | 14.2100 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_parent_base_fee_log_differenced | reject H0 |
| 86 | 7.5270 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_base_fee_burn_log_differenced | reject H0 |
| 87 | 1.2740 | 2.372 | 0.278 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_over_estimation_burn_log_differenced | fail to reject H0 |
| 88 | 36.9500 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_gas_refund_log_differenced | reject H0 |
| 89 | 2.3500 | 2.372 | 0.052 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_gas_burned_log_differenced | fail to reject H0 |
90 rows × 8 columns
heatdf = Grangers_df.pivot(index='caused', columns=['causing'],values=['p-value'])
f, ax = plt.subplots(figsize=(15, 12))
sns.heatmap(heatdf, annot=True, linewidths=.5, ax=ax,cmap=['green','red'],center=0.05)
plt.suptitle('Heatmap of Granger Casuality \n Green shows causal relationship whereas red shows no causal relationship')
Text(0.5, 0.98, 'Heatmap of Granger Casuality \n Green shows causal relationship whereas red shows no causal relationship')
Based on the heatmap above, we can see that there are some granger causal relationships between signals. To see more granular specifics, we will examine the reject H0s below
Grangers_df.query("result == 'reject H0'").sort_values('p-value',ascending=True)
| Test statistic | Critical value | p-value | df | alpha | caused | causing | result | |
|---|---|---|---|---|---|---|---|---|
| 2 | 10.930 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_gas_used_log_differenced | reject H0 |
| 86 | 7.527 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_message_cost_log_differenced | mean_base_fee_burn_log_differenced | reject H0 |
| 47 | 18.190 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_base_fee_burn_log_differenced | mean_gas_limit_log_differenced | reject H0 |
| 48 | 5.000 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_base_fee_burn_log_differenced | mean_gas_used_log_differenced | reject H0 |
| 49 | 24.210 | 2.372 | 0.000 | (4, 417120) | 0.05 | mean_base_fee_burn_log_differenced | mean_parent_base_fee_log_differenced | reject H0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 32 | 3.330 | 2.372 | 0.010 | (4, 417120) | 0.05 | mean_gas_used_log_differenced | mean_over_estimation_burn_log_differenced | reject H0 |
| 79 | 3.268 | 2.372 | 0.011 | (4, 417120) | 0.05 | mean_gas_burned_log_differenced | mean_gas_refund_log_differenced | reject H0 |
| 61 | 3.082 | 2.372 | 0.015 | (4, 417120) | 0.05 | mean_over_estimation_burn_log_differenced | mean_gas_burned_log_differenced | reject H0 |
| 39 | 2.589 | 2.372 | 0.035 | (4, 417120) | 0.05 | mean_parent_base_fee_log_differenced | mean_gas_used_log_differenced | reject H0 |
| 5 | 2.425 | 2.372 | 0.046 | (4, 417120) | 0.05 | mean_gas_fee_cap_log_differenced | mean_over_estimation_burn_log_differenced | reject H0 |
63 rows × 8 columns
Based on the above table, we can see some Granger caused relationships between signals, such as mean_gas_fee_cap Granger causes mean_gas_limit. We can't fully use Granger until we understand what the signals are and what they represent better.
In this notebook, we've provided proof of workflow for using VAR and Granger Causality to analyze the relationships between variables. In a subsequent notebook, we will examine the gas data more deeply.