KittenSwap Preview (1): Bridging AMMs and OrderBooks with Wide Limit Orders

Kitten Finance
3 min readJan 11, 2021

--

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

1. On AMMs and OrderBooks

The common swap designs are AMMs and OrderBooks of limit orders.

AMMs (such as Uniswap):

  • Good at price discovery and easy to use.
  • However LPs suffer IL and traders are often frontrun by bots.

OrderBooks:

  • Do not have IL and frontrun problems.
  • However liquidity can be scarce especially for new tokens.

Therefore many projects are looking into hybrid AMM + OrderBook designs.

In KittenSwap, we will go deeper than simply offering two separate choices.

KittenSwap can bring LPs and traders the best of both worlds, by providing a continuous spectrum of products.

2. Wide Limit Orders: smarter limit orders

Here we introduce the first such products.

It can be named Wide Limit Orders (WLOs), because usual limit orders are narrow by comparison.

As an example, imagine you’d like to liquidate 300 token for ETH.

If you create a limit order of “Sell 300 token @ 0.1 ETH per token”, then this is a narrow order, because it only covers a point in the price axis.

Experienced traders will create multiple orders, such as:

  • Sell 100 token @ 0.09 ETH per token.
  • Sell 100 token @ 0.10 ETH per token.
  • Sell 100 token @ 0.11 ETH per token.

Because these orders can cover three points in the price axis, your liquidation plan is now more reliable, and the liquidity of the token is also improved. So this benefits everyone.

With WLO, you can create an infinite number of limit orders at once.

If you create a WLO of “Sell 100 token @ 0.09~0.11 ETH per token”, then this order can cover the whole 0.09~0.11 ETH range.

WLOs are smart because they have built-in price discovery mechanism.

When you buy from a WLO, the more you buy, the higher the price.

In this example, after computing some simple integrals, we have:

  • If you buy 100 token from the WLO, the price is moved to 0.0971.
  • If you buy 200 token from the WLO, the price is moved to 0.1038.
  • If you buy 300 token from the WLO, the price is moved to 0.11 and the order is fully executed.

And this is beginning to look a bit like Uniswap.

3. WLOs: the bridge between OrderBooks and AMMs

Remember you can set the width of the WLO as you wish.

  • If you set it narrow, it is like usual limit orders in OrderBooks.
  • If you set it wide (such as “Sell 10 ETH @ 1500~5000 USD per ETH”), it is a bit like being a Uniswap LP (on one side of the liquidity).

In the later case, the differences between WLOs and AMMs are:

  1. With WLO, you can contribute to just one side of the liquidity.
  2. With WLO, you have much better control over everything, such as the price and width of the WLO.
  3. With WLO, you are no longer providing liquidity after your order is fully executed.
  4. In AMM, all liquidity are concentrated into one pool instead of multiple orders, therefore making a trade can be quicker.

The first and second points are merits of WLO.

The third and fourth points show us an important viewpoint:

AMMs are similar to dynamic WLO pools.

We will continue the discussion in part 2 of this series.

KittenSwap v0.0 is at https://www.kittenswap.org/ and WLOs will be available in v0.1.

Check https://www.kitten.finance/ for updates and releases.

--

--

No responses yet