We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I'm trying to understand how AmountMin are computed from allowed slippage here:
joe-sdks/packages/v2/src/v2entities/pair.ts
Line 444 in 1a0d34c
const amountXMin = new Fraction(ONE) .add(amountSlippage) .invert() .multiply(amountX).quotient
for allowed slippage of 100%, it would gives a amountXMin = amountX / 2 Is it intended ? should amountXMin be 0 in that case ?
Intuitively i would do like this: const amountXMin = (new Fraction(amountX).multiply(new Fraction(1n).subtract(amountSlippage))).quotient;
const amountXMin = (new Fraction(amountX).multiply(new Fraction(1n).subtract(amountSlippage))).quotient;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I'm trying to understand how AmountMin are computed from allowed slippage here:
joe-sdks/packages/v2/src/v2entities/pair.ts
Line 444 in 1a0d34c
for allowed slippage of 100%, it would gives a amountXMin = amountX / 2
Is it intended ? should amountXMin be 0 in that case ?
Intuitively i would do like this:
const amountXMin = (new Fraction(amountX).multiply(new Fraction(1n).subtract(amountSlippage))).quotient;
The text was updated successfully, but these errors were encountered: