CoFiX2.0---The idea and future of the new generation exchange

avatar
NEST爱好者
3 years ago
This article is approximately 1852 words,and reading the entire article takes about 3 minutes
A new generation of DEX based on the EPM model (Equilibrium Pricing Model) - CoFiX will lead DeFi into the era of computable finance.

Written | Danny, CoFiX protocol core contributor

Doing transactions in a decentralized way on the chain is the dream of many people. After repeated trials, everyone found the automatic market-making model AMM, which solved the problem of extremely high matching costs on the chain. However, there are also problems in automatic market-making AMM, that is, the asset pricing problem of the liquidity provider has not been solved, so a new generation of DEX, CoFiX based on the EPM model (equilibrium pricing model) came into being.

In addition, as long as it is a transaction model of a fund pool, impermanent loss is an eternal pain, requiring LPs to hedge, and this operation is extremely professional and expensive. After continuous exploration and improvement, CoFiX version 2.0 has created an automatic hedging model, which is currently the only decentralized exchange in the market that can achieve automatic hedging.

What is the core idea of ​​the equilibrium pricing model?

Different from AMM, the Equilibrium Pricing (EPM) model uses the real-time market price when trading, and the two things of pricing and trading are separated.

In traditional exchanges, pricing and trading are always together, but the functions and costs of the two are not the same. The infrastructure required for pricing is much higher than trading, which is difficult on the chain. EPM is priced based on the oracle and traded with CoFiX. This separation makes the transaction more pure (we will discuss the effectiveness of the NEST oracle in a future article).

Risk Management

CoFiX2.0---The idea and future of the new generation exchange

Risk Management

From the perspective of trading, the risk management ideas of EPM and AMM are also different.

The risk management of AMM is mainly implemented through the change of trading volume: when the trading volume in a certain direction is large, it means that the price information is beneficial to the direction of the transaction, so it is necessary to allow such traders to make certain compensation. The compensation method is to use similar xy =k to fit the actual risk.

It is worth mentioning that price is a random process that cannot be well fitted by a simple function.

In the EPM transaction, the direct risk compensation is mainly carried out through the random process attribute of the price, and the compensation amount is R(SIGAma, D), where sigma is the volatility of the price, and D is the delay time of the transaction (transaction and actual use price time difference), the compensation amount is a choice in the sense of a confidence interval, so it has a certain degree of freedom.

When CoFiX quotes the price of the oracle machine, it will make certain compensation according to the deviation and delay risk actually borne by each transaction, so as to ensure that LP is relatively fair and reasonable in terms of the risk of price changes.

Of course, in actual operation, the design of this price compensation needs to be dynamically adjusted to make it adaptable, because if the risk compensation design for the price is too high, it will not be fair to the transaction parties, thus reducing the transaction demand.

price slippage

AMM has a serious problem, that is, xy=k pricing will produce a large price slippage. This kind of slippage is because the two-dimensional variables of price and trading volume are compressed to only one variable of trading volume to control the entire system. Slippage will be very noticeable when the capital pool is small, so AMM needs huge capital pool size to work well. However, CoFiX does not have this problem, because the price of CoFiX has nothing to do with the size of the capital pool, but only with the law of price changes. In practice, the risk compensation we design also needs to consider adaptability, that is, excessive compensation will reduce the enthusiasm of traders.

market depth

In comparison, CoFix conducts transactions based on market equilibrium prices, so no matter how small the scale is, its price continuity is close to the market price, so in theory, CoFiX transactions can obtain the full depth of the market without changing the transaction price , of course, the actual amount of each transaction will also depend on the total size of the CoFiX capital pool, but this has nothing to do with the relationship between transaction depth and price, it is just a matter of the upper limit of a single transaction.

In addition to the normal price fluctuation risk compensation, in CoFiX, the price of a single transaction will be protected based on the impact cost of the market, but this has nothing to do with the size of the CoFiX capital pool.

Calculability

According to the above analysis, the EPM-based DEX design referenced the risk compensation on the chain from the beginning. This creation can be realized thanks to the computability of the price P. If only a centralized price is referenced, then Credit risk cannot be calculated, so it must be a fully decentralized oracle to provide a computable price sequence.

arbitrage

arbitrage

Since AMM has no risk compensation based on price fluctuations, LPs will inevitably suffer from arbitrage when making markets. In fact, every time the price fluctuates sharply, most of the DEXs with AMM mechanisms may be arbitrage transactions, and this ratio may be as high as 80%. -90% or even higher. For a model like CoFiX, the arbitrage ratio is only generated outside the confidence interval. If a large number of transaction assumptions exist, the arbitrage loss can be covered. The AMM mechanism may continue to lose for a certain period of time. Of course, the dynamics of the CoFiX compensation function reflect the dynamics of price changes, which is a correction to CoFiX 1.0.

image description

CoFiX2.0---The idea and future of the new generation exchange

CoFiX arbitrage space: the shaded area above the red line

