登録して招待リンクを共有すると、動画再生報酬と紹介報酬を獲得できます。

Francesco Andreoli ᵍᵐ
@francescoswiss
🇨🇭 Not Forbes 30 Under 30. Head of Developer Relations at @MetaMask. Founding Venture Partner at @OuiCapital 🌍 Prev @digitalasset @angelHack
参加 November 2015
6.9K フォロー中    30.7K ファン
i am always interested to understand how actually a DEX routing actually works (and why 1 in 4 big swaps gets a worse price than it could have) > price isn't a number, it's the slope of that curve where you are > a big trade slides down the curve, so every extra token costs more > that's why one big swap in one pool is almost never optimal > an AMM pool is just a curve: x * y = k > the fix: split across pools until the last token costs the same everywhere > add multi-hop paths (USDC→DAI→ETH) and it becomes a graph problem > routers solve that graph off a snapshot of reserves from block N > your tx lands at index i of block N+k, and every tx before it moved the curves > so the "optimal" split was optimal for a state that no longer exists > minOut caps the downside, it doesn't make the stale route optimal again > the fix is to re-route inside the block, at the exact index your tx lands, on the state it actually settles against and ETH Zurich (where i studied) measured it: 27% of 108,667 swaps over $30K had a better path S/O to @PropellerSwap on implementing this with Fynd InBlock this S/O @InnitGoldie for sharing this with me
もっと見る
Some time ago, I came across research from ETH Zürich showing that 27% of 108,667 large Ethereum swaps were executed at suboptimal prices. Researchers analyzed swaps over $30K and found that better routing could have saved nearly 30,000 trades at least $30. Here are 5 things I learned ↓ 1️⃣ A direct swap doesn't always give you the most tokens Let's say you're swapping $ETH for $USDC. You have several options: • Swap directly through an ETH/USDC pool • Route through ETH → USDT → USDC • Split your order across several liquidity pools Each option has different liquidity, price impact, and gas costs. The ETH Zürich study found that optimizable trades could have received an average of 0.15% more through better routing. For a $100,000 swap, that's an extra $150. This is exactly why DEX routers exist. Fynd, for example, is the router @PropellerSwap built to find the best swap routes across liquidity pools. But finding the best route is only half the problem. 2️⃣ Your swap route can become outdated before it executes Here's something most DeFi users don't realize. When you request a swap, the router calculates a route based on current liquidity and prices. You approve the tx, sign it, and wait for it to execute onchain. That process can take a fraction of a second or stretch into tens of seconds. During that time: • Another trader can move prices in your chosen pool • Liquidity providers can withdraw funds • Arbitrageurs can eliminate price differences • Market makers can update their quotes So the route that looked optimal when you signed might be significantly worse when your transaction actually executes. A perfectly calculated quote can become outdated within milliseconds. 3️⃣ Integrated route optimization This was the most interesting part of my research. Most traditional routers calculate execution paths before transactions are submitted, and some prepare alternative routes or fallback options in case conditions change. These approaches still have limitations, and newer alternatives are emerging: Fynd InBlock is one of them. Instead of relying on routes calculated beforehand, it lets block builders run an entirely new route search immediately before the tx executes. • You submit a swap with an initial route • The block builder processes preceding transactions • Fynd, running inside the block builder, searches for a better route using the updated pool states • If a better route exists, it can replace the original It's essentially performing a fresh search based on the liquidity available at your exact position inside the block. 4️⃣ What if there's no optimal route? Imagine swapping $50,000 in $ETH for $USDC. Your original route uses Pool A, but another trader moves its price before your transaction executes. Pool B now offers a better deal. Instead of sticking with the outdated route, Fynd InBlock can discover Pool B and switch before execution. If no better route exists, your trade uses the original route, subject to the same minimum output requirement. 5️⃣ Beyond DEX aggregators Better execution benefits the entire trading infrastructure: • Wallets can offer more reliable swaps • Trading terminals can reduce failed transactions and slippage • Aggregators can compete on actual execution quality • Block builders can earn revenue from improving routes The ETH Zürich research showed how much value inefficient routing leaves on the table. My prediction is that the next moat in DEX execution isn't finding the best route faster, but rather finding the best route at the exact moment your trade executes. If you want to read more about how Fynd InBlock works, start here:
もっと見る