Skip to main content

Agent Based Modeling

Agent Based Modeling

An agent-based model is a computational model for simulating the actions and interactions of people, things, places, and time, in order to understand the behavior of a complex system in the real world and what governs its outcomes.

Blockchains are particularly well-suited for agent-based modeling. Unlike traditional finance, where not all information or decisions leave a digital trace—especially not in public—blockchain records every action and interaction between users and decentralised applications (dApps) as publicly visible transactions. This extensive availability of data and transparent system logic allows for the accurate modeling of the entire system with a high degree of precision.

The system comprises various components that must each be modeled: environments, agents, and price scenarios.

Modeling the system

Achieving a high degree of accuracy in system modeling ensures that the model faithfully replicates the real-world behavior of the software or system under analysis. This level of precision guarantees that the simulation generates relevant and actionable insights.

The Almanak Platform maintains this accuracy by executing the selected protocol's contract bytecode directly within a customized EVM instance. Additionally, the Almanak SDK accelerates development for users by providing a robust protocol library, enabling faster and more efficient implementation.

Modeling the Agents

Agents in the simulation serve as counterparts to real-world actors. Given the diversity of users on the blockchain, each with distinct behaviors, defining what constitutes normal behavior for a protocol is grounded in analyses of historical data and expert insights.

For instance, LPs can be modeled as passive agents, making liquidity deposits and withdrawals based on common patterns or average trends. In contrast, arbitrageurs can be represented as more dynamic agents, reacting swiftly to specific events or triggers.

Modeling market scenarios

Running analysis on historical price data limits foresight. In the real world, market regimes shift over time. Therefore, experienced analysts future-proof their strategies by forecasting & testing against the various potential market scenarios.

Almanak covers this need by providing an in-built price simulator, where users can forecast price trajectories for asset-pairs of interest, based on training on historical data. Almanak saves time for users by offering three preconfigured market regimes (uptrend, downtrend, rangebound), equipping users with results & recommendations for each potential future scenario.

Simulating the system & agents over market scenarios Once the environment, agents, and markets are modeled, the entire system is simulated over a defined period. The simulation is happening in the cloud where all blockchain transactions are executed on a customized Ethereum Virtual Machine (EVM) to offer a realistic simulation accounting for the intricacies of the Ethereum blockchain. The simulator aggregates the different components and launches the respective EVM environment to iterate over the market scenarios and let the agent(s) take actions based on their respective roles and strategies - producing data that mirrors the real world’s behavior. Almanak enhances development efficiency by running the simulation in the cloud and offering streamlined access to results and key metrics, enabling users to quickly gain insights and make informed decisions.

Results

The data generated by the simulation is then ready to be analyzed. Almanak accelerates time-to-insight by offering a summary table that compares the profitability of all agents, along with individual metric dashboards for each agent. This streamlined approach enables users to quickly evaluate performance and gain actionable insights.