CoFiX2.0---The idea and future of the new generation exchange

balance difference

A stable AMM needs to achieve an equilibrium, which is a balance between value traders, arbitrageurs, and LPs: the handling fees contributed by value traders need to cover the arbitrageur’s income and the capital cost of LPs. In this way, there will be a situation that when there are fewer actual traders, the real fee income is less, and a large amount of arbitrage income needs to be compensated, which leads to the withdrawal of LP from the fund pool, which strengthens the disadvantage of price slippage and further establishes the The value trading volume fell into a negative cycle until the entire trading system collapsed.

CoFiX2.0---The idea and future of the new generation exchange

In contrast, the EPM-based CoFiX equilibrium is simpler. If there is a transaction, there will be a commission, and if there is no transaction, there will be no commission. No matter how large the capital pool is, there will be no price slippage, just like buying in the market. It will cause this negative cycle, but it will be stable at a reasonable transaction scale. It can be said that AMM is an unstable equilibrium, and CoFiX will form a stable equilibrium.

CoFiX2.0---The idea and future of the new generation exchange

Positioning of LPs

Whether it is AMM or CoFiX, there are two types of LPs, one is a fund holder who regards transactions as asset management, and the other is a market maker who seeks to obtain stable income. The difference between the two is whether to accept the so-called impermanent loss.

Fund holders dont care about price fluctuations, it provides a fixed strategy, and anyone can trade with it with a given price model and pay a certain fee. This trading strategy is difficult to obtain excess returns, and even has a high probability of causing losses, because this is an asymmetric equilibrium (see the above equilibrium). Market makers will not bear the risk of price fluctuations, so they essentially do not hold positions or only use their initial assets as the only benchmark, so they need to hedge all the time.

Types of market makers

From the perspective of market makers, there are mainly professional market makers and general user market makers. Professional market makers have strong market information and trading capabilities. They not only trade in DEX, but also in various Transactions are completed in CEX, and these transactions may affect pricing, or they may only be traded from the perspective of hedging. However, ordinary user market makers generally only come here to obtain on-chain income (mining or commission), lacking professional hedging capabilities and tools, so they often become fund-type LPs in disguise.

CoFiX2.0---The idea and future of the new generation exchange

hedging

No matter what kind of market maker, hedging is necessary, because they are only here to earn commissions, not to bear the risk of asset price fluctuations - impermanent losses. For most amateur market makers, hedging is a complicated and costly matter. Many people provide liquidity in DEX without hedging at all, resulting in sharp fluctuations in final earnings and even losses. This is actually passive Become a fund-type LP.

The core of hedging is not to hold a position, which means that every behavior that occurs in the fund pool needs to be reversed, so that the risk of LP is zero. This operation requires a script or a professional contract, which has a certain threshold and is the key to market making on the entire chain. Even a professional market maker has a high cost of hedging, especially when transactions are more frequent. Moreover, off-chain hedging destroys the integrity of pure on-chain transactions and requires a combination of on-chain and off-chain transactions. LP is not a simple free operation.

Automatic Hedging Design

CoFiX has a creative automatic hedging design, which keeps the initial asset ratio unchanged. Once the trader deviates, the automatic hedging trader will trade back. The incentive is CoFi. It is equivalent to LPs collectively paying a part of the proceeds to the hedgers, and they do not have to do this kind of operation anymore.

The main idea of ​​automatic hedging is that if the initial ratio is destroyed, the system will generate CoFi rewards. Automatic hedging traders make decisions based on the CoFi value of mining and transaction costs. When the former covers the latters cost, the hedging transaction will be completed , since CoFi mines according to the block, the deviation will always be traded back.

CoFiX2.0---The idea and future of the new generation exchange

CoFiX Net Worth Performance

Judging from the net worth data since the trial operation of CoFiX 2.0, it has basically achieved relative stability, that is, hedging is more effective.

image description

CoFiX2.0---The idea and future of the new generation exchange

Data comes from the chain

CoFiX2.0---The idea and future of the new generation exchange

Data source: Calculated from data on the chain

future development

future development

A simpler automatic hedging mechanism than citing oracles for pricing is to trade stablecoins. There is no need to make a detailed distinction between the prices of stablecoins, but the default is 1:1, but the price difference can be determined by the stablecoins. The higher the value, the higher the compensation (although the deviation is very small), and the automatic hedging will mine according to the LP share, guiding the hedger to complete the balanced transaction. This model will appear in CoFiXs upcoming 2.1, especially when the combination of stablecoins and parallel assets Parasset will be more effective.

Due to the invention of automatic hedging, CoFiX can also implement another model in the future: automatic asset management - through a game structure, LP can achieve the target risk return (unlike YFI liquidity mining, YFI cannot set a specified target yield) without taking any action. This direction will become the key to the exploration of CoFiX 3.0.

Note: Without in-depth understanding, it does not constitute any investment advice.

This article is from a submission and does not represent the Daily position. If reprinted, please indicate the source.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks