Joshua Lim Profile picture
in crypto: head of derivatives, genesis trading; galaxy digital; circle. previous life: equity exotics GS; systematic cash equities trading UBS

Sep 18, 2022, 11 tweets

1/ quick thread on the GMX "exploit" last night

having sat on crypto dealing desks for many years, I know that offering liquidity to savvy traders is a painful but necessary part of the game

GLP holders learned that same lesson last night!

2/ last night, trader X successfully extracted profits from GMX's AVAX/USD market by opening large positions at 0 slippage, then moving AVAX/USD on other venues in their favor

this created a sinusoidal pattern for over an hour as X switched from long to short 5 times

3/ let's take a look at the first cycle which took place from 01:15:31 to 01:28:11 UTC. X was able to extract roughly $158k in profit by trading clips of $4-5mm at a time

4/ X did this 5 times (with less impact each time), so let's say they extracted ~$500-700k profit. Ofc X was paying spread to market-makers on the other venues they were trading on to move the price of AVAX, so the net collected is less

5/ this isn't an exploit as much as GMX working as designed! X executed large trades in against GLP holders with 0 slippage: at the oracle price without factoring any price impact

in the real world, putting on risk requires you to pay liquidity providers on the opposite side

6/ why use GMX and not FTX perps? because you can't trade at an oracle price on FTX, you pay some slippage as you execute up the orderbook

you'd move price from $17.95 to $20.25 to buy 200k units of AVAX-PERP. So you'd lose on the FTX leg AND on the other venues you're moving

7/ so the real issue is GMX doesn't reflect the true cost of liquidity like other venues do, it offers unlimited liquidity at a mid-market oracle price

how can GMX fix this?

8/ first, GMX can look at orderbook depth on CEXes, reflect the cost of liquidity in the executable price, and pay any spread collected to GLP holders

this removes the incentive to do this type of exploit, though it runs contrary to GMX's marketing as a zero price impact product

9/ second, GMX can try to identify toxic customer flow and cut it off or widen their spreads specifically -- similar to how forex brokers segment customer flow into a-book vs b-book

10/ third, GMX can cap max position size on any particular asset to a small fraction of liquidity available on CEXes so that any extractable profits are small relative to the cost of moving the asset price on CEX

11/ the last point is important: this problem is one that comes up more and more as GMX grows larger and attracts savvy traders. it's a good problem to have! defi liquidity venues are going to have to converge on cefi best practices over time as market sophistication increases

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling