RESEARCH REPORT ABOUT DODO

CoinEx Institution
19 min readSep 14, 2020

--

Author: Gamals Ahmed, CoinEx Business Ambassador

ABSTRACT

On-chain liquidity is to DeFi what oil was to the Industrial Revolution.

From Bancor to Uniswap to Curve, automated market makers (AMMs) have transformed the world of decentralized finance, but they are merely a stepping stone: these algorithms are too primitive and static to work in the long run. They do not respond intelligently to market changes or employ proactive trading strategies like human market makers.

This is why built DODO, a next-generation algorithmic market maker capable of responding to changing markets and liquidity constraints in real-time.

1.INTRODUCTION

DEXs Order book are fundamentally unsuited for the blockchain world today. Their flaws are twofold: they cannot share their liquidity with other DeFi protocols, and they fail to take advantage of the overall growth in DeFi liquidity, due to the lack of composability.

What’s more, order book DEXs are at the mercy of centralized exchanges (CEXs). As soon as these DEXs lose access to the APIs provided by CEXs, their liquidity structure collapses.

As a result, order book-based DEXs get the worst of both worlds — their operational costs are barely lower than CEXs, yet they ultimately cannot compete with CEXs in terms of liquidity.

Algorithmic Liquidity: The Blockchain-Native Approach

Putting the financial system on the blockchain means that we have to change the way we think about everything. We now live in a world where the most atomic unit of time is a singular block. It’s only natural that we design products with that as our guiding principle.

The advent of the constant product pricing formula x*y=k was a perfect example of that kind of thinking.

This simple AMM algorithm achieved something absolutely remarkable: it automated trading and eliminated the need for the order book altogether. Thanks to this automation, AMM DEXs, such as Uniswap, Balancer, and Curve, all enjoyed explosive growth upon their releases.

AMMs are “Lazy” Algorithms

Although the AMM was a massive innovation in the DEX space, it is most definitely not a silver bullet. Its biggest flaw is the fact that it allocates funds uniformly across the price range (0, +∞). This means that only funds allocated near the market price are being utilized effectively in trades, with the vast majority of funds underutilized or not utilized at all. That is, most of the inventory of the market maker is sitting around doing nothing, waiting in the wings in case the pool becomes extremely imbalanced.

As a result, constant product AMMs suffer from low fund utilization and high slippage. On the other hand, human market makers outperform AMMs still, because they are capable of constantly identifying inefficiencies in the market and removing them to the best of their abilities. This is the reason why on-chain liquidity for mainstream crypto assets on AMM DEXs are nowhere near the level of CEXs.

Proactive Market Maker (PMM): Next-Generation On-Chain Liquidity Solution

The following product pricing formula is the heart of PMM:

(where i is themarket price and R is the risk factor)

PMM leverages price oracles, mimics the behaviors of human market makers, and efficiently allocates funds near the market price. This translates to a high level of liquidity on par with CEXs. PMM will be explained further in The DODO Advantage section.

1.1 OVERVIEW ABOUT DODO

DODO is a next-generation on-chain liquidity provider, which leverages the Proactive Market Maker algorithm (PMM) to provide pure on-chain and contract-fillable liquidity for everyone.

1.1.1 HOW DOES DODO WORK?

DODO accepts liquidity providers’ assets. It gathers funds near market prices to provide sufficient liquidity. In order to minimize counterparty risks for LPs, DODO dynamically adjusts market prices to encourage arbitrageurs to step in and stabilize LPs’ portfolios.

1.1.2 WHY DODO?

  • Low slippage
  • Single risk exposure
  • No impermanent loss

1.1.3 WHAT CAN YOU DO WITH DODO?

As a trader

  • Each trader enjoys sufficient liquidity similar to that of centralized exchanges
  • Arbitrageurs can profit from price discrepancies between DODO and other exchanges
  • Smart contracts can natively use DODO liquidity to complete on-chain transactions, such as liquidation and auctions

As a Liquidity Provider

  • There are no minimal deposit requirements and restrictions on asset types
  • DODO charges a fee for each transaction and eventually distributes it to LPs as rewards
  • LPs can create trading pairs with their own tokens
  • LPs can obtain liquidity by depositing their tokens they already own, without taking on price risk.

