Execution Cost and Quality: Measure It, Then Cut It

Execution cost is not one number and it does not scale in one direction. Lamport-denominated fees are flat per attempt, so they dominate small orders and vanish on large ones. Price impact is the reverse. Pool fees sit in the middle, scaling with notional and multiplying with every hop. A configuration tuned for one size is usually wrong for another, and knowing which line dominates at your size is most of the work.

This section starts with sizing, because size against pool depth determines the largest variable cost you control. It then covers the risk that a wide tolerance on a thin pool invites, enumerates the full cost stack line by line, and ends with measurement: how to compute realised slippage from your own transactions, how to count attempts rather than only fills, and how to compare two execution paths without the comparison quietly grading itself.

Measurement is last on purpose. Every improvement claim in trade execution is a claim about a distribution, and distributions require a fixed benchmark, a stated denominator and enough paired observations to separate a real effect from an unusually quiet hour. Without that discipline, cost optimisation is just preference with arithmetic attached.

4 pieces in this section

The full cost stack of a swap, the risks that inflate it, and the measurement discipline that tells you whether a change helped.

Sandwich risk on Solana

How the sandwich pattern differs on Solana, what makes an order attractive to it, which mitigations actually reduce exposure, and what residual risk remains.

Read the piece

Execution cost breakdown

Network fee, priority fee, protocol fee, spread, impact and failed attempts, summed in one illustrative example, with the lever that cuts each line.

Read the piece

Where this section sits

Cost work assumes you already have the vocabulary and the routing picture. If a term here is doing more work than you expect, the definitions and the routing mechanics are one click away.

Execution basics

Definitions and mechanics. What a quote is, what moves it, and which parts of the gap between quote and fill you actually control.

Routing

How a router turns one order into several fills, why splitting lowers price impact, and what a longer route costs you in fees and failure risk.