0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Setting Slippage Tolerance for Solana Swaps Explained

0
Posted at

Slippage tolerance is the most your swap’s output may fall below its quoted amount before the trade fails. The key is to set it above likely price movement, but not so high that you accept a poor fill.

  • Price impact comes from your trade size and pool depth.
  • Slippage tolerance limits extra loss after the quote.
  • Split a trade only when the improved price is worth another transaction.

What does slippage tolerance control?

It sets a minimum output for your swap. If the pool can no longer deliver that amount when your transaction executes, the swap reverts instead of trading at a worse price.

Price impact is different: it is the price change caused by your own trade. In a simple pool holding $50,000 of each asset, a $500 swap would receive about $495 worth of the other asset before fees. That is roughly 1% below the starting price because the swap changes the pool’s balance.

The pool fee is a separate cost, usually included in the quoted output. Slippage tolerance does not add a fee; it allows the final output to fall below the quote by up to your chosen amount.

How can you set it from a real quote?

Start with the quoted output, then estimate how much it could change before execution. For example, if a swap quotes 10 SOL and you set tolerance to 0.5%, the minimum output is 9.95 SOL.

For repeated trades, compare that minimum with the trade’s expected price impact and the asset’s short-term movement. When using the Byreal liquidity pools for a Solana swap, the same check helps you judge whether available depth fits your trade size. A quote already showing 0.8% impact cannot meet a 0.5% minimum-loss limit, so reduce the trade or accept a wider limit.

A wider tolerance makes execution more likely during fast price changes, but also permits a worse fill. Keep it tight for a deep pool and a calm market; raise it only when the expected move justifies it.

When should you split or skip a trade?

Split a trade when a smaller swap would materially reduce price impact and the saved slippage exceeds the cost of another transaction. For example, if one $2,000 swap moves a thin pool’s price sharply, two smaller swaps may get better average prices—but the first swap changes the pool before the second.

That means splitting is not a guaranteed discount. Check the new quote after the first trade, and account for extra network cost and price movement between transactions.

Skip or wait if the quoted impact already uses most of your acceptable loss, or if the pool’s price changes too quickly for your minimum output to hold. Set tolerance above expected impact plus likely movement, and trade only if the resulting minimum output still suits you.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?