1.1.4 EARLY BIRD CAMPAIGN (IN AUGUST 15, 2020)

A campaign was launched on August 15, 2020. The rationale behind this campaign is to encourage liquidity providers (LPs) to become early adopters of the DODO platform, by offering exclusive rewards to invitees.

Only the ETH/USDC trading pair will be available, and a US$1 million token pool has been allocated for both ETH and USDC. Allocation of quotas will only be provided to invitees who already have a solid understanding of DODO. Token deposits will halt once the pool limits have been reached.

Investment return for LPs is paid out from transaction fees, charged for every trade at 0.3%. According to our backtests, when the DODO total reserve is at one-tenth (1/10) of Uniswap’s level, DODO can provide an impressive 80% APR in return.

That said, market making is not a risk-free undertaking — LPs have to accept price risks due to market fluctuations and smart contract risks. DODO was audited by Peckshield, Inc.

1.1.5 THE DODO ADVANTAGE

DODO is powered by a ground-breaking algorithm called Proactive Market Maker (PMM). PMM leverages price oracles to retrieve accurate market prices of assets as input. It then aims to provide sufficient liquidity near the market price for every asset. The result is that liquidity decreases rapidly when far away from the market price. The following graphs compare the price curves of DODO (PMM) and Uniswap (AMM).

With everything else fixed, it is clear that the PMM curve is significantly flatter than the AMM curve near the market price, indicating higher fund utilization and lower slippage. Prices provided by PMM are more favorable than AMM.

As the market price changes, AMM passively relies on arbitrage trading to change prices. On the other hand, PMM proactively shifts the price curve in the same direction to ensure that the section in the vicinity of the market price remains flat. This ensures the constant provision of sufficient liquidity.

What distinguishes PMM solutions over AMM solutions?

1. High Fund Utilization

PMM, like AMMs, provides liquidity in the price range of zero to positive infinity, but the PMM price curve is significantly flatter in the area near the oracle (market) price. That is, most of the funds are gathered near the market price, which allows for more active, frequent trading, increasing fund utilization.

2. Single Risk Exposure

In PMM, the asking liquidity is solely determined by the amount of base token in the pool, and the bidding liquidity is solely determined by the amount of quote tokens in the pool. It allows the base and quote pools to have different sizes, and thus allows liquidity providers to deposit any amount of either quote or base tokens, rather than both (like Uniswap). DODO Liquidity providers deposit what they already have, nothing more.

3. No Impermanent Loss#

By encouraging arbitrage trading. When individual traders buy base tokens, PMM slightly increases the price to make it more profitable for arbitrageurs to sell base tokens. In PMM, arbitrage trading makes sure that the number of tokens in the pool is always roughly equal to the number of tokens deposited by liquidity providers. This scheme effectively mitigates impermanent loss for liquidity providers, making liquidity provision on DODO a low-risk affair.

4. Next Generation of Liquidity Provision#

Liquidity is the most important resource in the DeFi world, because it is the foundational element in all DeFi projects. There are two major proven approaches to decentralized liquidity provision today:

  • Algorithmic market makers (e.g. Uniswap)
  • Orderbook-based order matching (e.g. dYdX)

However, neither method is sufficient.

  • Compared to centralized exchanges, algorithmic market makers cannot provide sufficient liquidity for mainstream assets. In addition, for niche, long-tail assets, AMM can only provide very basic liquidity support
  • Orderbook-based order matching relies on human market makers to mirroring centralized exchanges liquidity. Effective market makers are expensive, and very few DEX teams can afford them. In addition, this kind of liquidity is difficult to be filled by smart contracts due to the human elements involved, significantly limiting the number of use cases for DeFi practitioners

PMM is also an algorithmic market maker algorithm, but it fundamentally differs from other approaches by mitigating and eliminating their disadvantages and amplifying their advantages. PMM provides sufficient and contract-fillable liquidity on-chain for all assets, empowering DeFi users to take advantage of composability.

Base & Quote Tokens

  • In a trading pair, the base is always the token before the hyphen, and quote after
  • In transactions, price refers to how many quote tokens are needed in exchange for one base token

For example, in the ETH-USDC trading pair, ETH is the base token and USDC is the quote token.

PMM Parameters

