foobar Profile picture
Jul 7 16 tweets 3 min read Twitter logo Read on Twitter
why vAMMs are doomed to fail 🧵
first, what's a vAMM?

a virtual automated market maker is like a uniswap v2 pool without any actual liquidity. it simulates having liquidity, and moves prices up and down with buys and sells like it was xy=k

but there are no underlying tokens, just math simulations
why is this an attractive product?

because it gets you levered perp-like behavior on arbitrary tokens, like NFTs. this makes bootstrapping markets easier. and users love it, as shown by 500MM of volume on the nftperp beta
so what's the problem?

problem is there's no actual money in the system. so what happens if everybody longs, nobody shorts, and price goes up? who can exit and how?

the easy answer is "funding rates". but who pays the funding rates?
in an orderbook system, longs pay shorts when perp price is above oracle price, and vice versa. this is possible because orderbook matching guarantees an *equal size* of longs and shorts

vAMMs have no such guarantee
in fact, there's almost guaranteed to be an *imbalance* of longs and shorts, because the xy=k model means that price can only move from its starting point when there are more buyers than sellers, or vice versa

and true prices change all the time
so over the long run 1 of 2 conditions must be true:

- longs and shorts are mismatched
- perp price doesn't track oracle price
in practice no platform can be taken seriously if the second condition doesn't hold, so we see the first

note that if BAYC started at 10 ETH then went to 30 ETH, there must be more longs than shorts. this is true even if perp price tracks oracle price, because of xy=k
so longs need to be paid funding. where does the funding come from? it can't come wholly from shorts, because there are more longs than shorts. so the platform must pay out funding rates from its treasury fees. this is true no matter whether we have an excess of longs or shorts
and so vAMMs are this tricky balancing act of hoping that platform fees outpace platform funding rates, forever. this eventually fails.

and what happens when it fails? people try to exit
now remember, there's no actual liquidity in a vAMM. so how can people exit?

the amount of profit they're entitled to is determined by the xy=k curve, and the only actual money in the system comes from other users' collateral
in an orderbook model, one user's profit is another user's loss. so you can credit profits and losses against each other. but this isn't true for vAMMs! it's possible for everybody to be in profit at once, if they all longed the same coin and it went up
so the first people to sell on xy=k dump the perp price below what oracle price is, funding rates spike, platform treasury gets crunched to pay the elevated funding rates, more people exit, more price dislocation, more funding rate payouts, platform goes bankrupt
while obviously this is a juicy target for manipulation, it can also happen from organic price movement. say a vAMM spins up when ETHUSD is $10. then ETHUSD goes to $10k over the course of a decade. the only way xy=k perp price can track spot price is with long-short imbalance
we saw a test run of this in the opposite direction when LUNA went to 0 last year. as people rushed to arb perp vs spot on vAMMs like Drift v1, there was massive short-long imbalance. funding rates went crazy, platform couldn't pay ot users, race to get out, everything collapsed
TLDR - you can't internalize potentially toxic orderflow on arbitrary perps, especially low-float assets that can be cornered through either individual or emergent activity. the vAMM failure case is a specific instantiation in a larger hopeless design space

• • •

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

Keep Current with foobar

foobar 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 @0xfoobar

May 16
Ledger can’t even keep its own story straight
This was always obvious, btw. If they can recover your seed phrase for you when you lose your ledger, then they can recover your seed phrase when compelled by a government, when an insider gets bribed, when the database gets hacked, etc. TEEs get broken all the time
Their “privacy” policy is absolutely ridiculous. Zero chance they won’t roll over and leak your private keys to the nearest government at first signs of trouble Image
Read 4 tweets
May 16
Stop using Ledger hardware wallets. Migrate away from them immediately. They’ve shown nothing but gross incompetence and wild misunderstanding of their own purpose. And now they’ve publicly admitted to intentionally backdooring their own proprietary hardware. Stop using Ledger Image
“it’s opt-in, you don’t have to use it”

this is misdirection. a hardware wallet should have a secure enclave where the private key never leaves the device, under any circumstances

they’ve opened APIs for the enclave to send encrypted key shards to 3rd parties on the Internet
Reminder:

- Ledger previously had a data breach leaked a list of customer names and addresses
- Ledger is encouraging customers to wear hardware wallets as public jewelry
- Ledger can always leak private keys from the enclave with further firmware updates
Read 6 tweets
May 8
🥖 HOW TO AVOID GETTING SANDWICHED 🥖

1) go to docs.flashbots.net/flashbots-prot…
2) click green button
3) approve rpc
4) switch rpc

done, now you can go crazy with shitcoin slippage and the MEV bots won't get you

how and why does this work? 🧵 ImageImageImageImage
sandwich bots are only able to attack you because they see your buy order hanging around in the mempool before it gets included in a block

so you need to submit it to a private mempool instead of a public mempool

flashbots runs the largest private mempool, that's who to use
how do you choose which mempool to submit to? with your "RPC", which is the dropdown menu at the top of metam*sk

most aren't familiar with this, because metam*sk gives you a default RPC that routes transactions to the public mempool
Read 4 tweets
May 6
mainnet assets deliberately induce scarcity
testnets deliberately emulate mainnets
therefore testnet assets are scarce

cannot just "make a new one" to solve the scarcity problem, you must choose to explicitly drop one of the above two assumptions
we're not hardforking mainnet to make testing easier, so it's clear that testnets must relax their emulation assumptions to support widespread permissionless distribution

this can be done via ephemerality (rapid setup/teardown) or changing supply mechanics (infinite mint)
actually changing supply mechanics wouldn't help. if everybody could mint 1 gETH every minute, gas wouldn't be 1000 gwei, it would be 1000000 gwei. endless bot race

so ephemerality it is. the solution to overspeculation is increasing supply (of testnets). same as L1s/NFTs/memes
Read 5 tweets
May 5
ultrasound money gas fees vs solana scaling

ansem's object-level description is unequivocally correct. ethereum is unusable if you have less than 10k. i'd take it further, even six-figure portfolios can't interact on a daily basis

Image
the ethereum plan is data availability (DA) scaling. a primitive form is live today, optimism + arbitrum + zksync + starknet all push data to the L1, with various forms of intermediate multisig protection that hopefully gets removed in time. arbitrum spent $2.3 million this week Image
the solana plan is raw throughput scaling, they've made incredible technical strides on state hotspot isolation, parallel processing, NFT compression, building out the firedancer client. this is logically simple but technically complex
Read 9 tweets
Apr 22
Blur accelerated the NFT market, but did not fundamentally change it

How did it accelerate NFTs? By dropping trading fees (which increases organic liquidity) and incentivizing trading volume (which increases organic & inorganic liquidity)

Both are inevitable in mature markets…
So this is not Blur changing anything about how NFTs operate. It is simply what happens as competition increases in new sectors

The immediate effect of lower trading fees was tighter bid-ask spreads. This benefits retail, who can both enter and exit at more attractive prices
The immediate effect of incentivized activity was a spurt of inorganic bids from actors like franklin and machi. Smart whales like mando/osf & many others who wisely avoid twitter nonsense sold their longterm spot NFT holdings into these overpriced bids. Spot holders profited
Read 12 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 on Twitter!

:(