# Exchange Equation

Behodler 1 demonstrated the utility of omnischedule token bonding curves in creating an AMM. The bonding token, Scarcity became a medium of exchange to facilitate trading. In Behodler 2, the basic principles remain and Scarcity still plays the same role. However, computationally expensive algorithms such as square root calculations are no longer performed on chain.&#x20;

The entire calculation of the bonding curve movement is left to the calling client. Behodler simply validates the calculations were correctly performed which is computationally much cheaper.&#x20;

This system of Invariant Analysis is akin to the assymetry present in proof of work where calculating the correct hash is very expensive but validating is cheap. The process of trading has been simplified into the exchange equation:

Let ***b*** be the burn fee, a ratio. Let ***F = 1- b***

**\_f** signifies final balance of a token held in Behodler at the end of a trade.

&#x20;**\_i** signifies initial balance of the token.&#x20;

**I** is input toke&#x6E;*.*

**O** is for output token.&#x20;

So **I\_f** is the final balance of input token.

The exchange equation is then:

$$
√F(√I\_f - √I\_i) = (√O\_i - √O\_f)/(F)
$$

> Because fees are levied on both Scarcity and Input in the implementation, the presence of F on both sides of the equation is not simplified.


---

# Agent Instructions: 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://docs.behodler.io/user-docs/further-reading/glossary/exchange-equation.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.
