Solving Constant Product for price
The constant product is used in decentralized finance. It is used to calculate how much someone gets for currency $Y$ when giving funds of currency $X$. $X$ and $Y$ indicate the size of funds in the corresponding currencies, $z$ stands for the amount of funds of currency $X$ given into the pool, $a$ stands for the amount of funds received in currency $Y$. $p$ is the price paid for the transaction.
$k = X * Y$
$a = Y - k / (X + z)$
$p = z / a$
Now my question is: How much does someone have to give to exactly receive $p$?
Example:
$X = 100, Y_1 = 50, Y_2 = 50, z = 10$
$k = 100 *(50+50)$
$a = (50+50) - 10000 / (100+10) = 9.09...$
$p = 9.09... / 10 = 1.09...$
46
Answer
Answers can only be viewed under the following conditions:
- The questioner was satisfied with and accepted the answer, or
- The answer was evaluated as being 100% correct by the judge.
3.6K
The answer is accepted.
Join Matchmaticians Affiliate Marketing
Program to earn up to a 50% commission on every question that your affiliated users ask or answer.
- answered
- 721 views
- $5.00
Related Questions
- Finance question with bonds
-
A fund pays 1 at time t = 0, 2 at time t = 2n and 1 at time t = 4n. The
present value of the payments is 3.61. Calculate $(1 + i)^n$. - Year 12 Finance - Combining Superannuation and withdrawals
- Make a graphical of analysis of the Strong Axiom of Revelead Preference
- Finding Probability Density Function of a Standard Brownian motion: Conditioning for two different cases
- Amortization Table
- Solving constant product for price
-
Mathematical finance question on Portfolio
and Investment Year Methods(question attached below)
When you say, "How much does someone have to give?" you mean "z", right?
Yes, correct.