ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1
Providing liquidity of Eth / DAI pair via Uniswap
2
3
Source:
https://pintail.medium.com/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2
4
Python:
https://github.com/jamiels/uniswap-math
5
Email:
jamiel@chainhaus.com
6
http://jamiel.io
7
8
Market PriceEthDai
9
$100$1
10
Market Value
11
EthPriceDaiPriceCostEthDaiTotal
12
LP Initial Supplied1$100100$1$200$100100$200
13
14
Eth QtyDai QtyMkt ValueConstant ProductEth LiquidityDai Liquidity
15
Initial Pool999900$19,800.00980100999900
16
Current Pool10010,000$20,000.00100000010010000
17
18
19
MarketLP provides
Pool Inventory
Price
20
PairLP market
21
1 Eth equals1 DAI equalsEthDaiValue% of pool% of poolEthDaiEth in terms of DaiDai in terms of EthConstant ProductEth Liq PoolToken Liq PoolEth RedemeebaleDai RedeemableValueLoss/GainPrice Ratio
22
$100$11100$200.001.00%1.00%100100001000.011000000100100001100$200.00$0.00
23
$120$11100$220.001.00%1.00%100100001200.008333333333100000091.2870929210954.451150.9128709292109.5445115$219.09-$0.911.1-0.001134430314-$0.25
24
25
26
0.20%
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Price (p0)Price Now
price_ratio
% ChangeDivergence
50
1000.010.00-99.99%-98.000%
51
10010.01-99.00%-80.198%
52
100100.10-90.00%-42.504%
53
100250.25-75.00%-20.000%
54
100500.50-50.00%-5.719%
55
1001001.000.00%0.000%
56
1001201.2020.00%-0.414%
57
1001251.2525.00%-0.619%
58
1001501.5050.00%-2.020%
59
1002002.00100.00%-5.719%
60
1003003.00200.00%-13.397%
61
1004004.00300.00%-20.000%
62
1005005.00400.00%-25.464%
63
64
Source:
https://medium.com/scalar-capital/uniswap-a-unique-exchange-f4ef44f807bf
65
66
67
initial pool
68
xyk
69
ethdaiimplied price
constant product
70
10001000000.01100000000
71
72
73
74
75
76
77
eth purchased
cost per eth
total cost in dai
premiumdai inventoryeth inventoryproducttarget
78
1100.100100.10010010.10%100100.1001999100000000100000000
79
10101.0101010.101011.01%101010.101990100000000100000000
80
50105.2635263.1578955.26%105263.1579950100000000100000000
81
75108.1088108.1081088.11%108108.1081925100000000100000000
82
100111.11111111.1111111.11%111111.1111900100000000100000000
83
150117.64717647.0588217.65%117647.0588850100000000100000000
84
200125.0002500025.00%125000800100000000100000000
85
300142.85742857.1428642.86%142857.1429700100000000100000000
86
400166.66766666.6666766.67%166666.6667600100000000100000000
87
500200.000100000100.00%200000500100000000100000000
88
600250.000150000150.00%250000400100000000100000000
89
800500.000400000400.00%500000200100000000100000000
90
9001000.000900000900.00%1000000100100000000100000000
91
92
93
94
95
96
97
98
99
100