KittenSwap Preview (4): Shifting the Bonding Curve for Better Pricing in an AMM

This is part 4 of the KittenSwap series, in which we gradually present our design for the next-generation swap.

KittenSwap is at https://www.kittenswap.org/ and you can trade our first IKO (Initial KittenSwap Offering) token \$LIQUID there.

LIQUID has a first-in-DeFi feature called AutoBoost. Whenever LIQUID is burned, its price is automatically boosted. You can immediately see the price rise in KittenSwap UI, and you can trade it.

AutoBoost is not a gimmick. It has a solid foundation with formulas, which shows we can shift the bonding curve for better pricing in an AMM.

1. What Happens When You Burn Tokens

It begins with the burning of tokens.

When tokens are burned, from the supply-demand curve, we expect the price of the token to rise, because of the reduced supply.

However, the price rise is not guaranteed in real world.

Currently AMMs such as Uniswap will not change price after a supply change, which has created problems for elastic supply tokens after rebases.

But this problem is not limited to elastic supply tokens.

Consider the case of LIQUID, which is bought and sold using a bonding curve.

• Assume the initial virtual liquidity is 100 ETH + 1000 LIQUID.
• Trader Albert swaps 25 ETH for 200 LIQUID ( because 125 * 800 = 100 * 1000 ).
• Assume 50 LIQUID is burned for some reason. Now there are only 150 LIQUID circulating.
• Now if all 150 LIQUID is sold to the contract, we can only get 19.73 ETH back (because 125 * 800 = 105.26 * 950).

Therefore, in this naive approach, when 50 LIQUID is burned, there will be 25–19.73=5.27 ETH forever stuck in the contract, essentially because there is not enough LIQUID to move the bonding curve back to 100 ETH + 1000 LIQUID.

LIQUID solves this problem by shifting the bonding curve.

Therefore whenever some token is burned, the price of LIQUID goes up immediately.

And you will able to get all ETH in the contract when all token is sold.

Here is the code in the LIQUID contract:

More importantly, this method can be used to improve other AMMs as well.

It opens a whole new world of possibilities.

2. The Formulas

Medium does not have support for LaTeX math. So we will use images here.

From the constant-product-market-maker formula, we have:

The meaning of the above formula is, if all circulating tokens are sold to the contract, traders shall be able to receive all real ETH stored in the contract.

Let’s see what happens when tokens are burned.

Now this is interesting, because we have some freedom in choosing the new bonding curve. We will talk about this in the next section.

The choice of LIQUID is to let the amount of ETH reserve stay the same:

and then:

Therefore, reserve tokens shall also be burned by x% when circulating tokens are burned by x%:

and the result on price is exactly: whenever x% of circulating tokens are burned, the price of the token immediately goes up by x%.

And this is the AutoBoost feature of LIQUID.

3. The Secret in the Bonding Curve

(To be continued)

More from Kitten Finance

https://www.kitten.finance/

Bitcoin Coming Of Age

Get the Medium app