The funding pool of PMM is described by four parameters:

  • B_0B0: base token regression target — total number of base tokens deposited by liquidity providers
  • Q_0Q0: quote token regression target — total number of quote tokens deposited by liquidity providers
  • BB: base token balance — number of base tokens currently in the pool
  • QQ: quote token balance — number of quote tokens currently in the pool

PMM Pricing Formula

The PMM price curve is plotted by the following pricing formula:

P_{margin}=iRPmargin=iR

Where RR is defined to be the piecewise function below:

if \ B<B_0, \ R=1-k+(\frac{B_0}{B})²kif B<B0, R=1−k+(BB0)2k

if \ Q<Q_0, \ R=1/(1-k+(\frac{Q_0}{Q})²k)if Q<Q0, R=1/(1−k+(QQ0)2k)

else \ R=1else R=1,

ii is the market price provided by an oracle, and kk is a parameter in the range (0, 1).

The Three Possible States in PMM

At any given time, PMM is in one of three possible states: equilibrium, base token shortage, and quote token shortage.

Initially, i.e. prior to any transaction, the capital pool is in equilibrium, and both base tokens and quote token are at their regression targets.

That is, B=B_0B=B0 and Q=Q_0Q=Q0.

When a trader sells base tokens, the base token balance of the capital pool is higher than the base token regression target; conversely, the quote token balance is now lower than the quote-token regression target. In this state, PMM will try to sell the excess base tokens, lowering the base token balance and increasing the quote token balance, in order to move this state back to the state of equilibrium.

When a trader buys base tokens, the quote token balance of the capital pool is higher than the quote-token regression target; conversely, the base token balance is now lower than the base token regression target. In this state, PMM will try to sell the excess quote tokens, lowering the quote token balance and increasing the base token balance, in order to move this state back to the state of equilibrium.

The parameter RR in the pricing formula above assumes a critical role in facilitating this regression process. The more the capital pool deviates from the equilibrium state, the more RR deviates from 1. When the price given by the PMM algorithm deviates from the market price, arbitrageurs step in to help bring the capital pool back to the equilibrium state.

1) Liquidity Provider Fee

A small amount of transaction fee will be charged on every trade. This fee is called the liquidity provider fee and will be distributed to liquidity providers based on their proportional stake in the capital pool.

More specifically, liquidity provider fees are collected from what buyers received and distributed to liquidity providers who supplied this kind of asset to the capital pool. In other words, liquidity providers are rewarded in the same asset denomination.

For example, when traders buy ETH tokens with USDC tokens, liquidity provider fees will be charged in the form of ETH tokens, and distributed to liquidity providers who deposited ETH tokens into the capital pool.

When traders sell ETH tokens for USDC tokens, liquidity provider fees will be charged in the form of USDC tokens, and distributed to liquidity providers who deposited USDC tokens into the capital pool.

2) Maintainer fee

A maintainer fee is also collected from what buyers received, and will be directly transferred to the maintainer. The maintainer may be a development team, a foundation, or a staking decentralized autonomous organization (DAO).

3) Withdrawal Fee

DODO charges a withdrawal fee from liquidity providers who withdraw their assets and distribute it to all remaining liquidity providers.

The withdrawal fee serves as a protection mechanism for liquidity providers who maintain their supplies of liquidity and contribute to the sustainability and overall health of the DODO platform.

4) Deposit Rewards

Rewards will be distributed to those who make a deposit of base(quote) tokens when the capital pool faces a shortage of base(quote) tokens.

Flexibility and kk, the “Liquidity Parameter”

The parameter kk gives DODO the flexibility to handle different market situations.

When kk is 00, DODO naively sells or buys at market price, as shown by the flat, blue line. As kk increases, DODO’s price curve becomes more “curved”, but, consequently, liquidity becomes increasingly jeopardized, because more funds are placed far away from market price and are thus underutilized or not utilized at all. When kk increases to 11, the flat section near the market price is completely eliminated and the curve essentially becomes a standard AMM curve, which Uniswap uses.

Normally, kk is recommended to be a relatively small value, such as 0.10.1, which could provide liquidity 10 times better than the standard AMM algorithm.

1.2 SMART CONTRACT FRAMEWORK

