Swaps

  1. Introduction

Swaps are the most common way to interact with the KoalaSwap protocol. For users, swapping is simple: you select an ERC-20 token you own and a token you’d like to trade it for. When you execute a swap, your tokens are sold for the desired tokens, minus a small fee that goes to liquidity providers. Swapping with KoalaSwap is permissionless, meaning anyone can do it without needing approval.

Note: Using web interfaces to swap via KoalaSwap may introduce additional permissions or differences in behavior compared to interacting directly with the protocol. Learn more in our [Introduction to KoalaSwap guide].

Unlike traditional order book trades, swaps on KoalaSwap don’t rely on a list of buy and sell orders. Instead, they use a pool of liquidity where providers earn fees based on their contribution.

  1. Price Impact

In a traditional market, a large buy order might push the price up by filling multiple sell orders at different prices. With KoalaSwap, price impact works differently. During a swap, the relative price of tokens in the pool shifts as the trade happens, affecting the final price you get.

The amount of liquidity at different price levels affects price impact. More liquidity at a price means lower impact for your swap; less liquidity means higher impact. The KoalaSwap interface shows an estimated price impact in real-time, so you can decide before confirming your swap.

  1. Slippage

Slippage refers to price changes that can happen while your swap is waiting to be processed. On Ethereum, transactions are prioritized based on the gas fee you offer—the higher the fee, the faster the swap. If your transaction takes time, other swaps might change the price environment.

To manage this, you can set a slippage tolerance (e.g., 1%). If the final price stays within this range, your swap goes through. If the price moves outside this range, the swap will fail to protect you from unexpected changes.

  1. Safety Checks

KoalaSwap includes safety features to protect you from major price changes during a swap:

  • Expired: If your swap takes too long (past a set deadline), it will cancel to avoid unfavorable price shifts.

  • Insufficient Output Amount: If the amount of tokens you’d receive is less than expected (within your slippage tolerance), the swap cancels to protect you from sudden price drops.

Last updated