Solana MEV Triple(!) Dex Arb 💵
This bot closed an arb across three different Solana DEXs (Mercurial, Orca, Serum) in a single transaction for a grand total of...
2.6 cents ‼️
What's going on here? 🧵⬇️
Why is Hackernews so anti-crypto?
I understand that the audience skews a bit older than e.g. crypto twitter, but it's still surprising to me.
I hope I never become as intensely default-skeptical of new technologies.
@venturetwins
there's another separate, but compounding effect: with social media, people now mostly socialize with similar to themselves. this accelerates the divide even further.
Solana's Security +
@CashioApp
/
@wormholecrypto
Hacks
Maybe controversial, but I think Solana actually has the potential to be one of the most secure blockchains.
This might seem a bit absurd to say given the recent hacks, but let me explain my thoughts below.
🧵🔽
The
@CashioApp
hacker just announced that they will accept refund submissions
I've created an open-source website for victims of the hack to make generating and saving message signatures as easy as possible.
Site -
Solana's on-chain timestamp has been desynced, it's currently 30 minutes (!!) behind.
Time manipulation is concerning because a huge amount of MEV can be extracted by validators by exploiting this (NFT mints, IDOs, etc.)
Wormhole Hack Thread 🧵 Additional Details + Prevention
Others have already described how it happened, going to talk about how it could have been prevented and note additional details that haven't been covered.
Solana MEV bots literally spamming hundreds of failing arb txs...
This bot literally hasn't landed a successful arb in the last hour (probably like 0.1% success rate)
Solana fee market discussions are starting to materialize by
@aeyakovenko
@buffalu__
Interesting note: Because Solana locks per account (as opposed to globally, like the EVM), there will likely be "micro fee markets" per account rather than a global one.
The real bull case for Defi apps becoming their own interoperable app-specific L1s is to capture the value created by protocol MEV.
Few understand this.
We've seen Solana AMMs compete themselves down to almost 0 fees at this point.
At first, 25-30bps fees. Then 4-5bps. Now 0.8bps. Yes, this is for volatile pairs like SOL/USDC!
Where do we go from here?
I think DYDX's choice to build an appchain (vs Eth L2) comes down to tooling.
There are no tools to make custom Ethereum L2s.
There ARE tools to make custom appchain L1s.
I don't think ideological differences between alt L1s and eth L2s are the main concern.
This is a phenomenal introduction to zero-knowledge proofs by Justin Thaler.
I've been reading through it recently and it scratches the itch I've always had of "okay I understand what ZKPs are capable of, but how do they actually work?"
Also worth noting, if the Wormhole devs had used
@anchorlang
, this exploit would not be possible, as address verification (as well as many, many other checks) are built-in seamlessly into the framework. s/o to Anchor devs! ❤️
The MEV Endgame
What happens when top MEV searchers start acquiring wallets for exclusive access to orderflow?
Then issue a staking derivative that delegates to their own node, which offers higher APY than rest of market
Then acquire more wallets, etc
@sxysun1
@bertcmiller
Flashbots Research 🧪 - Speeding up the EVM by
@sxysun1
I wanted to bring attention to this piece by
@sxysun1
. I had the pleasure to chat with him about some of his ideas and I think they're fascinating.
Basic Explanation 🗒️ + My Thoughts 💡
Thread 🧵
The recent Y Combinator fud has made me realize something:
In web2, you win if you build the strongest walled garden
In web3, you win if you build the most composable ecosystem
Mempools are entirely a "userspace" construct, right?
It seems like it's possible for:
- Alternate mempools to exist for Ethereum
- Anyone to create a mempool on top of Solana
etc.
Is that correct?
+1
Video games are essentially simulations for time-sensitive, strategic decision-making in a high-pressure environment.
It's hard to get extensive practice in these kinds of situations anywhere else in life outside of a few exceptions (e.g. high-frequency trading).
Woah,
@ameliatastic
's code for Seahorse is absolutely insane under the hood.
In the transformation step, it constructs a completely valid Rust program from the python/seahorse AST... wtf.
One of the most impressive Rust projects I've ever seen
Typescript's developer experience is mind blowing these days.
We're quickly approaching the point where it should be considered a top choice for everything other than performance-critical code.
4/ Soon,
@anchorlang
developers will be able to use the one-line lumina() utility to debug tests.
- simple setup, just npm install and add lumina() to test
- spins up a local Lumina instance for localnet
- displays live transaction feed as your test runs
Also, many of its transactions fail!
I assume this is due to competition from other bots
This is likely a calculated tradeoff given Solana's low gas fees; even if the bot only lands a small % of its transactions, the profits from those arbs cover the gas of its failed attempts
Solana dev alpha leak:
contracts can often be optimized using "account clustering" techniques.
example:
before: 1 oracle PDA per mint, derived using mint key
after: 1 oracle PDA per N mints, derived using an incrementing index
One major difference between Solana and Ethereum MEV is the surface area of potential opportunities.
On Solana, there are only a few protocols which leads to everyone fighting over the same few opportunities.
@_Dave__White_
You can transform this into Cauchy's Functional Equation with g(x) = ln(f(e^x)). It's pretty well known (at least in competition math circles, heh)
5/ The entire contract is a single 73-line python file, enabled by Seahorse's brevity.
I had to make a few changes to the language like adding zero_copy, etc. to optimize as much as possible.
Here's the model code
Flashloans are currently implemented on Solana via CPI, but what if "flash borrow" and "flash repay" were separate instructions?
This would basically enable you to execute arbitrary instructions (include others' instructions!) between the borrow and repay parts of a flashloan 🤯
People often underrate how essential beautiful + intuitive UX is for user-facing product success.
This is the biggest untapped edge IMO in building a product in some verticals.
first they put React in websites -- I did not speak out
the they put React in mobile apps -- I did not speak out
then they put React in emails -- I did not speak out
now they put React in OBS Scene Layers
I must finally take my stand
Some less-talked-about points in the CLOB vs AMM debate
1. Spill. When you try to swap coin X to coin Y on a CLOB, you're often left with a tiny bit of coin X ("spill") due to min quantity sizes.
Would love to chat with anyone working on ways to get more accurate historical analyses of Solana accounts!
There is analysis to be done on more than just spot arb bots -- there are NFT drop bots, perps arb bots, market making bots, liquidity mining bots, and more ⚡️
At
@Airbnb
, while we appreciated the flexibility of Ruby on Rails earlier on, it absolutely became unsuitable at scale (both traffic and organizationally) and we had to work miracles while replacing much of it with java microservices.
6. Where to go from here?
It would be cool to see on-chain AI used for things like generating game levels for crypto games.
There's also a ton of room to improve accuracy -- Sea-NN is far from perfect.
2/ How did Sea-NN come to be?
I was tinkering with
@seahorse_lang
today and had a profound realization: Python is used for ML; naturally, Seahorse should be used for on-chain ML! 🤯
Knowing this would be the Next Big Thing (tm), I quickly got to work, and thus Sea-NN was born.
That's all for now!
It will be exciting to see how the on-chain battleground 💣 of Solana MEV evolves over 2022 as pivotal technologies such as
@jito_labs
come online as well as Solana fee markets are introduced
I think Solana is interesting for MEV searchers right now because it's mostly a latency auction (as opposed to a gas auction).
This means searchers keep *all* of the profits, which are quite substantial (~$45M in first half of 2022)
highlights:
~ $45M in profits extracted from arbitrages and liquidations in 2022
- as much as 25% of blockspace on Solana has been spent on MEV
- the median arb profit is 1 cent (!!!)
- the median liquidation profit is $2.85
Competition between StarkWare vs zkSync
Much of the narrative suggests that StarkWare and zkSync are fierce competitors due being in the zk rollup space together.
I actually think that this is completely the wrong way to think about it.
Some thoughts below ⬇️
from what i can tell, ftx/alameda seems to be pretty good at promoting people internally vs hiring outside executives to run major parts of their business
coinbase seems to be the opposite, the whole c-suite are executives hired from other big tech companies
@kepano
@ycombinator
The 3% would of course be extremely valuable retroactively, but the problem is the second order effects.
All of a sudden the approximate payoff of YC is much easier to calculate (though of course still with wide error bars).
This leads to more total comp chasers entering YC and
@thecollegehill
@random_walker
It's not a security issue. It's always possible to turn a website into an "API" via reverse engineering.
You could imagine creating a script that sends requests to the internal ChatGPT API in exactly the same way that the ChatGPT website does.
In this case, there is nothing
1/ I've been writing a lot of Typescript recently and realized something.
Typescript is approachable to so many developers because it achieves an elegant balance between two styles of programming: data-first and procedure-first.
Solana Fee Markets and NFT Mints
Localized fee markets on Solana will be a forcing function for top Solana NFT protocols to optimize the mechanisms and parallelism of their contracts.
Some explorations on how this might go...
Prediction:
The big Solana derivatives trading accounts will shift towards having multiple wallets + off-chain collateral management system
This enables them to optimize for parallel execution on cross margin systems such as
@01_exchange
and
@mangomarkets
What's interesting about
@seahorse_lang
is that, while its syntax is Python, it obeys Rust's statically-typed semantics: it'll tell you at compile time if the wrong type is used somewhere, etc
Pretty fascinating that can it can basically deliver the same level of safety as Rust.
How were all of these arbitrages done?
They all happened right after the Wormhole hack when the attack dumped all of its ETH on the causing huge imbalances in the markets across all of Solana
@usrbinishan
@emile_amajar
You can't use shannon entropy like that here.
Consider, shannon entropy would imply pi is not compressible. And yet, you could easily write a program that generates digits of pi conforming to all of the same rules used in this competition.
Overall, I wouldn't be too harsh on the Wormhole team here. Ultimately they made everyone whole and paid quite a hefty price to do so.
These things are always hard.
@0xngmi
ETH gas fees were making it unusable for most retail, and BSC was the first alt L1 with:
- low fees
- usable bridge
- good dev tooling (EVM)
Avalanche didn't have a decent bridge yet, Solana didn't have good tooling, etc.
The hacker didn't want to dump its ETH for USDC (to avoid Circle freezing their funds), so instead they used the ETH/SOL markets to dump it into SOL, making for some huge arb opportunities between SOL markets on other DEXs.
A common failure path I see in some devtools, especially 'No Code' solutions:
They make the easy things easier but the hard things exponentially harder.
Sure, I could use a tool to avoid having to write 10 lines of code... but that wasn't the hard part.
Background 📚
Solana transactions are composed of instructions, each of which is a separate contract invocation.
In some sense, Solana transactions are like Ethereum transaction bundles and Solana instructions are like Ethereum transactions.