DODO is built with a set of smart contracts. The following figure shows the framework of these contracts and how they interact with each other in the DODO architecture.

1) Core

The core part of the DODO framework, which contains all the data and logic of DODO, consists of a set of DODO Proxy contracts and a singular DODO Implementation contract. Each trading pair binds with an independent DODO Proxy contract (e.g. WETH-USDC, DAI-USDT, etc.), which is a transparent proxy that only stores states and metadata. All underlying logic lies in the DODO Implementation contract.

2) Entrance

DODO is an open-source contract, and the DODO team welcomes forks. However, it is important to note that the operation of DODO Pair is highly dependent on oracles and parameter fine-tuning, and a misconfigured DODO Pair could potentially cause significant losses for users. Therefore, they deployed an entrance contract to help blockchain developers navigate these obstacles. All DODO Pairs registered in this contract have been rigorously tested and audited, as the DODO team believes the safety of DODO users is of utmost importance. Developers should only look for the entrance called DODO Zoo when developing upon DODO. Even if the DODO Template is upgraded, DODO Zoo will remain unchanged.

3) Helper

The DODO ETH Proxy shown in the figure above helps users convert between ETH and WETH and interact with DODO Pair. This way, the underlying complexity with WETH is abstracted away from users, effectively protecting them — users do and should only care about directly buying or selling ETH on DODO.

1.3 USER GUIDE

1.3.1 FOR TRADERS

There are only two functions that are relevant to traders in the entire contract: buyBaseToken and sellBaseToken.

1. buyBaseToken

This function buys an exact amount of base tokens. If the number of quote tokens needed to pay for these base tokens is larger than maxPayQuote, the transaction will be reverted. If data is not null,flash swap will be triggered.

2. sellBaseToken

This function sells an exact amount of base tokens. If the the number of quote tokens to be received is smaller than minReceiveQuote, the transaction will be reverted. If data is not null,flash swap will be triggered.

DODO also provides a view version of these two functions. View functions can be executed without sending transactions and they help users estimate prices bore spending gas.

1.3.2 FOR LIQUIDITY PROVIDERS (LPS)

For liquidity providers (LPs), the most important functions are deposit and withdrawal.

One of the biggest advantages of the PMM algorithm is that it can manage base or quote token assets separately. That is why the functions below all have two versions, one with the suffix “Base” and another with the suffix “Quote”, to manage base and quote assets respectively. These two versions have the same input and output values.

1. depositBase

This function deposits an exact amount of assets into the capital pool and returns the capital amount issued for you.

2. withdrawBase

This function attempts to withdraw an amount of assets from the capital pool. Since there may be a withdrawal fee, the function returns the exact amount of tokens received by the message sender.

Since the size of the capital pool is constantly changing (transactions may occur at any time), in order to help LPs to completely withdraw all assets, the above two functions will consume all the capital of the message sender and withdraw the corresponding assets. Finally, the exact amount of asset received by the message sender is returned.

1.3.3 FOR DEVELOPERS

Developers can fetch metadata from DODO Zoo, the entrance part of the DODO framework.

function getDODO(

address baseToken,

address quoteToken

) external view returns (address)

Given baseToken and quoteToken, there is only one DODO Pair registered in DODO Zoo at the same time.

1.4 FLASH SWAP

Once you have a deep understanding of flash swap, you will realize the superiority of the DeFi world over the centralized world. The composability of smart contracts has elevated the fund utilization of DeFi to an unprecedented level. Thanks to trustlessness, the cost of credit in DeFi is incredibly low. Once this financial system is integrated into the real world, its potential for improving our society and productivity will be truly boundless. The DODO team hopes that flash swap serves as a primer for DeFi builders and beginners alike to gain an appreciation for the power of DeFi.

1.4.1 WHAT IS FLASH SWAP?

Simply put, you are allowed to pay on credit on DODO! When you buy tokens DODO, you can first get the tokens you want to buy, do anything you want with the tokens, and pay for them later.

1.4.2 HOW DOES FLASH SWAP WORK?

The figure above illustrates the four steps in a flash swap happening under the hood

1. Call the buyBaseToken function from the DODO Pair smart contract

2. DODO Pair transfers the base tokens to the message sender

3. If the parameter data of the buyBaseToken function call is not null, the DODO Pair smart contract will call the dodoCall method of the message sender

