OrnyTools

Your trade has an optimal size.
Most traders never find it.

Too small: gas eats your profit. Too big: slippage does. OrnyTools finds the exact crossover point — calculated from the real constant-product curve.

Calculate now
Trade Size Optimizer

Paste your pool. Get the number.

The size where gas cost equals slippage cost — the bottom of the U-curve. Below it, gas dominates. Above it, slippage takes over. Load a live pool or enter manually.

Try an example:
Pool parameters⛓ on-chain
$
$
Advanced — v3 active liquidity

Constant-product assumes a balanced 50/50 pool, single-hop swap. Switch to v3 to model concentrated liquidity.

Optimal trade size
$2,498
Total cost: 0.50% · $12.4
Gas
$2.50
Slippage
$2.50
≈ balanced — at optimum: gas cost = slippage cost.
Breakdown at optimum
Optimal size
$2,498
Total cost %
0.50%
Gas cost
$2.50
Slippage
$2.50
Pool fee
$7.49
Total cost $
$12.49
This size sits at the bottom of the U: trade smaller and fixed gas dominates; trade larger and slippage on a finite pool takes over.
🦅 Orny Thinking…
Confidence
Cost Efficiency
Expected Slippage
Risk Level
Recommended Size

The U-curve

Below the optimum, fixed gas dominates. Above it, slippage takes over. Hover to read exact values at any size.

Gas Slippage Total
01

Test your trade

Enter your amount. See the real cost — and whether splitting saves more.
I want to swap
$
vs optimal:
Total cost
As % of trade
vs optimal
02

Scenario comparison

Same pool, different sizes. See where gas and slippage cross.
Trade size Gas $ Slippage $ Fee $ Total $ Total % Verdict
03

Methodology

No black box — here's the exact math, and where it stops being reliable.

Gas is a fixed dollar cost — as a share of your trade, it shrinks the bigger you go. Slippage is the price you move against yourself on a finite pool — it grows with size. The optimizer finds where the sum of the two is lowest.

OrnyTools uses the exact constant-product formula (x·y=k) — not the √(2·gas·TVL) shortcut that overstates optimal size by up to 2×. shortcut that overstates optimal size by up to 2×. qui surestime la taille optimale jusqu'à 2×.

// one-sided reserve (balanced pool) R = TVL / 2 (× active fraction for v3) // exact slippage cost — derived from x·y=k slippage($) = A² / (R + A) // full cost as % of trade size cost(%) = gas/A + A/(R+A) + fee // optimum = ternary search min of the U

At the minimum, gas dollars and slippage dollars are approximately equal — that's the equilibrium point.

Where it's only an estimate

  • TVL approximates usable liquidity. Real slippage depends on reserves, trade direction, fee tier and the specific AMM curve.
  • For v3 pools, accuracy depends on active liquidity at the current price. Use the slider or the on-chain reader for better precision.
  • Single-hop only. Aggregators split across pools — which changes the slippage profile entirely.
  • Gas is an estimate. The figure your wallet confirms can differ from any quote.
  • This is execution efficiency analysis — not financial advice.

Risk note

This tool estimates execution efficiency only. It does not account for MEV, sandwich attacks, smart-contract risk, oracle failures, bridge risk, token volatility, or failed transaction costs. It is read-only: it never connects a wallet and never asks you to sign anything. Not financial advice.

Full methodology
Back to all tools
See also: Borrow CompareLP ToolsStablecoin Risk