An error in an Immediately-or-Cancel order resulted in the removal of approximately $700,000 from Lifinity’s LFNTY-USDC pool. On December 8, an arbitrage bot emptied the LFNTY-USDC pool on decentralized exchange (DEX) Lifinity. The $699,090 loss purportedly caused by an unexpected reaction to a failed transaction, as indicated in Lifinity’s Discord channel.
Durden, a core member of Lifinity reported that a bot tried to profit from price differences between several trading pairs by executing an arbitrage transaction attempting to go from USDC to xLFNTY to LFNTY and back to USDC. On Serum v3, the bot initiated an Immediate-or-Cancel (IOC) market order requiring immediate execution at the prevailing market price if filled. Orders that take time to complete will canceled.
However, as most programs do, it returned a 0 amount rather than an error. The program updated the last transaction price to zero, making the following beginning price likewise zero, Durden said. “Our pools processed the 0 amount in and returned 0 amount out.”
“Since it’s a CP curve, the actual price won’t be 0, but the pool did offer a meager price, resulting in the drain right after.”
As an automated market maker (AMM), Lifinity v1 generates liquidity in trading pairs via the use of algorithms. Durden claims that it depends on a specific type of AMM model called a constant product market maker (CPMM) to keep two token quantities in a liquidity pool in equilibrium.
Other decentralized exchanges, including Bancor and Unisawp, also use this technique. Although Lifinity v1 may mimic the function of a typical constant product (CP) curve, it is not compatible with regular CPMMs.
Calling a “last price” function to the next beginning price was one way to recreate it. But because the bug provided a price of 0, the bot was able to take advantage of the difference and destroy the money.
A community member noted that the occurrence was not the result of an attack on X, the old home of Twitter. Lifinity‘s staff is trying to recover funds and is reworking the protocol code to bring liquidity back into the pool. Trades that result in a zero amount are no longer permitted.