Swapping

Swapping

How a price is formed

Every Sharepool pool is a constant-product market maker. A pool holds reserves of two tokens and keeps their product constant across a trade:

x * y = k

Your trade moves along that curve, so the price you get depends on the size of your trade relative to the pool’s reserves. A trade that is small against the reserves barely moves the price; a large one moves it a lot. That movement is price impact, and it is a property of the pool, not a fee.

Fees

Every swap takes a 0.30% fee on the input amount. The fee stays in the pool, which means it accrues to liquidity providers in proportion to their share.

amountOut = (amountIn × 997 × reserveOut) / (reserveIn × 1000 + amountIn × 997)

Sharepool takes no protocol cut: the factory’s feeTo is unset, so the whole 0.30% goes to LPs. If that ever changes, the factory switch is public on-chain and this page will say so.

Routing

The app quotes every live pool at once and picks the best route, including two-hop routes through an intermediate token when that beats the direct pair. The route is shown before you sign — check it, since a multi-hop route pays the 0.30% fee on each hop.

Slippage and deadline

Between quoting and mining, someone else’s trade can move the pool. Two protections are yours to set:

  • Slippage tolerance — the worst price you will accept. The transaction reverts rather than filling below it.
  • Deadline — after this, the transaction reverts rather than sitting in the mempool and executing at a stale price.

Raising slippage to force a trade through is what lets a trade get sandwiched. If a swap fails repeatedly at a normal tolerance, the pool is usually too shallow for the size — splitting the trade works better than widening the tolerance.

Approvals

ERC-20 tokens require an approval before the router can move them, so a first trade on a token is two transactions: approve, then swap. The native gas token needs no approval.