The decentralized exchange (DEX) Lifinity experienced a bot exploiting price differences and drained all LFNTY-USDC liquidity on December 8. According to Lifinity’s Discord channel, the unexpected response to the failed transaction resulted in a loss of $699,090.
A key member of Lifinity named Durden explained that a bot attempted to trade price differences following the path USDC > xLFNTY > LFNTY > USDC, aiming to profit from the price discrepancies between different trading pairs.
The bot initiated an Immediate-or-Cancel (IOC) market order on Serum v3, a type of order that must be executed immediately at the current market price if possible. Orders that cannot be fulfilled immediately will be canceled.
Durden noted, “But instead of returning an error like most programs, it returned an amount of 0. Our team handled the input amount as 0 and also returned an amount of 0,” causing the next starting price to also be 0. “Since this is a CP curve, the actual price wouldn’t be 0, but the team set an extremely low price, leading to a depletion shortly after.”
Lifinity v1 is an automated market maker (AMM), meaning it uses algorithms to provide liquidity in trading pairs. According to Durden, it relies on the Constant Product Market Maker (CPMM) model, a specific type of AMM model, to maintain balance between the quantities of tokens in the liquidity pool.