Section 5 - New bug: TSwapPool functions getPriceOfOneWethInPoolTokens() and getPriceOfOnePoolTokenInWeth() return incorrect values #102
paprikrumplikas
started this conversation in
General
Replies: 2 comments 4 replies
-
Test this by inserting the following piece of code in
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi, @paprikrumplikas , I understood nothing, and how can we write tests like you? I'm unable to write the tests. How can I connect with you (social media?). Explain this bug, @PatrickAlphaC |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
As the title says, the return values of
TSwapPool::getPriceOfOneWethInPoolTokens
andTSwapPool::getPriceOfOnePoolTokenInWeth
are incorrect. They both return the amount of output tokens after fees, which is not the same as the price of 1 output token in input tokens.(As compared to a fee-less protocol, if there are fees, the amount of output tokens should be lower, while the price should be not lower but higher.)
Incorrect:
Correct:
The same applies to
getPriceOfOnePoolTokenInWeth
.Beta Was this translation helpful? Give feedback.
All reactions