Skip to content

Commit

Permalink
Fix formula data typo
Browse files Browse the repository at this point in the history
  • Loading branch information
y1cunhui authored Feb 16, 2023
1 parent 635ac27 commit 77a8014
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/docs/milestone_1/calculating-liquidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ $$L = \frac{\Delta y}{\sqrt{P_c} - \sqrt{P_a}}$$
接下来,我们把之前计算出的价格代入公式:
$$L = \Delta x \frac{\sqrt{P_b}\sqrt{P_c}}{\sqrt{P_b}-\sqrt{P_c}} = 1 ETH * \frac{67.42 * 70.71}{70.71 - 67.42}$$
$$L = \Delta x \frac{\sqrt{P_b}\sqrt{P_c}}{\sqrt{P_b}-\sqrt{P_c}} = 1 ETH * \frac{74.16 * 70.71}{74.16 - 70.71}$$
转换成 Q64.96 后得到:
$$L = 1519437308014769733632$$
对于另一个 $L$:
$$L = \frac{\Delta y}{\sqrt{P_c}-\sqrt{P_a}} = \frac{5000USDC}{74.16-70.71}$$
$$L = \frac{\Delta y}{\sqrt{P_c}-\sqrt{P_a}} = \frac{5000USDC}{70.71 - 67.42}$$
$$L = 1517882343751509868544$$
两者中,我们选择小的那一个
Expand Down Expand Up @@ -233,4 +233,4 @@ $$\Delta y = L(\sqrt{P_c} - \sqrt{P_a})$$
> 正如上述计算结果,得到的数据基本等于我们想要提供的数量,不过 ETH 略少一点
> **Hint**: 使用 `cast --from-wei AMOUNT` 来把wei转换成ether, 示例:
> `cast --from-wei 998976618347425280` 输出 `0.998976618347425280`.
> `cast --from-wei 998976618347425280` 输出 `0.998976618347425280`.

0 comments on commit 77a8014

Please sign in to comment.