The pairing of traders between users of decentralized finance (DeFi) is done by GMX, like other DEXs, using smart contracts. Decentralized finance covers transactions made on a blockchain that does not involve a third party.
Since its launch in 2021, DEX has executed more than $45 billion in trading volume, allowing individuals to trade spot and perpetual futures using its on-chain trading interface at minimal costs.
The flaw is that GMX allows customers to trade at zero slippage, which is the gap between the estimated price of a trade and the price at which the deal was executed. But since all pricing information on GMX comes from centralized exchanges like Binance or FTX, a trader might acquire a lot of tokens. In this example, AVAX—on 0% slippage, quickly raises prices on those exchanges by putting buy orders there and then quickly increases the value of the initial position by selling it on GMX.
Joshua Lim, the head of derivatives at Genesis Trading, in a series of tweets on Sunday said that the trader had taken advantage of the GMX loophole five times in total, earning between $500,000 and $700,000. In a since-deleted tweet, the security company PeckShield estimated the profits at $565,000.
According to Lim, the traders took positions between $4 million and $5 million each time and made more than $158,000 on their first transaction. He said that while GMX operated "as intended," this wasn't your normal attack.
GMX developers announced late Sunday that they were looking into the flaw and had, in the meantime, limited open interest, or the amount of open futures contracts, for AVAX on their exchange to $2 million. A significant developer predicted a solution would be available in about two weeks. According to statistics, the native tokens of GMX decreased by 12% during the last day amid a general market fall, bringing the two-week losses to over 30%.