Modeling the Filecoin Economy — Part 2

Kiran Karra
CryptoEconLab
Published in
4 min readMay 1, 2023
Agent Based Modeling

Introduction

In Modeling the Filecoin Economy — Part 1, we discussed the basics of the Filecoin economy and how we, at CryptoEconLab, use a mechanistic, scenario-based model called mechaFIL to estimate how different regimes of storage provider behavior impact the main drivers of circulating supply.

While mechaFIL has been incredibly helpful for conducting deep technical analysis of the Filecoin economy, it has some limitations. Primarily, mechaFIL cannot easily take into account different behavior profiles of Storage Providers (SP), such as providers that focus on finding data deals with clients versus providers that focus on adding raw storage power. The model also does not consider the internal motivations of the participants in the economy. For instance, if, at some point during the simulation, the expected returns become negative, a rational SP would stop onboarding new sectors since that would lead to financial losses.

Agent Based Modeling

To fill this gap and enhance our modeling capabilities, we created agentFIL. AgentFIL is an open-source agent based model that simulates the four main mechanisms influencing the circulating supply of FIL tokens: a) minting, b) vesting, c) burning, and d) locking. The primary difference between agentFIL and mechaFIL is in the input.

In agentFIL, individual agents decide on a daily basis whether to onboard or renew power. Individual agents decisions are then aggregated by agentFIL to determine the amount of power that is onboarded and renewed for that day. Then, the model developed in mechaFIL is utilized to compute the circulating supply statistics of the network, based on the agent’s onboarding behaviors. This process repeats for the duration of the simulation. While this sounds simple, it enables us to investigate a wide range of counterfactuals that are important to making decisions about the cryptoeconomic policies of Filecoin, that were previously not possible.

For example, suppose we have a scenario where we have two sub-populations of SPs. In this simplified example, further assume that these subpopulations are identical in every way, except that they have varying risk profiles that determine whether and how much power they onboard and renew onto the network. With this setup, we can use agentFIL to investigate the robustness of the network’s KPIs (such as network power) as a function of the relative risk tolerance of the two subpopulations.

A second example where agentFIL can be used is if we want to understand the effect of introducing a new policy change to the network. Suppose that a FIP is introduced to change the way a set of network parameters, such as the way base_fee, which influences the amount of gas that is needed to transact in the blockchain, is calculated. A question that arises is: do we update the parameter to its new value in a single upgrade or do we introduce a function that updates the parameter smoothly over a period of time? While we might be able to intuitively reason what might be better, it is useful to quantify by how much. Quantifying enables us to make these decisions in a risk-adjusted manner. Additionally, unexpected dynamics which may occur in a feedback loop that are not easy to reason with directly can be discovered by using agentFIL.

Agent Types

In our current implementation of agentFIL, we have three types of agents implemented:

  • DCAAgent — this is the Dollar Cost Averaging Agent, which simply onboards and renews the amount of power that it is told to on a daily basis. A simulation with one DCAAgent is equivalent to simulating the same scenario with mechaFIL.
  • NPVAgent — this agent utilizes forecasting information from the environment to compute a net present value (NPV) estimate for onboarding power for a given sector duration. If the NPV is greater than zero, the agent will onboard its maximum allowance for that day, and renew a configured amount of power.
  • FoFRAgent — this agent utilizes forecasting information from the environment to compute a FIL-on-FIL return (FoFR) estimate for onboarding power for a given duration. If the FoFR is greater than a predefined threshold, the agent will onboard its maximum allowance for that day, and renew a configured amount of power.

Additionally, it is trivial to add in new agent logic. This may be useful for SPs who want to simulate their current and new strategies and quantify returns based on their chosen strategies.

Conclusion

We now have the tools necessary to answer more nuanced questions such as these, and we plan on using these tools to continue to enhance and strengthen the Filecoin economy.

To learn more about our work on agent based models, please visit the repository, watch the talk we gave on agent based modeling at CryptoEconDay in Austin, and read our research paper on agent based modeling for cryptoeconomies.

If you want to read more about CryptoEconLab and our work, you can visit our website at cryptoeconlab.io or follow us on Twitter.

This article was made for informational purposes only. CryptoEconLab does not provide legal, tax, financial or investment advice. No party should act in reliance upon, or with the expectation of, any such advice.

--

--