AMM swap calculator

See what a swap in a constant product (x × y = k) liquidity pool pays out, the price impact, the fee and the pool's new price. Works for any pool where you know the two balances. Free, no sign-up, nothing leaves your browser.

AMM swap calculator

The pool sizes are only an example, not a live pool. This covers simple constant product pools; other designs price swaps differently, and network fees are not included.

You receive (token B)
19,743.2
An average price of 1,974.32 B per A, against 2,000 before the swap: price impact of 1.284% including the fee.
Fee paid (token A)
0.03
Pool price before
2,000
Pool price after
1,960.65

How a constant product pool prices a swap

A simple automated market maker holds two tokens and keeps the product of their balances fixed. If a pool holds x of token A and y of token B, then x × y stays the same after every trade. Swapping in some A leaves the pool with more A and less B, so B gets more expensive for the next trader.

Price impact and fees

The more you swap compared with the pool's size, the further the pool's price moves against you, which is called price impact. It is why large swaps in small pools get a much worse price than the quoted one. On top of that, the pool charges a fee, often 0.3%, which is kept in the pool for the people who supplied the tokens.

Run your own crypto app

SendPay platforms let customers buy, sell and hold crypto, held with regulated partners, alongside GBP, EUR and USD accounts, powered by licensed partners. SendPay doesn't offer trading tools, DeFi or lending.