# EP 19: Bonding Curve Algorithms for Autonomous Market Makers (DEX)

### Summary of 4 different algorithms used in AMM

`Welcome to all our new subscribers! Please forward this week's entry to a friend, neighbour, colleague, frenemy, or in-law to spread the word. And for those who missed last week's episode, you can find it `

`here`

`. `

TLDR below. This is not financial advice.

Catch the episode on YouTube

Economics of tokenisation and ecosystem is free weekly in your inbox. Please share it with anyone that can benefit from this knowledge.

# General Conclusion

Oh boy, we are covering a lot in this episode. Buckle up. It's fun, I promise you.

In Part 1, we covered the basics of token bonding curves and understand how the shape of the curve affects the incentive mechanism. We used a 2D graph to visualise the understanding of incentives.

In this episode, we look into the application of token bonding curve in decentralised exchanges (DEX). Specifically, the use case of Autonomous Market Maker (AMM).

We dive into 4 case studies, of how token bonding curve adds real economic value to the ecosystem.

Projects in this episode: Bancor, Uniswap, Balancer, Curve

The **concept** of token bonding curve in the 4 DEXes are the same. But the **application** of how the token bonding curve algorithm is built is different. So we uncover the **4 various algorithms** used in the 4 different token bonding curves.

WE'RE GOING PREMIUM.

Economics Design is going to have premium content starting **August 15, 2020 (Season 2).** Premium users will receive case-study content and analysis of various token ecosystems. Best for crypto-entrepreneurs, token economics designers/engineers and investors. We will also be adding more analysis of token prices moving forward.

Free subscribers will receive interview sessions episodes and some content.

Subscribe at US$10 / month or US$100 per year for access. *Crypto payment coming soon! Once I figure out how.*

# 1. In Pegged Tokens

This is the most straight forward and basic method. Bonding curves don't add *much* economic value, but we still use them.

Basically, 1 token into the smart contract = minting 1 new token.

Where do we see it? Aave. When you deposit 1 USDT in Aave, they mint 1 aUSD.

# 2. In Autonomous Market Maker (AMM)

This is probably the most popular use-case of bonding curves now, thanks to Bancor. Bancor is arguably the leader of using bonding curves in AMM.

Instead of bonding curves showing the relationship between token price and token supply, it shows the **relationship between token A and token B.**

How is it done? Via math formulas. Previous episode, we talked about the **shape of curve**, but in AMM, all the shapes are pretty much the same (concave shape). But the math formulas differ very much. The similarity in the math formulas is that they use this thing called **invariant**. It follows a physics formula in energy conservation principle.

Also, previously, we only talked about 2D graph visualisation. But with AMM, we can explore 3D, 4D, even nth-dimension graphs!

We use AMM in DEX because it facilitates transparent price discovery.

Where do we see it? Bancor, Uniswap, Balancer, Curve. You use these protocols to change Token A (e.g. MKR) for Token B (e.g. USDT).

Listen on Podcast

# 3. Application to Your Project

If I can summarise, we are looking at 2 different types of models here.

One model is looking only at AMM with 2 tokens interacting with each other via a constant (aka invariant) in the model.

The other model is looking at more than 2 tokens interacting with each other via a constant (aka invariant) in the model.

Given the constraint of the constant, there is still a bunch of really fun variables to play around and change. For example, changing various token weightage, allowing for information via oracles, etc.

**So if you are starting up a DEX or a protocol that requires AMM, take note of the following:**

Your invariant in your math model

Number of tokens to consider

What variables can you relax in your model (e.g. token weightage, tokens chosen)

There is also a part that I did not cover on AMM, which is price slippage and impermanent loss due to AMM. But this is beyond the scope of this episode.

# What Else Did You Miss?

Table summarising the various bonding curves algorithms used in DEX

Math

*concepts*of Bonding Curve in Autonomous Market MakerGeneral bonding curve and math in AMM

When do we need a total supply, when do we not?

Examples of log-function graphs and why do people use it (Follow up from previous episode)

Mapping bonding curves for projects

SUMS of token functions and how bonding curves are used there

Bonding curves in Stable tokens (pegged tokens)

Bonding curves in Security and Utility tokens

Bonding curves in Autonomous Market Maker (AMM)

Price discovery — a spectrum of methods

Why AMM in Decentralised Exchanges (DEX)

History of DEXes that use AMM

Case study 1, #Bancor

Case study 2, #Uniswap

Case study 3, #Balancer

Case study 4, #Curve

**TLDR**:

Instead of bonding curves showing the relationship between token price and token supply, in AMM, bonding curves shows the **relationship between token A and token B.** It is done via math, specifically using a variable called invariant. Also, you can use more than just 2 tokens in your AMM algorithm!

Economics Design is going to have premium content starting

August 15, 2020 (Season 2).Premium users will receive case-study content and analysis of various token ecosystems. Best for crypto-entrepreneurs, token economics designers/engineers and investors. We will also be adding more analysis of token prices moving forward. Subscribe at US$10 / month or US$100 per year for access.