Liquidity Strategies for Decentralized Exchanges Part II

Tito Titov
weiDex
Published in
7 min readJun 18, 2019

Introduction from part I

As I mentioned in the previous part, there are many strategies for market making. In this post, we will dive deeper into one different approach with more risk and many possible outcomes. I am not a financial adviser and I do not guarantee any profits or losses. I will try to make an objectively high-level overview of one more decentralized market making strategy, that does not depend on any centralized exchange and it is mainly based on mathematics, market dynamics and a good amount of chance. This strategy works better if the market that we trade on is more stable and we have smaller price amplitudes.

Straight to the point

In this approach, we will use only one crypto exchange. Initially, we should deposit an equal amount of two tokens measured in dollars. For this example, I will use ETH and DAI. DAI is a stable coin, based on Ethereum smart contract. I prefer to use DAI because the price is almost fixed and this will make our calculations easier and more understandable. I will also declare a few variables that will be used for the formulas in the next lines:

  • Eₐ = Ether amount
  • Eᵣ = Ether current price
  • E𝒹 = Ether price spread
  • E𝒸 = Ether price in $
  • Eᵢ₊ = Ether price increase compared to the initial price in dollars
  • Eᵢ₋ = Ether price decrease compared to the initial price in dollars
  • Dₐ = DAI amount
  • Dᵣ = DAI current price
  • D𝒸 = DAI price in dollars

The strategy looks very simple. The market maker should place mirror orders - bid and ask with small spread compared to the current market price (Fig 1)

Figure 1

In this example E𝒹 = 2$ = 0.8% * Eᵣ.

In the next paragraphs, I will analyze three possible outcomes against holding your assets.

I Variant — prices are stable and both of maker’s orders are executed ( positive outcome)

Let’s assume that E𝒸 = 250$ and D𝒸 is 1$.(This price is changing frequently, but we have a trading bot that is updating our bid/ask orders in every 2–3 minutes.) We should deposit 1 ETH and 250 DAI in the initial moment — an equal amount of DAI and Ether calculated in dollars. Then we should place two orders — bid and ask following the strategy from figure 1.

Figure 2

If the price is relatively stable there is a higher chance that both of our orders will be executed. Then we will have the following outcome:

  • ETH Balance Change : Received — Spent = Eₐ — Eₐ = 0. We will have exactly the same balance as the balance at the beginning of the trading.
  • DAI Balance Change: Received — Spent
  • Received — Spent: (Eᵣ + E𝒹) * Eₐ / Dᵣ — (Eᵣ — E𝒹) * Eₐ / Dᵣ =>
    => Eₐ / Dᵣ (Eᵣ + E𝒹 — Eᵣ + E𝒹) = (Eₐ * 2 * E𝒹) / Dᵣ
  • If we use concrete numbers and Eₐ = 1, Dᵣ =1, E𝒹 = 2$, then we will have profit = 2 * E𝒹 = 4$ in DAI. Our profit will be 4 DAI.

This outcome could be generalized, following the profit formula :

(Eₐ * 2 * E𝒹) / Dᵣ

Figure 3

We could make the following conclusions from figure 3:

  • Higher E𝒹 = Higher Profit
  • Higher Eₐ= Higher Profit
  • Higher DAI Price = Lower Profit in DAI — this does not mean that the dollar profit is lower. (For this case, the red plot Dₐ : Dᵣ does not make sense, because the DAI price is almost constant. However, the same formulas could be used for other pairs and the red plot from figure 3 could play a significant role in the final results)

II Variant — Ether price is increasing

II a — Ask order is executed

The price is increasing, but only our ask order (figure 2) has been executed. Now we have:

  • ETH balance= 0
  • DAI balance= ((Eᵣ + E𝒹) * Eₐ) / Dᵣ (Approx. Dᵣ = 1 ) + Dₐ =>
    => Eᵣ * Eₐ(Approx. Dₐ) + E𝒹 * Eₐ + Dₐ = 2ₐ *+ E𝒹 * Eₐ
  • if Dₐ = 200 and Eₐ = 1 & E𝒹 = 2$, then we have
    DAI balance = 2 * 200 + 2 * 1 = 402 DAI

Now we could wait for our bid order to be executed and we will end in I variant. The problem is that this could take ages or never happen (if we are at the beginning of the bull market). We could also buy back our ether, but in this case, we will have a lower amount of ETH and DAI compared to the initial moment, but we will have small upside in Dollars compared to the initial moment. Then if the price of ether goes down we could have even some losses. I do not know which is the better solution — to wait for the bid order or to buy back your ETH if we are in the bull market.

II b— Bid order is executed

The price is increasing, but only our bid order (figure 2) has been executed. Now we have:

  • ETH balance = 2 * Eₐ
  • DAI balance = Dₐ —( Eᵣ * Eₐ(Approx. Dₐ) — Eₐ * E𝒹)/Dᵣ(Approx. 1) =>
    => Dₐ — Dₐ + Eₐ * E𝒹 = Eₐ * E𝒹
  • if Eₐ = 1 & E𝒹 =2$, then DAI balance = 1*2 = 2 DAI

Now we could wait for our ask order to be executed (at a better rate, because prices are increasing) and we will end in I variant plus bonus, because of the increased ETH price.

We will end up with: 2 * E𝒹 * Eₐ + Eᵢ₊* Eₐ (Profit in DAI)

III Variant — Ether price is going down

III a — Ask order is executed

The price is increasing, but only our ask order (figure 2) has been executed. Now we have:

  • ETH balance = 0
  • DAI balance= ((Eᵣ + E𝒹) * Eₐ)/ Dᵣ (Approx. Dᵣ =1 ) + Dₐ =>
    => Eᵣ* Eₐ (Approx. Dₐ) + E𝒹 * Eₐ + Dₐ = 2 * Dₐ + E𝒹 *Eₐ
  • if Dₐ = 200 and Eₐ = 1 & E𝒹 = 2$, then we have
    DAI balance = 2 * 200 + 2 * 1 = 402 DAI

Now we could wait for our bid order to be executed (at better rate, because prices are going down) and we will end in I variant plus bonus, because of the decrease in ETH price.

We will end up with: 2* E𝒹 * Eₐ + Eᵢ₋* Eₐ(Profit in DAI)

III b — Bid order is executed

The price is decreasing, but only our bid order (figure 2) has been executed. Now we have:

  • ETH balance = 2 * Eₐ
  • DAI balance = Dₐ — ( Eᵣ * Eₐ(Approx. Dₐ) — Eₐ * E𝒹) / Dᵣ(Approx. 1) =>
    => Dₐ — Dₐ + Eₐ * E𝒹 = Eₐ * E𝒹
  • Eₐ = 1 and E𝒹 = 2$, then we have DAI balance = 2 * 1 = 2 DAI

Now we could wait for our ask order to be executed and we will end in I variant. The problem is that this could take ages or never happen (if we are at the beginning of the bear market). We could also buy back our DAI, but in this case, we will have a lower amount of ETH and DAI compared to the initial moment.

Key requirements for successful market making

In order to potentially earn profit from this market making strategy we should meet the following requirements:

  • Stable price of the trading pair (if it is possible on the crypto market)
  • No deposit/withdraw/make order taxes
  • Free order cancellation
  • High-frequency trading
  • Automated trading availability (Market Making Bots through API)
  • An incentive for market makers — optional (this will bring more profit and could cover some loses)
  • Referral system (this could lower the trading fees — you could refer your own account — accounts in DEXes are anonymous ;))

It is hard to find such kind of DEX, nowadays. We could sacrifice some of these requirements, but if we could find most of them in one place this will increase our winning chance. For this reason, I could offer one DEX that covers the above-mentioned points.

It is called weiDex — https://app.weidex.market:

  • There is no deposit/withdraw fee
  • Order cancellation is implemented with time expiration — a typical solution for Ethereum based DEXes
  • It is possible to do high-frequency trading, because of the off-chain order book
  • There is an open API and the team have implemented simple trading bot, that you could run on your own computer
  • Market Makers are receiving 50% of taker fees
  • Smart contract level referral system for 20% of referred user’s trading fees

If we use weiDex or similar DEX then we will have the above-mentioned profit, no extra fees and a bonus of 50% from taker’s fees.

In the following posts, we will dive deeper into more and more market making strategies for Decentralized Exchanges.

--

--

Tito Titov
weiDex
Editor for

Geek and lifelong learner seeking new techs, ideas and innovations in general. Public speaker and blockchain enthusiast. https://twitter.com/TitoMarchev