Skip to main content

How Pricing Works

swapapi is free to use. No fees, no subscription, no hidden costs. Here's how.


The surplus model

  1. We quote you a guaranteed minimum output. When you call /v1/swap/{chainId}, the expectedAmountOut is the minimum amount of tokens you will receive.

  2. We route through optimal pools. The API finds the best path across Uniswap V2/V3, SushiSwap, Curve, Balancer, and other DEXs depending on the chain.

  3. If execution beats the quote, we keep the difference. On-chain execution often achieves a slightly better rate than the quoted minimum. That surplus is our revenue.

  4. You never pay a fee. There is no fee line item, no percentage deducted from your output. The expectedAmountOut is what you get, minimum. If market conditions improve between quote and execution, we capture that upside — you still get at least what was promised.


In practice

You request:     Swap 1 ETH → USDC
We quote: expectedAmountOut = 2,435.12 USDC (guaranteed minimum)
On-chain result: 2,437.50 USDC (actual execution)
You receive: 2,435.12 USDC ✓
We keep: 2.38 USDC (surplus)

If execution matches or is worse than the quote, you still receive the guaranteed amount and we make nothing on that trade.


Why this works

  • You get competitive rates because we're incentivized to find the best routes — better routes mean more surplus.
  • No trust required — the expectedAmountOut is enforced by the router contract. The transaction reverts if the minimum isn't met.
  • No surprises — you see the exact minimum output before you submit the transaction.