Scenario:
Token A decimals: 6
Token B decimals: 0
Exchange Rate: 1 -> 6 A 1 = 6 B
Program internally expects a min_amount_out of 6 A 1 + (6*0.04) = 6.24
Therefore I have to adjust the exchange rate to 6 B / 1,04 = 5,77
As the exchange rate must have B decimals I would need to round it down to 5! That makes the minimum amount out my exchange rate guarantees thrift far away from the original expected min_amount_out.
So instead of setting the threshold via an Exchange rate I suggest to set a min_amount_out threshold.
Scenario: Token A decimals: 6 Token B decimals: 0 Exchange Rate: 1 -> 6 A 1 = 6 B Program internally expects a min_amount_out of 6 A 1 + (6*0.04) = 6.24 Therefore I have to adjust the exchange rate to 6 B / 1,04 = 5,77 As the exchange rate must have B decimals I would need to round it down to 5! That makes the minimum amount out my exchange rate guarantees thrift far away from the original expected min_amount_out.
So instead of setting the threshold via an Exchange rate I suggest to set a min_amount_out threshold.