Daniel Von Fange Profile picture
Jun 6 28 tweets 3 min read Read on X
Things I tell people about AMMs:

(running list)
1. You can get all the volume you want out of an AMM if your prices are wrong.
2. You can get all the volume in the world if you incentivize anyone more per swap than the swap fees.
3. If you are a little unprofitable due to impermanent loss on a xy=k AMM and very unprofitable trying to LP on a concentrated liquidity AMM, you are going to lose your shirt on a leveraged concentrated liquidity AMM.
4. Impermanent loss is probably real loss.
5. If you are fixing impermanent loss by changing your design to create permeant loss every time the price moves, it's probably worse.
6. LP money wants to be passive.
7. LP money wants to be an ERC20
8. If you make a new AMM design that's uniswapV2, but better in one way, it's probably going to be worse than uniswapV2.
9. Static trading fees are obviously, spectacularly wrong.
10. AMM's that price based only information they know from trades with them are like someone competing in NASCAR blindfolded.

It can be done. Just put your foot down and scrape the wall all the way around track. But if there's ever a seeing guy in the race, it's over.
11. Dynamic fees that only track volatility/off twapness are great, but only halfway there.
12. The APY shown in an AMM UI is only the income side. The loss side is prices changing. The losses aren't shown in UIs.
13. 90% of LP's are net unprofitable.*

*My guess. Excepting stable pairs and incentives.
14. UniswapV2 is better than you think.
15. UniswapV2 is not great about concentrating liquidity, but it's better than you think.

(see 14)
16. All pools in a given pair are PVP with each other.
17. All DEXs on a chain are in a PVP match with each other.
18. AMM's have tremendous winner takes all effects.

More money makes for better trades, more good trades make for dramatically better profitably potential and profits brings more money.
19. The advent of good aggregators is good for new entrants because they can drive quite a bit of trades.

New ones don't have to get both users and LP's simultaneously.
20. Notwithstanding #19, having traders using your UI is a massive advantage, because they are trades that your PVP competition is never going to get.
21. I never want to write bin based concentrated liquidity code.

God bless everyone who has.
22. I hate oracles.

Not really relevant, but just throwing this in there.

Because I hate oracles.
23. In the formula `profit = revenue - losses`, a small percent reduction in losses or a small percent increase in revenue can have a huge impact on profit.
24. To a first approximation, LP profitabitly is

(fee x volume) - (assets exposed * asset price changes)
25. Orderbook based market making is the pinnacle of hundreds of years of evolution in traditional finance. The most efficient way humans have ever found to do this.

But every time it's been tried onchain, it's failed. Pls don't build another one until you know why.
26. For everyone concentrating liquidity around the 1:1 between an asset and it's more risky derivative asset that also has a time delay to redeem: Image
27. If your AMM competitors for a pair are boneheadedly losing money, there may be no possible way to be profitable, since to compete for trades you would have to lose more money than they do.

• • •

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

Keep Current with Daniel Von Fange

Daniel Von Fange 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 @danielvf

Feb 27
I have had enough.

It is possible - barely - to securely do onchain multisig stuff. Most have no idea how much work.

The problem is the tools. The only way to be secure is to wire together many different tools, use them painfully, and never make a mistake.

Rethink time🧵 Image
Our current tools worship flexibility, extendability, composability, and minimal gas use.

It's time to focus on action visibility at all layers, making mistakes and attacks recoverable, and out of the box easy security.
Gnosis safe has been a good tool. They clearly care about their contracts. But there are major problems.
Read 14 tweets
Oct 31, 2024
A sneaky scam coin has been yoinking its tokens right out of people's wallets, while simultaneously avoiding detection by scam coin detection services.

Let's break down how it cloaks its shenanigans. 1/8 Image
Thanks to yourfriend for noticing this! 2/8
First, if we look at the contract source, we see this innocuous looking launch code.

But it then calls something with danger written all over it. But what does this assembly actually do? Image
Read 8 tweets
Oct 17, 2024
Yesterday's sophisticated 50 million Radiant Capital hack happened after attacker's trojaned the computers of multiple team members.

Team members saw and verified good multisig data on screens, but their hardware wallets signed evil data. 1/7 Image
The hardware wallets actually signed `transferOwnership()`, giving control of the lending pool to the attackers.

The attackers then integrated these signatures into their attack, so that the transfer of ownership, contract upgrades, and initial theft all occurred atomically. 2/7
The new code that the attackers deployed is transferFrom stealing assets from users that have approvals to the lending pool contract.

They still continue to steal funds whenever any vulnerable user transfers funds in to their wallet. Please revoke approvals. 3/7
Read 7 tweets
Jun 20, 2024
Here's how CertiK's 3 million dollar hack on Kracken worked.

The core trick is that the overall blockchain transaction must succeed in order for the reverted deposit to count. So the attacker raw external called their own contract and ignored their own later revert. 1/n Image
At this point we had a transaction trace with a transaction to the deposit contract, that was inside a successful transaction. And that's what Kracken was looking for.

2/n
Later the attackers bolted on some random flash loan code they found laying around into a separate contract.

This flash loan contract then called the original attack contract with lots of money, and ignored the flash loan revert when the loan was not paid back.

3/n Image
Read 4 tweets
Jun 11, 2024
Yesterday's uwulend 19 million dollar hack involved such a complex attack, combined with such a pile of contract stupidity, that I've not seen a writeup yet that completely explains the attack.

🧵 1/n Image
The price oracle used took 11 different prices, and used the median price as the price oracle. However, 5 of these prices were spot prices and directly under the control of the attacker.

This meant that only one EMA price needed to be manipulated. 2/n
And there was a gloriously manipulatable curve price_oracle used. And it was off price during the attack.

3/n Image
Read 12 tweets
Feb 6, 2024
Live tweeting designing a better exchange rate function for vaults.

I want one that changes per block, stops inflation attacks, is gas cheap, spreads out bursts of yield, can be updated in the middle, is self contained, and never overshoots. 🧵 Image
This same design should work for both exchange rate tokens with fixed amounts and for rebasing tokens with changing total supply.

Rebasing tokens really just hide fixed credits and a changing exchange rates inside them, so the same base code should work for both. 2/n
3/ One big design consideration for vaults I work with is that it is very expensive to check the number of assets.

It costs to look up a half dozen coins, each of which could be is squirreled away in a half dozen different protocols, and those protocols have to do work too. 3/n
Read 26 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!

:(