Continuous liquidity pools on blockchains
The exchange industry has been a top business in the blockchain space since the invention of Bitcoin. By now, it is a popular idea to run an exchange on a blockchain so that it becomes more transparent and possibly anyone can participate as a shareholder. The first exchange of this kind was Bitshares, launched in 2014.
Three years later, Bancor introduced on Ethereum blockchain a different kind of decentralized exchange based on continuous liquidity pools (CLP).
How do CLP work?
In this paradigm, the trader does not operate against another trader, but against a smart contract. For each trading pair, there are two pools of tokens, one for each token of the pair. The exchange rate is simply the quotient between the reserves. If the reserve of one token decreases, its relative price increases automatically at the contract. Now let us allow anyone to add liquidity (reserves) to this system in exchange of a fair share of the pools. This share takes the form of a new token. If we also impose a trading fee to be collected by the pools themselves, then we have the modern form of CLP exchange. Currently, another example of CLP exchange is Uniswap at Ethereum blockchain. On EOS, we have Bancor’s liquidity pools (see xNation) and recently EOS Argentina has introduced the Evolutiondex protocol.
Thus we have described a form of decentralized exchange that coexists with the traditional order matching system. This new form is attractive because it offers a simple way for anyone to participate as a shareholder of any particular trading pair. It also provides a comfortable experience for traders and for developers who wish to automate trading.
Quantitative explanation of CLP exchanges
Even though there are theoretically many possible choices for the formulas governing the exchange at CLPs, all of the working examples use the formulas below. Say we have CLPs with the tokens AA and BB. Let us call the corresponding pair token AB. Assume we start with 1,000 AA and 100,000 BB at the pools and the total shares for this are 10,000 AB, at the hands of liquidity providers. This means that any shareholder can sell 1 AB to the system (it will be burnt) to obtain 0.1 AA and 10 BB.
If a trader wants to exchange 2 AA in this system, it will obtain 2 x 100,000 / 1,002 BB ≃ 199.6007 BB, minus the fee. In words, this number is equal to the input amount times the current state of pool BB divided by the final state of pool AA.
Get EOS AR’s stories in your inbox
Join Medium for free to get updates from this writer.
When should an investor provide liquidity to a CLP pair?
The exchange formula above is such that the product between the reserves at both pools remains the same after each exchange operation if we neglect the fee. If we now consider the fee, then this product will actually grow after each exchange operation. Considering also the operations of adding and removing liquidity, the quantity that always grows is P1 * P2 / A, where A is the total amount of issued shares, P1 and P2 are the reserves in the pools. The relative price of the connected assets AA and BB will be P1 / P2. Typically, there will be arbitrageurs who will make the system price similar to other markets. Since crypto-assets are so volatile, it is expected that the price oscillates a lot. When this happens, the proportion P1 / P2 moves back and forth as the users do their trades. Each time that P1 / P2 returns to the same value, the shareholders have made a profit, equal to their part of the fees collected by the pools. On the contrary, if the relative price P1 / P2 moved considerably, exceeding the effect of collected fees, the shareholders would be worse than if they would not participate in the pool, simply having the two assets outside. This does not necessarily mean an absolute loss, it is just a comparison between those two possible positions.
It is usually difficult or impossible to predict if a relative price will go up or down in the short term. However it is very often likely that the price will oscillate. That is why it is attractive to invest in continuous liquidity pools. Notice that anyway, the investor must have confidence in the value of both tokens of the pair. Since providing liquidity is attractive, it is possible that soon certain CLPs have plenty of reserves, therefore providing attractive exchange rates, with low spreads and low fees.
Some features introduced by Evolutiondex
Evolution dex is an open source smart contract that was developed by EOS Argentina in order to improve the CLPs offer in EOS.IO blockchains. Perhaps the most salient point of its design is the ability to host an arbitrary number of trading pairs, which anyone can create. In this way, the contract can easily be made public at once, with no private permissions, making a very efficient use of resources.
The pair token or evotoken associated to each pair is a standard token, so that it is easy to monitor, manage and trade. Another novelty introduced by Evolutiondex is the governance of the fee parameter for each pair. A dynamic fee will be useful to adapt to the fickle mood of the market. At the moment of creation of an evotoken, the creator sets an initial fee value, and the name of the fee contract. This contract (or account) will have the permission to change the fee value, between zero and five percent, with a resolution of 0.01%. We will also propose a fee contract model designed in such a way that the owners of the evotoken can vote to decide the fee.
Feel free to join the discussion:
EVODEX: Telegram Group | Github | Subscribe to the channel for updates.







