
Building a router, Part III
We took past trades and replayed them through our router against the same onchain state they originally executed in. Compared that to what users actually got
In this trade, better routing would have returned ~1,000 bps more, worth ~$600 to the user.
As more trading moves onchain (incl tokenized securities), evals for execution quality become more important than ever: "what did I receive" vs "what could I have received"
More on this in our talk at Scale or Die at BP2026
Spent a bit of time this morning looking into this
Based on this initial examination, I believe at least 1 relay solver may be leaking private intent data to sandwichers
Looking at the RH sandwich attacks conducted by these bots(*), every single sandwich contained at least 1 victim from Relay
One interesting thing to note about this is that often the swaps have multiple pools they can route through and Relay solvers do a primitive (**) form of onchain routing where they swap multiple candidate routes, reverting each one, and then selecting the best one to run. So that means the attackers have to perturb the pool just enough that they can profit but not so much that the solver routes through another pool
(*) Subset of bots where 100% of sandwiches have >=1 Relay victim (search period: last 6 days)
0x44c0ba0b734d4b7705fcd07ddae9fbbc078d74dd
0x38b3f8125bbbd45b56d0c3a535b90181d7dd3880
0x2a23c6d2522f07d230abf9c7a96d703520fd222b
0x18e0efe5be1cbb4e060c26f7f16f276be4dbc38c
0x9d61ad5c82586ae118af38e1cc68c8d1ad50771a
(**) by primitive onchain routing, I don't mean it in a negative way, just that it's the simplest way
Hey @fomo, @seyong and @RelayProtocol, check your team or partners: someone is front-running your users (sandwich attack) on the Robinhood chain, likely using private order info.
Wallet: 0x44c0ba0b734d4b7705fcd07ddae9fbbc078d74dd
Contract (since Sep 24): 0x68a04a63fd1d8eabf167ef48ed0a0ef06c2374d9
Solver affected: 0xccc88a9d1b4ed6b0eaba998850414b24f1c315be
Impact on your users: ~$14k+ in the first day
Sandwich attacks: 328
Typical lead over your solver: 1–4 blocks
Solver volume hit: ~$412k
Building a Router, Part II
Quoting: direct quoting vs. simulations
You can start with sims (ex: LiteSVM) but you'll quickly find it doesn't scale. Native quoting is 200-3000x faster
What goes in to a quote?
quote = f(input, pool state, clock, route, flow)
Input: direction, input amount
Pool state: reserves, ticks/bins, fees, curve params
Clock: slot, timestamp, epoch
Route: router/profile, hop position, route source/destination
Flow: caller, accounts, surrounding instructions, route shape
here's a table comparing direct quoting vs. simulation execution for some propAMMs and a subset of AMMs
u8 retweeted
Some are calling it the Solana Stimulus
Right now, 3.4M SOL is locked up in rent
Up to $307M potentially redeemable* after SIMD-0437-5** activates
* at today's exchange rate
** the reduction is 9% then 27% and ultimately 90% at stage 5
added a stream to see the live effect of 553/spg-003 on current transactions at the terminal 1/2 rate
link: sandwiched.me/resource-fees
Post more data about 553/spg-3 the resource fee inclusion simd.
My two cents. A perfect scheduler with infinite bandwidth and 0 pipeline latency would work with 0 inclusion fee, and if there is no tax leakage priority fee revenue is the same as fee burn. But nothing is perfect.
IMHO, it’s worth experimenting but i dont want to break any existing apps. So it’s probably a good idea to experiment within the same budget as the current signature fee on average, while figuring out how to have the inclusion fee burn target the “good” txs and not the bad ones.
PRAW :)
New Dashboard: Solana PropAMM fills vs. Binance
We compare SOL-USDC fills from 10 PropAMMs against Binance
For each fill, reconstructs the Binance L2 at the estimated execution time using shred timing data and walks the book for the same input size (*)
At least one PropAMM wins 99% of the time vs. Binance even at the VIP9 fee tier
(*) we don't compare to midpoint because you don't trade a midpoint
Dashboard: sandwiched.me/fill-quality/p…
you can click any PropAMM to filter the rest of the charts
Most propAMMs (and AMMs...) use a pool for every asset pair
But Flint, and Aquifer before it, don't use traditional pools which means they can scale cross-asset swaps O(N) rather than O(N*N)
Currently only 3 out of these propAMMs appear to have defense against a cluster restart.
Worth adding if you haven't already!
if your defi application does not have a defense against downtime, it should. LastRestartSlot is a sysvar available to you on Solana (born during the tough times)
humidifi pools are automatically disabled on restart (Fig 1)
borrow/lend venues and perps dexes can disable withdrawals for a short period after a restart
u8 retweeted
Rust source-level debugger for Solana programs
inspect variables, set breakpoints, step into/over functions, etc.
coming soon™️to @blueshift sbpf (which already has an assembly debugger btw)
here's what stepping through a Pinocchio vault program looks like:
So how do Solana propAMMs fare against Binance? Spent some time over the weekend finding out
Turns out: really, really good
Took 24hr of onchain trades and compared vs. Binance VIP 1 and VIP 9
(a) does not naively rely on block timestamp. Uses shred-level timing data and is geo-aware based on leader location
(b) comparison is size-aware and contemporaneous. Walks the L2 book for the same size at the same moment
(c) does not naively compare onchain SOL/USDC against Binance SOL/USDT since USDC is not 1:1 with USDT (results would be clearly bimodal). Adjusts for this
(d) compares executed onchain trades (>1M) not simulations. Accounts for priority and base fees paid
Measured execution quality: did the propAMMs give the trader a good fill relative to executable Binance liquidity at that time?
vs. Binance VIP 1: 10 bps advantage on propAMMs
vs. Binance VIP 9: 2-3 bps advantage on propAMMs
If you know me, you know I'm a huge fan of onchain routing
Love to see this from Titan. Their new router dynamically sources liquidity at execution time
Onchain routing helps Solana go from "average fill can beat Binance VIP9" to "virtually every fill should be competitive with or better than Binance"
in the video:
simulated outputs without API calls (no offchain router component!)
gap bps = how far output is behind best output
interval bps = how far output is behind the one immediately above it
To me it looks unrelated to axios
Notice how these txs are unusual: the multisig signers never used durable nonces except for the 2 exploit txs that approved the new admin
The hacker created new nonce accounts on behalf of the 5 Squads signers days ago
This gave him days to socially engineer the signers and collect their signatures. Since the transactions used durable nonces, they aren't limited to the standard 151 block expiry
Looks like the pool operator pushed an erroneous price (2.65 USDC/WSOL) in all oracle updates that landed in slot 409430505
this unfortunate blunder led to the nika6 arb bot profiting over 2400 SOL across multiple transactions
Goonfi v2's WSOL/USDC pool is drained for about 250k likely due to a misconfig/bug in the program an hour ago. The program is now halted.
solscan.io/tx/5A1YuYHff5RYiZ…


































