Skip to main content
Hashbeam

Crypto protocols, markets and policy

896a38

Large token swap: routing versus manual chunks

Split a large token swap into smaller trades or do one? Usually, one routed swap gives the better net fill; split over time only when impact stays high and gas is cheap.

The Hashbeam Desk··5 min read

Large token swap: routing versus manual chunks

Usually, one large token swap gets the better net fill because routing can spread the order across liquidity sources in one transaction. Matcha swap uses the 0x Swap API to find routes, so its quote may already divide your order among pools and other sources. Manual chunks make sense when routed price impact remains high and there is time for liquidity to rebalance between trades.

What changes when you split the order?

A large swap moves the price more when its size is large relative to the liquidity it trades against. In a constant-product pool such as Uniswap v2, the reserve balances must continue to satisfy x × y = k, so exchanging a substantial amount shifts the reserve ratio and worsens the price as the trade proceeds. Splitting the order can reduce the impact of each individual execution, but it does not automatically improve the total fill.

With back-to-back chunks against the same pools, the first trade changes the reserves the next trade encounters. Without a change in liquidity or market price between executions, the chunks generally reproduce much of the same cumulative price movement as one order. Each chunk is a separate transaction, so each also adds a gas cost. That makes immediate manual splitting a poor default: it can preserve the price impact while increasing transaction costs.

A routed swap addresses a different part of the problem. The 0x Swap API can split one order across several liquidity sources in a single transaction, seeking a better combined return than trading the whole size against one pool. That means a single swap can reduce the load on any one pool without requiring the trader to submit several transactions.

When should you choose one routed swap?

Choose one routed swap when the quoted price impact is already small enough for your execution target. You pay for one transaction and assess one slippage limit at execution, while routing can draw on multiple sources. For a deep market or a modest order relative to available liquidity, splitting manually adds little potential benefit.

Read the quote’s price impact before deciding. Price impact estimates how much the order itself moves the execution price; it is distinct from price drift, which can happen while you wait for a later transaction to execute. If the routed quote shows low impact, waiting between chunks exposes the order to changing market prices without a clear impact reduction to offset that risk.

The route also matters. A quote may combine pools with different depth, fees, and execution conditions. Compare the expected output after costs, not just the impact number in isolation: a lower impact route can still have other costs, and another quote may offer a better net result. The choice is whether the remaining impact is large enough to justify extra transactions and time in the market.

When are spaced chunks worth it?

Choose spaced chunks when impact remains high after routing, per-transaction gas is cheap, and the pools are thin enough that smaller executions could improve the fill. The time gap is the key condition. Between chunks, arbitrageurs may trade against a pool whose price has moved away from the broader market, replenishing its reserves and bringing its price closer to market levels. The next chunk can then face less impact than it would have in an immediate sequence.

That reset is conditional, not automatic. It depends on other traders acting and on liquidity being available at the resulting price. While you wait, the broader market can also move against your order. Each transaction creates another execution window, with its own exposure to price movement and MEV. If prices drift or the pool does not rebalance, later chunks may fill worse than the original quote.

For a large order that should execute gradually without requiring manual timing, a scheduled TWAP order is another option. CoW Swap’s TWAP feature divides an order into smaller parts for execution at intervals over a specified period. It can help structure time-based execution, but the same trade-offs remain: execution price can drift, and costs and exposure accrue across the separate executions.

How do the three options compare?

Choose based on the routed impact, gas per transaction, expected price drift, and how much execution exposure you accept per trade:

  • One aggregated swap: best when routing reduces impact to an acceptable level. It spreads volume across sources in one transaction, with one transaction’s gas cost.
  • Manual chunks spaced over time: consider when impact stays high, gas is cheap, and allowing pools to rebalance could improve later fills. You take on price drift and repeated MEV exposure.
  • Scheduled TWAP order: consider when gradual execution is the goal and the available TWAP terms fit the order. It schedules chunks over time rather than requiring each trade to be timed manually.

In practice, choose one swap when the routed quote’s impact is already small or gas makes extra transactions expensive. Choose spaced chunks or a TWAP when impact remains high after routing and cheap execution gives the market time to replenish thin pools. The next sensible move is to compare the routed quote’s expected output and impact with the likely cost of extra transactions; that tells you whether splitting has room to improve the net fill.