4. After the dodoCall is executed, the DODO Pair smart contract will retrieve the quote tokens required for this transaction from the message sender

Flash swap requires the message sender to be a contract that implements the IDODOCallee interface.

1.4.3 WHAT CAN FLASH SWAP DO?

Flash swap can significantly improve market efficiency. Arbitrageurs maintain market parity, and flash swap completely removes capital requirements for them, essentially eliminating the barrier of entry to arbitrage trading.

The following figure illustrates how an arbitrageur might take advantage of the price discrepancies between DODO and Uniswap.

A complete arbitrage-trading maneuver consists of the following 9 steps:

1. The user calls executeBuyArbitrage on UniswapArbitrageur

2. UniswapArbitrageur calls buyBaseToken on DODO Pair and triggers flash swap

3. DODO Pair transfers 1 WETH to UniswapArbitrageur

4. DODO Pair calls dodoCall on UniswapArbitrageur

5. UniswapArbitrageur transfers 1 WETH received from DODO Pair to UniswapV2

6. UniswapArbitrageur calls swap on UniswapV2

7. UniswapV2 transfers 200 USDC to UniswapArbitrageur

8. DODO Pair calls transferFrom and retrieves 150 USDC from UniswapArbitrageur

9. UniswapArbitrageur transfers the remaining 50 USDC to the user

In summary,

  • Steps 2, 3, 4, and 8 take care of the DODO front
  • Steps 5, 6, and 7 take care of the Uniswap front
  • The user is only exposed to the process of sending transactions and making profits, with everything else abstracted away!

The best part about the UniswapArbitrageur contract is that users do not need any capital, nor do they need to know how DODO and Uniswap work. They would simply call a function and, if the execution succeeds, make a profit. If the execution fails, the users would only lose some gas.

In order to avoid unnecessary gas consumption, we recommend that users use eth_call to execute executeBuyArbitrage or executeSellArbitrage in advance to estimate arbitrage returns. If there is an arbitrage opportunity, these two functions will return profit of quote tokens and base tokens after successful execution.

1.5 BUG BOUNTY

The DODO team has implemented a bug bounty program and invites bug bounty hunters to participate.

The scope of the bug bounty program is all contracts in the DODO smart contracts repository.

The probability of finding a bug and winning a reward for the three parts of DODO is: Helper > Entrance > Core.

1.6 REWARDS

Severity of bugs will be triaged and assessed under the CVSS Risk Rating scale.

In addition to bug severity, rewards will be paid out based on the impact of the discovered vulnerabilities, as well as the level of difficulty in discovering these vulnerabilities.

Anyone who reports a unique, previously unreported vulnerability that results in a change to the code or a configuration change and who keeps such vulnerability confidential until it has been resolved by our engineers will be recognized publicly for their contribution, if agreed.

1.7 AUDIT

DODO smart contracts were audited by PeckShield Inc. PeckShield Inc. is a blockchain security company with the goal of elevating the security, privacy, and usability of current blockchain ecosystems by offering top-notch, industry-leading services and products.

1.8 DODO TOKEN DISTRIBUTION

The total supply of the DODO token is 1,000,000,000 and its distribution is as follows:

  • Community Incentives: 60%
  • Core Team/Future Hires/Advisors: 15%
  • Investors: 16%
  • Operations/Marketing/Partnerships: 8%
  • Initial Liquidity (IDO): 1%

1.9 INITIAL DODO OFFERING

Initial DODO Offering (IDO) is a brand new approach to crypto asset issuance. Instead of paying exorbitant listing fees to get listed on CEXs or other DEXs, it is literally free to offer assets on DODO!

Normally, the PMM algorithm requires a price oracle to provide liquidity, but when there is no external market (which is usually the case when you are just starting your asset offering efforts), you can simply set the oracle price to a constant and start an initial DODO offering.

1.9.1 WHAT DO YOU NEED?

As discussed in previous sections, DODO, unlike AMM, does not require quote tokens. The only thing you need to do is to deposit your own tokens to the pool. After your token deposit, PMM creates ask side depth on its own. The more tokens you deposit, the better the liquidity.

