Liquidity Strategies for Decentralized Exchanges Part I

in #blockchain5 years ago (edited)

Status Quo


One of the biggest challenges in front of the decentralized exchanges is the liquidity problem. However, why 4 years after the release of Ethereum and other smart contract languages that are Turing complete, we do not have strong and liquidity rich DEXes? Why are we trading decentralized assets in a centralized way? Why are we putting more and more power to CEXes after all that hacks that have happened and are happening daily?

Technical Problems


I will list a few important concerns that I see from the perspective of an Ethereum developer (I believe that most of the DEXes that we have nowadays are based on Ethereum smart contract. Even if they are based on another blockchain network, the problems should be similar).

  • Order execution takes some time
  • Make/Take orders do require network fees if they are placed on-chain
  • Order cancellation requires a transaction fee in most of the cases
  • If two users are trying to take the same order, both of them will pay network fee, but only one of them will take the order
  • It is harder to take liquidity from other exchange(coping order books like it is done often in centralized exchanges)
  • Real-time margin trading is hard to implement

Workarounds


Order placing could be done off-chain with signed messages — hybrid approach. It still keeps the immutability and cryptographically secures the orders.

Order cancellation could be solved with expiration times.
Expiration could be 2–3 minutes and this will allow high-frequency trading without cancellation fees.

If two users are trying to take the same order, it could be an indicator on the front-end, that shows whether the transaction is in mempool or is “free”.

Market making bots for decentralized exchanges could be developed in order to simplify the process for corporate and retail liquidity providers.

In the following years, we should discover more and more scalable blockchains, faster transactions and we will have real-time trading on-chain that will replace centralized solutions.

Liquidity Approaches


Smart contract market makers such as Bancor and Uniswap provide liquidity according to deterministic algorithms. Their solution is elegant and simple, but still, there are some risks, if we have big price movements (bear or bull market). We have lower risk and lower profit possibility - Figure1

Figure 1

The second approach, which is more risky, more profitable and non-deterministic is based on traditional market making. In our case makers should provide liquidity in crypto assets and reward could be measured in crypto assets or dollars. In order to provide liquidity in an effective manner, users will have to automize the process and to adjust their orders according to the dynamic market price. Liquidity providers could be end users or long term fund investors. We want to decentralize the market making process, that’s why the weiDex team has built market making bot similar to Hummingbot. The code is open source, everyone could download and run the trading bot with a few commands on his own machine. A single user could provide from 10$ to million of dollars liquidity in a completely non-custodial way and to be part of this decentralized liquidity network.

Concrete Market Making Strategies With Examples


There are tons of market making strategies, but I will make a brief overview of two main algorithms. The first one includes two exchanges — one for taking orders and one is for placing orders (figure 2). The algorithm could be explained in a few steps:

  • Put half of your funds in the first exchange and the other half in the second exchange
  • Check the current price of the traded asset on the first exchange (Cp)
  • Place bid(buy) order on the second exchange at price Cp — spread
  • Place ask(sell) order at the second exchange at price Cp + spread
  • If any of the orders on the second exchange is executed, then take mirror order on the first exchange and you will have profit 1*spread
  • If both of the orders are executed you will have profit 2*spread


Figure 2

Problems with this strategy are:

  • The market maker should split his funds in the two exchanges
  • It could be trading/deposit/withdraw taxes in both exchanges
  • If the API of Exchange first exchange is not working or there are some other temporary issues this could lead to loses
  • You should depend on more than one exchange and spread should be significant to cover the fees on both exchanges.
    • In my opinion, this approach is more secure than the second that we will discuss, but the profits are not so good. At the same time, I do not like that we have to depend on two exchanges, especially if one of them is centralized. This will kill the idea of decentralized liquidity network more or less.

      In part II of this post, we will dive deeper into another approach that does not depend on two exchanges but uses only one.
      https://weidex.market
      https://app.weidex.market

      Coin Marketplace

      STEEM 0.28
      TRX 0.13
      JST 0.032
      BTC 65920.41
      ETH 3016.79
      USDT 1.00
      SBD 3.71