Solving Constant Product for ratio
The constant product is used in decentralized finance. It is used to calculate how much someone gets of currency $Y$ when giving funds of currency $X$ into a trading pool. $X$ and $Y$ indicate the size of funds in the corresponding trading pool, $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$. $R$ represents the ratio of the two currencies, $R = Y/X$, $R'$ represents the ratio of the two currencies after the trade
$k = XY$
$a = Y − k/(X+z)$
$X' = X+z$
$Y' = Y-a$
$R' = Y'/X'$
Now my question is: How to solve for $z$ given the variables $X$, $Y$ and $R'$?
Example:
$X=20, Y=10, R=0, z=1$
$k=20∗10 = 200$
$a=10 − 200/(20+1)=0.47619...$
$X'=X+z=21$
$Y'=Y-a=9.5238...$
$R'=9.5238... / 21 = 0.4535...$
Answer
- The questioner was satisfied with and accepted the answer, or
- The answer was evaluated as being 100% correct by the judge.
- answered
- 382 views
- $20.00
Related Questions
- Year 12 Finance - Combining Superannuation and withdrawals
- Contract Crediting Rate Formula
- Finance question with bonds
- Finding Probability Density Function of a Standard Brownian motion: Conditioning for two different cases
- Year 12 Finance - Home loans
- Disecting Constant Product formula
- Compound Interest with monthly added capital
-
You are given:
(i) X is the current value at time 2 of a 20-year annuity-due of $1 per annum.
(ii) The annual effective interest rate for year t is (1/(8+t)).
Find X.
The offered bounty is low.
I increased the bounty
The bounty is too low
I increased the bounty