> For the complete documentation index, see [llms.txt](https://token-engineering-balancer.gitbook.io/balancer-simulations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://token-engineering-balancer.gitbook.io/balancer-simulations/balancer-simulations/v10nboverview.md).

# Model Overview

Balancer AMM Models and Simulations are built with [**cadCAD**](https://cadcad.org/), an open-source Python package for designing, testing, and validating complex systems. In case you haven't used cadCAD yet, we highly recommend taking this [beginner course](https://www.cadcad.education/) and become familiar with cadCAD.

In Balancer Simulations V1.0 we demonstrate how **real-world transactions** can be routed through the Balancer Simulations model. Moreover, we add **external price feeds** to showcase how various data sources can be combined for a **most realistic simulation scenario**, while the **prototyping effort** for new Balancer Pool designs is **minimized** using a Python model.\
\
Additionally, we've used real-world transaction data to [verify if the model is producing accurate and credible results](https://token-engineering-balancer.gitbook.io/balancer-simulations/additional-code-and-instructions/balancer-the-python-edition/model-verification-and-limitations).

&#x20;We are following the[ cadCAD System Model standard](https://github.com/cadCAD-org/cadCAD/tree/master/documentation), with

* *State Variables* to describe the mathematical "state" of the pool
* *State Update Functions*, changing the state variables in discrete events according to on-chain transactions and price updates
* *Policy Functions*, defining the rules of the system, in our case mapping transactions   to the right method in the model to update the state
* *Partial State Update Blocks*, which are sets of state updates and policy functions

![](/files/-MUrmmW9yGEcz_XJp2H3)

Simulations in V1.0 allows to combine four components:

A) **on-chain transaction data** of a Balancer pool you'd like to analyze, formatted as a series of actions in json format.

{% content-ref url="/pages/-MRwyE1liSHZEqeLq0TJ" %}
[Adding On-chain Transaction Data and USD Prices](/balancer-simulations/additional-code-and-instructions/onchaintransactions.md)
{% endcontent-ref %}

B) external **price data**, to add information on token prices **in USD** and analyse arbitrage opportunities, or metrics like Total Value Locked (TVL)

{% content-ref url="/pages/-MRwyE1liSHZEqeLq0TJ" %}
[Adding On-chain Transaction Data and USD Prices](/balancer-simulations/additional-code-and-instructions/onchaintransactions.md)
{% endcontent-ref %}

C) the general **model of a Balancer Pool V1**

{% content-ref url="/pages/-MRx-Il6eWZQ2rV4b\_r-" %}
[Balancer: the Python edition](/balancer-simulations/additional-code-and-instructions/balancer-the-python-edition.md)
{% endcontent-ref %}

D) and a **Jupyter Notebook** to tie together all elements, to customize simulations, plot charts and draw conclusions

{% content-ref url="/pages/-MRwxRsTSi3xuI8-oUZz" %}
[Pool Exploration](/balancer-simulations/balancer-simulations/pool-exploration.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://token-engineering-balancer.gitbook.io/balancer-simulations/balancer-simulations/v10nboverview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
