Cointime

Download App
iOS & Android

Negative Price AMM ±⟨DiracAMM⟩

Repost from Ethresearch By v-for-vasya: “Negative Price AMM ±⟨DiracAMM⟩” The full report and all related findings are available on the official website of Ethresearch.

We discover that negative liquidity is possible and construct an AMM to access the negative domain by allowing the price to go negative. The invariant for a negative price happens to be the formula for a circle and the liquidity distribution happens to have a power law tail. You can interact with and compare it to an RMM here. Most interesting points are outlined below with link to paper at the end.

Figure 1:Two negatively priced assets can be exchanged between each other for a positive price. An impossible task in tradfi, requiring a fiat numeraire to act as an intermediary.

Summary:

Swapping and liquidity provision transactions of a Concentrated Circular Market Maker (CCMM) are obfuscated using Fully Homomorphic Encryption (FHE) to mitigate MEV in the public mempool by combining game theory with the Kelly criterion. Liquidity of the CCMM is adjusted using a scale parameter and can be modified with a hook in Uniswap v4. We show how it is possible to enter the negative liquidity domain with the CCMM.

Negative Liquidity

If we look at a Constant Product Market Maker (CPMM) such as Uniswap, we can see that it happens to provide liquidity in the negative domain. Take the Uniswap Invariant with liquidity L

It’s just difficult to access this negative liquidity in Uniswap due to the invariant being a hyperbola. By pressing the invariant against the axes, concentrating liquidity, and folding it on itself we can travel to the negative domain. A liquidity provider may become a liquidity taker with the following invariant where z is a scale parameter

We like to call it the DiracAMM (Paul Dirac discovered anti-matter with a similar trick by seeing that energy √E2 could have a negative value in the energy-momentum relation). One can program the invariant to not provide liquidity after touching the axes though, in which case its liquidity distribution L happens to be the Student’s-t distribution with degree of freedom df=2, a special case of a power law tail where the law of large numbers has no predictive capacity on the variance.

LP Payoffs

If price, following a power law, is allowed to flow into the negative, as is empirically observed with various assets, then the LP payoff function happens to resemble a collection of non-linear payoffs.

But it’s not necessary though for the underlying price to be negative for this AMM to be useful. Rather, one suggestion is to use the price of $0 as an offset from the current underlying price of, let’s say $100 . A negative 1 price indicates a decline of the underlying from $100 to $99. If the CCMM has one asset that can not go negative, such as a stablecoin, then it can only have LP payoffs 2A2 and 2B2, but by borrowing the LP position through a lending protocol one could mimic the payoffs of 2D2 and 2C2 respectively.

MEV approach with Kelly Criterion and FHE

Since a gain and a loss can be defined as an offset with a CCMM, we can combine it with the game theory behind rational MEV decision makers who follow the Kelly criterion, a strategy that ensures long-term optimal geometric growth

where f∗ represents a MEV extractor’s portfolio allocation in a MEV attack with the probability of success p and betting odds b. By targeting Kelly-neutrality we set a MEV extractor’s Kelly betting amount f=0 at an increased gas cost by rearranging for the following equality to hold

We do so by introducing two encrypted boolean values (ebool) for swapping Bswap=[0,1] and providing liquidity BLP=[0,1] going into the mempool. Where the boolean value can mean 1 for swap x for y and 0 for swap y for x (or remove and re-add liquidity for BLP). We can also encrypt the swap quantity dx (or dy) as euints, thereby making it unclear what the betting odds b (gain and loss relationship) are.

Setting the expected value of a MEV extractor’s Kelly bet E⟨f∗⟩ = 0. Targeting Kelly-neutrality could be a useful mechanism for MEV. We noticed that with FHE we can selectively target just the variables we want to obfuscate enough without having to encrypt everything and think that this approach could be useful to others looking into MEV.

Further work

An approach to avoid negative prices for the underlying could be to construct a passive wall of liquidity, a liquidity fingerprint that asymmetrically increases non-linearly as price approaches zero, denting price impact. The super-heavy tailed distributions like the Log-Cauchy distribution with concentration parameter c come to mind with liquidity fingerprint in price space being

This is a very interesting liquidity fingerprint because it captures what we see in crypto where some tokens stay where they are, the majority approach the zero bound, and a select few fly towards the right tail. One of the mathematical challenges here being that liquidity spikes to infinity at 0 though.

