Order books have proven highly effective in traditional finance (TradFi) but reveal limitations when applied to decentralized finance (DeFi). Many protocols still rely on off-chain order books as matching engines and handle settlement on-chain. Others have eliminated centralization and replaced order books with Automated Market Makers (AMMs).
The primary distinction between these two approaches lies in how they quote prices. Let's delve into and analyze each in detail.
The Difference Between Order Book-based and AMM-based Pricing
Each approach quotes prices differently and relies on specific elements for successful matching. However, liquidity remains crucial in both cases.
In order book-based protocols, buyers and sellers submit their orders. These are recorded in the book as an aggregated list. Once matched, trades are successfully executed.
The bid-ask price spread is essential in this process, serving as the de facto measure of market liquidity. In these protocols, the bid-ask price spread represents the difference between the buy and sell prices of the asset quoted by the market maker. In simple terms, it's the difference between the highest price a buyer is willing to pay and the lowest price a seller is willing to accept.
Traders accept one of these prices based on their position in the trade – whether they are interested in buying or selling the asset. When liquidity becomes scarce or market conditions turn unfavorable for market makers, the bid-ask price spread increases.
Another scenario where the spread widens is when market makers and professional traders perceive imminent risk and increase the difference between the 2 prices. Although a wider spread means higher earnings for market makers, it must be kept within acceptable limits to ensure trades are placed.
AMMs are automated actors whose purpose is to establish prices following a specific algorithm. Being controlled by smart contracts, they offer superior speed and safety, removing the need for using order books.
Unlike their order book-based counterparts, AMM-based perpetual protocols must factor in other elements when quoting prices to traders: available liquidity, asset risk profile, and current market conditions. Failing to capture these factors results in direct losses to the protocol and liquidity providers.
Given the importance of the elements mentioned above, Parifi has developed a sophisticated alternative. Apart from employing deterministic algorithms, the solution is a framework based on liquidity curves, pool utilization, deviation coefficient, and deviation constant.
Here’s a quick overview of these elements:
The liquidity curve – a function of utilization and deviation. It's an innovative mechanism that leverages on-chain oracles and uses parabolic and sigmoid functions to quote prices and fees.
Utilization of the pool – a measure of the liquidity available to traders to open positions.
Deviation coefficient - a constant set by the protocol based on the risk profile of the asset and market conditions.
Deviation constant - used to set the minimum deviation for the curve for a specific asset.
The liquidity curve calculates the deviation or virtual spread from the oracle price based on the current utilization of the pool. The curve's formula models the relationship between liquidity and asset prices and is utilized to quote prices for both sides of the trade. This results in pricing stability and predictability for traders.
When the market utilization increases, the deviated price quoted to the trader gradually moves away from the actual price received from the price oracle. The curve intervenes at this point and controls the steepness of the deviation. And the deviation coefficient is used to adjust the impact that utilization has on the deviation.
This adaptive pricing framework functions as a market liquidity metric, aiming to replicate the bid-ask price spread used in order book-based protocols. So liquidity is essential. That's why Parifi uses the pool to measure how much liquidity is available to traders to open positions.
More available liquidity encourages traders to open positions by quoting prices very close to the actual market price. This resembles the negligible spread in order book-based exchanges.
When the number of positions opened by traders increases, the liquidity for these positions is locked. This reduces the total available liquidity and increases the utilization. Consequently, it becomes more expensive for traders to borrow funds, and less favorable prices are quoted for the trades. This resembles a high bid-ask spread in order book-based exchanges.
Unpredictable price deviations from the underlying asset were one of the primary inefficiencies Parifi aimed to solve. Hence, the complex framework combines all these elements, including the deviation coefficient.
As the value of the deviation coefficient increases, the curve becomes steeper, and deviation increases more rapidly with an increase in utilization. If the market conditions are stable, a low value of the deviation coefficient means the asset is more stable, while a high value means the asset is more volatile.
As for the deviation constant, which sets the minimum curve deviation for a specific asset, its value is initially set to zero. However, it can be adjusted according to the asset's risk profile and market conditions.
While the order book model is functional, its centralized nature contradicts the principles of DeFi. Therefore, certain modifications were necessary to efficiently incorporate a similar approach into an AMM-based protocol like Parifi.
This led to creating a sophisticated adaptive pricing framework designed to rectify previous pricing issues and benefit both traders and liquidity providers.
Inefficient pricing has been a persistent issue in DeFi derivatives, and the application of unsuitable traditional finance methods has proven to be less than ideal. To expand this significantly undervalued market, it is crucial to develop solutions that enhance the robustness of perpetual contracts, making them more appealing to both traders and liquidity providers.