Because there are no quote tokens in the pool, there is no bid side depth, but there is no need to worry. There are also no base tokens in the market and no one is selling either. IDO might feel somewhat similar to an auction, but there are some important differences.

Remember the constant price you set for the oracle? That price would be the initial offering price. When a trader buys your tokens, the price rises and quote tokens start flowing into the pool. These quote tokens then produce bid side depth as a result. Maybe we could call IDO a bidirectional auction.

Compared to AMM-based platforms, asset issuance on DODO provides more benefits:

  • Sell tokens from an arbitrary price of your choice with zero capital requirement
  • Sufficient and contract-fillable liquidity
  • Flexible parameters (design your price curve by fine-tuning the parameters)

2.DECENTRALIZATION

DODO will be fully governed by the community, and controlled by three DAOs

  • Admin DAO: Act as an administrator, the ultimate mediator of all issues.
  • Risk Control DAO: Act as a supervisor and deal with all risk events urgently.
  • Earn DAO: To distribute revenue of maintainer.

2.1 PROCESS

When DODO was launched, the team governed all authorities. As the community learns more about DODO, they will gradually return all the rights to the community. Although there is no timeline for this process yet, we do intend to follow the process.

2.1.1WHAT IS THE PURPOSE OF EACH STEP?

1. All admin actions come with a public announcement period to avoid single point failure

2. Anyone can create a new DODO Pair and use it to provide liquidity to their tokens. This marks the return of the code to the community

3. Issue governance tokens and formulate a token distribution plan, which will initiate the step down process

4. Hand over the profit distribution responsibility to Earn DAO

5. After handing admin authority over to the DAO, the team has no real control rights, and only reserves the right to control risk

6. The team steps down completely, marking the last step towards complete decentralization

3.DODO INTEGRATES CHAINLINK LIVE ON MAINNET, KICKSTARTS THE ON-CHAIN LIQUIDITY REVOLUTION

Today, the DODO team is pleased to announce that it has chosen Chainlink as its oracle provider of choice and is already consuming its ETH/USD Price and LINK- USD Price Reference Data feed live on mainnet.

DODO is a nascent on-chain liquidity protocol that offers a smoother, more advanced crypto trading experience than other decentralized exchanges (DEXs). It is powered by the ground-breaking Proactive Market Maker (PMM) algorithm, which mimics human market making behaviors and gathers more capital near the market price in order to facilitate more efficient

and frequent trading. PMM’s major selling point is its outstanding liquidity, which is on par with centralized exchanges (CEXs), making DODO the ideal DEX of choice for traders and liquidity providers alike.

RadarBear, DODO’s co-founder, looks forward to working with Chainlink and kickstarting the on-chain liquidity revolution.

RadarBear said: “At DODO, we believe in leveraging industry expertise and forging strong, meaningful relationships. Chainlink is the undisputed leader in the oracle space — it has a proven track record of solving the oracle problem and providing high quality data to live DeFi applications.” Radar said. “Our backtests confirmed that Chainlink is fully compatible with the DODO platform. Integrating with Chainlink makes perfect sense.”

3.1RISK DISCLOSURE

DODO is a decentralized exchange (DEX) and is not a risk-free investment platform. There are inherent risks to liquidity provision, no matter how small. During significant or prolonged price swings, market makers may suffer losses. Please carefully evaluate your risk tolerance and determine your risk profile before getting started.

Our backtest results indicate that a temporary loss is normal and almost always short-lived. This is analogical to buying index funds — market principles dictate that growth is not monotonous. Please give our backtest report a read here.

DODO is currently in the hypergrowth phase and is seeing a rapid increase in number of users and LPs. As the DODO community grows, so does the trading volume. The higher the trading volume, the higher the LP rewards, and the lower the risks involved. Therefore, using and contributing to DODO is the best way to help DODO grow and minimize your risks.

4.REFERENCES

1. https://medium.com/dodoex/dodo-integrates-chainlink-live-on-mainnet-kickstarts-the-on-chain-liquidity-revolution-ee27e136e122

2. https://dodoex.github.io/docs/docs/

3. https://medium.com/dodoex/dodo-a-revolution-in-on-chain-liquidity-7bc339b9d391

--

--

CoinEx Institution

CoinEx Institution provides you everything you need to know about cryptocurrency, trading and blockchain, and is completely free.