Joshua Lim Profile picture
Sep 18, 2022 11 tweets 3 min read Read on X
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

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Joshua Lim

Joshua Lim Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @joshua_j_lim

Nov 28, 2023
1/ the CME futures roll traded at dizzying, near-historic wides during last week’s Nov to Dec roll window, touching 23%+ annualized at times, making it briefly one of the most attractive risk-adjusted trades in crypto Image
2/ we know tradfi guys / macro tourists are already long crypto ahead of ETF news, they’ve built the position over the last few months and are now paying handsomely to roll it

commitment of traders data showing asset managers increased length by about $1bn since end of Sep Image
3/ $BITO, the rolling CME futures ETF showed an increase of $560mm in AUM since end of Sep, of which around $230mm came from inflows and the rest from spot appreciation (shares out went from 64mm to 77mm) Image
Read 9 tweets
Mar 31, 2023
1/ today's massive BTC options print on CME demonstrates a larger trend happening in crypto options
2/ at 11:11 AM ET, customer bought 600x of the May 32k / 38k call spread, each contract has a 5 BTC multiplier, so the notional of this trade is $82mm. customer paid $1085 per unit = $3.26mm in premium for a max payout of $18mm at maturity
3/ but if we dig a little deeper, we see another print happened on Deribit at 11:22 AM ET for the same size and this one was a seller of the call spread at ~$940 per unit
Read 8 tweets
Oct 12, 2022
1/ this is how I think the mango attack played out, please let me know if I got anything wrong:

at 6:19 PM ET, attacker funded acct A (CQvKS...) with 5mm USDC collateral

trade.mango.markets/account?pubkey…
2/ attacker then offered out 483mm units of MNGO perps on the order book
3/ at 6:24 PM ET, attacker funded acct B (4ND8F...) with 5mm USDC collateral to buy those 483mm units of MNGO perps, at a price of $0.0382 per unit

trade.mango.markets/account?pubkey…
Read 8 tweets
Aug 29, 2022
1/ BTC has lagged the performance of other crypto assets through the last cycle

most traders intuitively feel that BTC trades “heavy” – why is this happening?

there’s two simple metrics we can look at to validate what we intuitively feel:
2/ first metric is the ETH/BTC ratio, ETH price divided by BTC price, which is 0.0733. this is still near multi-year highs of 0.0880 which we touched prior to the Fed-induced meltdown in risk assets in Dec 2021
3/ the “flippening” when ETH mkt cap = BTC mkt cap occurs at ETH/BTC ratio of 0.0159. sizable positioning in ETH calls reflects mkt consensus of continued ETH outperformance

charts below show ETH put/call ratio is only 0.24, substantially lower than BTC’s at 0.53
Read 13 tweets
May 13, 2022
1/ what's next for crypto mkts: contagion risk edition

today’s relief rally across risk assets saw equities regain the 4k level in S&P 500

VIX is showing a risk barometer reading of 29, down as much as 6 points from last wk, when SPX was 3% higher!
2/ we're seeing a somewhat orderly equity de-risking last 2 weeks and plenty of cash on sidelines waiting for liquidation to abate

crypto of course saw a lot more chaos with structural issues in the market and fear of contagion
3/ billions of USD of wealth were wiped out. peg assumptions of all varieties, from USDT/USD to stETH/ETH, were in play
Read 10 tweets
Feb 23, 2022
1/ random thoughts on mkts here:

liquid crypto mkts have been more difficult to navigate since Dec. allocators are reluctant to aggressively deploy risk into crypto with FOMC and Russia/Ukraine headlines driving macro assets across the board. BTC is moving on a 2ish beta to SPX Image
2/ BTC vs equities correlation is realizing 60-70 to start 2022. this is up from 10-40 corr through most of 2021 Image
3/ there’s a slow-mo reshuffle going on on the buy side as portfolio managers get paid out for killer 2021 performances and depart into new seats… short-term, means less focus on actively deploying capital
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(