Comments

All Comments

Recommended for you

  • Cointime's Evening Highlights for May 24th

    1. CryptoPunks Launches “Super Punk World” Digital Avatar Series

  • An address mistakenly transferred about $7,000 in BTC to Satoshi Nakamoto’s wallet

    According to Arkham monitoring, someone accidentally sent 90% of their BTC assets to Satoshi Nakamoto's wallet address last night. They were trying to swap Ordinal for PupsToken, but ended up sending almost their entire wallet balance - about $7,000 worth of BTC.

  • USDC circulation increased by 200 million in the past 7 days

    According to official data, within the 7 days ending on May 16th, Circle issued 1.8 billion USDC, redeemed 1.6 billion USDC, and the circulation increased by 200 million. The total circulation of USDC is 33.2 billion US dollars, and the reserve is 33.4 billion US dollars, of which 3.8 billion US dollars are in cash, and Circle Reserve Fund holds 29.6 billion US dollars.

  • Bitcoin mining company Phoenix Group released its Q1 financial report: net profit of US$66.2 million, a year-on-year increase of 166%

    Phoenix Group, a listed mining company and blockchain technology provider for Bitcoin, released its Q1 financial report, with the following main points:

  • Pudgy Penguins and Lotte strategically cooperate to expand into the Korean market, and the floor price rose by 3.1% on the 7th

    The NFT series "Pudgy Penguins" has recently announced a strategic partnership with South Korean retail and entertainment giant Lotte Group on the X platform to expand its market in South Korea and surrounding areas. More information will be announced in the future. According to CoinGecko data, the floor price of Pudgy Penguins is currently 11.8 ETH, with a 7-day increase of 3.1%.

  • CryptoPunks Launches “Super Punk World” Digital Avatar Series

    Blue-chip NFT project CryptoPunks announced the launch of "Super Punk World" on X platform, which is the project's first release of 500 digital avatars inspired by the iconic CryptoPunks features and combined with Super Cool World attributes. It is reported that the series may launch auctions in the future, and more details about the collection and auction of this series will be announced soon.

  • Core Foundation launches $5 million innovation fund

    CoreDAO announced in a post on X platform that the Core Foundation has launched a $5 million innovation fund. The fund is currently mainly targeting the Indian market and has established strategic partnerships with the Indian Institute of Technology Bombay and some top venture capital companies to support the development of innovative blockchain projects in the country. At present, the fund has opened project funding applications.

  • Drift Foundation: The governance mechanism is gradually being improved, and DRIFT is one of the components

    The Drift Foundation stated on the X platform that the DRIFT token is a component of governance and a key element in empowering the community to shape the future. The governance mechanism is gradually improving, and more information will be announced soon.

  • U.S. Department of Justice: Two Chinese nationals arrested for allegedly defrauding at least $73 million through cryptocurrency investments

    According to the official website of the United States Department of Justice, a complaint from the central region of California was made public yesterday, accusing two Chinese nationals of playing a major role in a money laundering scheme involving cryptocurrency investment fraud.Daren Li, 41 years old, is a dual citizen of China and St. Kitts and Nevis, and is also a resident of China, Cambodia, and the United Arab Emirates. He was arrested on April 12th at Hartsfield-Jackson Atlanta International Airport and later transferred to the central region of California. Yicheng Zhang, 38 years old, is a Chinese national currently residing in Temple City, California. He was arrested yesterday in Los Angeles. Today, they are accused of leading a money laundering scheme related to an international cryptocurrency investment scam, involving at least $73 million. These arrests were made possible thanks to the assistance of our international and US partners, demonstrating the Department of Justice's commitment to continuing to combat the entire cybercrime ecosystem and prevent fraud in various financial markets.

  • Hong Kong expands digital yuan pilot to allow e-CNY wallets for cross-border payments

    The Hong Kong Monetary Authority and the People's Bank of China have expanded their cross-border digital yuan pilot to allow Hong Kong residents to use e-CNY wallets for cross-boundary payments. The digital yuan is China's central bank digital currency, which has been piloted for several years and is among the most advanced of its kind globally. Users can set up wallets using just a phone number and top them up in real-time through 17 Hong Kong retail banks. The HKMA plans to work with the Digital Currency Institute to explore enhancing interoperability in payments and corporate use cases, such as cross-border trade settlement.