How Pricing Works
swapapi is free to use. No fees, no subscription, no hidden costs. Here's how.
The surplus model
-
We quote you a guaranteed minimum output. When you call
/v1/swap/{chainId}, theexpectedAmountOutis the minimum amount of tokens you will receive. -
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.
-
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.
-
You never pay a fee. There is no fee line item, no percentage deducted from your output. The
expectedAmountOutis 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
expectedAmountOutis 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.