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

Diff to the kyber swap contract swapMath in estimateIncrementalLiquidity function #8

Open
WagZol opened this issue Mar 23, 2023 · 0 comments

Comments

@WagZol
Copy link

WagZol commented Mar 23, 2023

Error:

In the kyber swap elastic contract at the 'estimateIncrementalLiquidity' function, if the isToken0 = false then the 'b' variable will be equal to feeInFeeUnit is subtracted from C.FEE_UNITS, multiplied by liquidity, but in the sdk implementation multiplication is missing

Proof:

Part of original SwapMath.lib of Kyber swap elastic pool contract:
Screenshot_2023-03-22_16-03-44

Implementation of the 'estimateIncrementalLiquidity' of the SDK:

let b = JSBI.subtract(BPS, fee)

@viet-nv could you please check it?

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

1 participant