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:
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
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
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
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
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
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.
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
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.
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. 🧵
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