---
description: Coincidence?
---

# CFMM Rediscovery

If we view the Derivio's aforementioned model in another way, by denoting the final long payout as x, the final short payout as y, and rearranging our formula, we would have:

&#x20;                              $$x*y = \frac{\text{Final Short \%}}{\text{Final Long \%}} \times c_{profit} \times \frac{\text{Final Long \%}}{\text{Final Short \%}} \times c_{profit} = c_{profit}^2$$

Surprisingly, this is a constant-function market maker (CFMM) hidden behind the scene! Notice that $$k = c_{profit}^2$$ which is a constant.

A CFMM is a market maker with the property that the amount of any asset held in its inventory is completely described by a well-defined function of the amounts of the other assets in its inventory. Its variants are commonly used as a price discovery tool in numerous on-chain exchange models. By giving traders the right to move the price on the curve through trading activities, the model could guarantee instant liquidity without distorting the price feed.

The regularization constant $$c_{reg}$$, can be thought of as the initial liquidity added to both sides of the CFMM curve. When $$c_{reg} = 0$$, the pool has no liquidity, meaning any open orders can push the price to either 0 or infinity. By introducing $$c_{reg}$$, the pool can provide some liquidity into the$$xy = c_{profit}^2$$ model at a fair price of 0.5, to be adjusted by traders. Similar to the vanilla CFMM model, the higher the value of $$c_{reg}$$, the less market impact traders will have.&#x20;

&#x20;                                                           $$\text{Long OI} = \text{Long OI} + c_{reg}$$

&#x20;                                                          $$\text{Short OI} = \text{Short OI} + c_{reg}$$

<div><figure><img src="https://321027494-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIIrSj6j1yGgDveIXYRQ%2Fuploads%2F3w5bhkEeFfUJEvf2zzGQ%2Fdesmos-graph%20(8).png?alt=media&#x26;token=b10e2459-b07d-47a1-8e4b-d42fb5b8cfaf" alt=""><figcaption><p><span class="math">c_{reg} \rightarrow 0</span></p></figcaption></figure> <figure><img src="https://321027494-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIIrSj6j1yGgDveIXYRQ%2Fuploads%2FTCHWs0jQOa1EJ4yJ2Xy0%2Fdesmos-graph%20(9).png?alt=media&#x26;token=aef4e6bb-fb83-42b1-b712-8043f952b04e" alt=""><figcaption><p><span class="math">c_{reg} \gt 0</span></p></figcaption></figure> <figure><img src="https://321027494-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIIrSj6j1yGgDveIXYRQ%2Fuploads%2FXVwnXvD3JAeRRfpjGQC8%2Fdesmos-graph%20(10).png?alt=media&#x26;token=43b0d6b7-9303-4076-98e0-e4d657d801c3" alt=""><figcaption><p><span class="math">c_{reg} \rightarrow \infin</span></p></figcaption></figure></div>

The long-short ratio floor value $$c_{floor}$$ is depicted in the figure above as the flattened section of the CFMM curve beyond the green normal range. As you can see, the curve deviates from the hyperbola and becomes linear beyond the green ranges, and the impact of trader is thus slightly reduced. By capping the payout curve within reasonable ranges, traders are able to determine the fair pricing of options without any unexpected fluctuations.

Ultimately, the integral / Riemann sum, representing the Time-Weighted Average Payout discovered over the entire trading period in the CFMM model, mitigates any adverse impact on user experience from rapid fluctuations. This ensures a fair execution environment for all traders, and could also reduce the harm of any potential oracle manipulation events.\
