Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use min_amount_out rather than min_exchange_rate #32

Open
gitmalong opened this issue Jul 7, 2022 · 1 comment
Open

Use min_amount_out rather than min_exchange_rate #32

gitmalong opened this issue Jul 7, 2022 · 1 comment

Comments

@gitmalong
Copy link

gitmalong commented Jul 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@gitmalong and others