Guide: Specifying Minimums
Guarantee every trade results in an expected minimum amount of tokens back.
Last updated
Was this helpful?
Guarantee every trade results in an expected minimum amount of tokens back.
When making a trade with Pool Addresses you may specify a minimum number of tokens to receive in return for your trade. If the minimum cannot be met, the tokens you attempt to trade will be returned.
Generate a fresh quote for a trade using the interface at tradecraft.fi.
Copy the number of tokens quoted for the trade and multiply it by a factor of your choosing to account for slippage. For example, multiply by 0.97 to account for 3% slippage. That will be the minimum number of tokens you expect back.
When preparing the transfer of tokens to the Tradecraft Pool Address, enter the minimum number in the memo field. Then send the transfer.
Your trade will either execute and you'll receive at least the minimum number of tokens — or more if the current price allows — or it will fail because the order cannot be completed at that price, and your tokens will be returned.
Using the interface at tradecraft.fi, see what the current expected return amount is for your desired trade:

Slippage is a term used to describe what can happen between the time you generate a quote and the time your order gets processed on-chain. In that time orders from other traders can be executed, affecting the balance of tokens in the pool and moving the price. Accounting for slippage reduces the chance of your trade being rejected due to price drift.
Commonly used slippage tolerances range from 5% to 0.25% depending on the TVL of the pool. Token balance (and therefore token price) in pools with smaller TVL is affected more by a trade than it is in pools with large TVL.
The formula to calculate the minimum is:
quote x (1 - slippage/100) = minimum
For this example, we'll use 3% slippage tolerance:
14.2742668747 x (1 - 3/100) = minimum
Simplified, this equation is:
14.2742668747 x 0.97 = 13.8460388685
For a minimum to be honored it must be the first text in the memo field, and have no more than 10 decimal places.
Minimums may be specified as whole numbers, or decimal numbers.
You may put additional notes in the memo field after the minimum, separated by a space. For example, 5.25 my extra notes is a valid memo.
Last updated
Was this helpful?
Was this helpful?
