Replies: 1 comment 7 replies
-
Hello @Damyanov7, The below statements become incorrect the moment the user supplied the The ratio between TokenA and TokenB is 1 / 3 The ratio changes in a pool when you supply one token to get another. The ratio between TokenA and TokenB being 1/3 is correct before the user supplied the |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to do so manual calculations to check if calculations are correct, but I'm most likely missing something.
In the course Patrick mentioned that 10000 should be 1000.
The line that bothers me is:
I'm assuming that I have 2 tokens - A and B where:
TokenA Reserve: 100_000
TokenB Reserve: 300_000
User wants to get out 500 of TokenA, he needs to find how much TokenB he must input.
The formula with values placed in place of variables is:
Placing this in the calculator results to: 1512.07391017
The ratio between TokenA and TokenB is 1 / 3
=> 1512.07391017 of TokenB will result in 1512.07391017 / 3 = 504.024636723 (TokenA)
0.3% from 504.024636723 should result in 500 (The amount that the user wanted) and the rest remains in the protocol as reward for LPs, but in reality =>
Where do I go wrong?
Beta Was this translation helpful? Give feedback.
All reactions