Gas Dynamics EDA: Stationarity

In this notebook we will provide an overview of Dr. Monnot's research on EIP 1559 and then perform analys on Filecoin's network to determine if Filecoin's base fee trends towards stationarity, as hypothesized by Dr. Barnabé Monnot.

Dr. Monnot's EIP 1559 research is based on running cadCAD (or more accurately, radCAD) models of scenarios to discover how gas prices will respond to different assumptions and market structures. He constructed a series of 5 technical notebooks (see sources below) that explore first-price auctions, user behavior, and how Ethereum's gas economy would chain when moved to EIP 1559. In the section below we will summarize Dr. Monnot's research and describe applications toward Filecoin’s network.

EIP 1559 was a (proposed at the time of Monnot’s writing) economic change to Ethereum’s gas economy with how the transaction fee market operates. It replaces the first-price auction with a variable gas price base to be paid by the user, along with a fee cap, and gas premium 'tip' provided to the block producer by the user. EIP 1559’s use supply and demand (the base fee increases to account for high demand and decreases with lower demand) with fixed block size. The base fee often converts to a value that ‘crowds out’ users to achieve the targeted block size. Dr. Monnot’s research points to long-term stationery of the base fee. Shifts can occur that shift up or down the base fee, but over time the base fee tends towards stationary with ‘structural breaks’ (Sir David Hendry’s econometrics research may be applicable here - will be addressed during the ‘traditional’ economics review). Dr. Monnot’s research is based on algorithmic game theory, and as such, he defines user actions in terms of payoffs. Accordingly, he presents the following function of determining an individual user's payoff, which determines a rise in the base fee.

Payoff = value − cost from waiting − transaction fee

Dr. Monnot estimated cost for each actor waiting is lower in EIP 1559 since users estimate that they will be included in the next block and not wait for 5 blocks to get in. In the first-price auction, some users with high values but with no pressing time constraints might have been discouraged to join the pool. Now, these users don't expect to wait as much, and since their values are high, they don't mind bidding for a higher base fee either. In Dr. Monnot’s modeling, once we pass the initial instability (while the base fee is looking for its stationary value), all users receive a positive payoff. He thinks this is expected as once the base fee has increased/risen high enough to ‘weed out’ excess demand, actors are almost certainly guaranteed to be included in the next block so that actual wait time will always be less than their estimate.

Dr. Monnot’ studies strategic users as well, which he defines as actors who are trying to outbid the ‘cheapest user’(from the miner's point of view) that who was included in the previous block. In his simulations, he sets the fee cap of strategic users as that of the value of their transactions. He states that auctions are often assumed to be efficient when high-value actors obtain what they want, meaning, the item being auctioned goes to who wants it the most. When actors bid as they do in a first-price auction, the EIP 1559 gas economic is less efficient than the first-price auction for non-strategic actors. However, the EIP 1559 market becomes efficient for both actor types once the base fee reaches its stationary level.

Dr. Monnot has a notebook discussing the alternative gas economy ‘escalator’ proposal first introduced by Dan Finlay. However, for our review here, we will skip this review as EIP 1559 was accepted.

Dr. Monnot's work is very helpful from a game theory perspective on how a user will interact with the gas economy. EIP 1559 removed the first-price auction, moving to a more supply and demand-driven approach, with actors becoming price takers the majority of the time, with their only decision being if they should perform a transaction or not. The introduction of base fees has pushed oracles closer to objective market-clearing price estimates. Dr. Monnot’s simulations showing that the base fee will tend towards stationarity, with occasional ‘structural breaks’ based on supply/demand, provides a key insight for EDA: is Filecoin’s Gas Economy relatively stationary? If so, this is a key learning for building our DT’s behavioral model of the gas economy. Note: we tested Filecoin's base fee stationarity in this notebook and can conclude that the base fee was stationary for June and July, 2021. This finding would also drive the next part of our economic literature review: existing econometric measures for forecasting stationary prices with periodic structural breaks.

Sources:

derived_gas_outputs

Obtained 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.

Based off of this derived_gas_outputs data dictionary, parent_base_fee appears to be the actor's base fee that is hypothesized to be stationary. To test the hypothesis, we will download the second mean aggregated data for June and July 2021 and determine if parent_base_fee is stationary.

We perform a quick time analysis to determine if time sampling is consistent, as we would expect when doing an aggregation.

As expected, the data is consistent.

To check for stationarity, as a hypothesis by Dr. Monnot, 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 hypotheses are:

Conclusion

Based on the Augmented Dickey-Fuller, we can conclude that for June and July 2021, Filecoin's base fee was stationary, as hypothesizes by Dr. Monnot. This is a consequential finding as it allows us to tap into the rich econometric literature on stationary time series forecasting to inform how our Digital Twin forecasts base fee.