Lifinity's LFNTY Pool Loses $700,000 Due to Trading Bot Error

Date: 2023-12-10 Author: Dima Zakharov Categories: CRYPTO PAYMENTS, IN WORLD
news-banner
In a surprising turn of events, Lifinity's LFNTY-USDC pool faced a significant setback as a trading bot mishap resulted in a loss of $699,090. The incident unfolded on December 8th, shaking the cryptocurrency community.

The bot, known as "Derden," initiated an arbitrage trade involving the USDC > xLFNTY > LFNTY > USDC route in an attempt to profit from price differences across different trading pairs. To execute this trade, the bot placed a market order known as "Immediate-or-Cancel" (IOC) on Serum v3, which should have been executed immediately at the current market price. However, instead of returning an error as most programs would, the bot returned a zero sum on the output.

According to Derden, this unexpected behavior caused the program to update the price of the last transaction to zero, resulting in the next starting price also being set to zero. This abnormality led to an immediate drain of the pool's funds.

Lifinity v1, the automated market maker (AMM) responsible for this pool, relies on market-making algorithms to provide liquidity in trading pairs. Derden mentioned that the CPMM (Constant Product Market Maker) model, a special type of AMM, is used to maintain balance between two token quantities in the liquidity pool.

While other decentralized exchanges like Uniswap and Bancor also employ this model, Lifinity v1 doesn't support the standard CP curve used in traditional AMMs but can replicate its function. One of the solutions used for replication was calling the "last price" function for the next initial price. However, due to the error returning a zero price, the bot was able to exploit the inconsistency and deplete the funds.

The Lifinity team is actively working on restoring liquidity to the pool, reviewing the protocol's code, and attempting to recover the lost funds. Zero-sum transactions are no longer accepted as measures are put in place to prevent future incidents. This incident serves as a cautionary tale in the world of decentralized finance and trading bots.
image

Leave Your Comments