| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | NOTE: COPY this sheet to tweak numbers yourself. File -> Make a copy | ||||||||||||||||||||||||||||||||||||||||
2 | |||||||||||||||||||||||||||||||||||||||||
3 | v2 | ||||||||||||||||||||||||||||||||||||||||
4 | Constant Product: x * y = k | ||||||||||||||||||||||||||||||||||||||||
5 | Price (token1/ token0) | Token0 (x, Eth) | Token1 (y, Dai) | Product (k) | |||||||||||||||||||||||||||||||||||||
6 | Add liquidity | 1000 | 1 | 1000 | 1000 | ||||||||||||||||||||||||||||||||||||
7 | Add liquidity | 1000 | 1 | 1000 | 1000 | ||||||||||||||||||||||||||||||||||||
8 | Totals | 2 | 2000 | 4000 | |||||||||||||||||||||||||||||||||||||
9 | |||||||||||||||||||||||||||||||||||||||||
10 | Calculate new reserves based on price change: price(x) = y/x => k/x^2 | ||||||||||||||||||||||||||||||||||||||||
11 | |||||||||||||||||||||||||||||||||||||||||
12 | Price (token1/ token0) | Token0 (x, Eth) | Token1 (y, Dai) | Product (k) | |||||||||||||||||||||||||||||||||||||
13 | 2000 | 1.414 | 2828.427 | 4000 | |||||||||||||||||||||||||||||||||||||
14 | 500 | 2.828 | 1414.214 | 4000 | |||||||||||||||||||||||||||||||||||||
15 | 1 | 63.2455532 | 63.2455532 | 4000 | |||||||||||||||||||||||||||||||||||||
16 | |||||||||||||||||||||||||||||||||||||||||
17 | |||||||||||||||||||||||||||||||||||||||||
18 | v3 | ||||||||||||||||||||||||||||||||||||||||
19 | While still based on constant product, but only within limits. | ||||||||||||||||||||||||||||||||||||||||
20 | |||||||||||||||||||||||||||||||||||||||||
21 | |||||||||||||||||||||||||||||||||||||||||
22 | 1. Example scenarios with price limits as inputs (ignoring ticks) | ||||||||||||||||||||||||||||||||||||||||
23 | NOTE: Gray cells are inputs. Try plugging in different numbers. | ||||||||||||||||||||||||||||||||||||||||
24 | |||||||||||||||||||||||||||||||||||||||||
25 | Inputs | Useful Outputs (real liquidity) | Details (virtual liquidity) | Temporary variables (to manage excel formulas) | |||||||||||||||||||||||||||||||||||||
26 | Scenario | Current Price | Virtual Liquidity (L) | Position Size | Position Center | % below | % above | Lower Limit (price) | Upper Limit (price) | Token0 Contribution Required | Token1 Contribution Required | Capital Efficiency multiplier | Token0 amount at lower limit | Token1 amount at lower limit | Token0 amount at current | Token1 amount at current | Token0 amount at upper limit | Token1 amount at upper limit | Price in Range | Price above range | Price below range | ||||||||||||||||||||
27 | Formulas | Input | Input | in ticks | using geometric mean | L/sqrt(low_limit) | L*sqrt(low_limit) | L/sqrt(curr_price) | L*sqrt(curr_price) | L/sqrt(upp_limit) | L*sqrt(upp_limit) | ||||||||||||||||||||||||||||||
28 | Add "unbounded" liquidity (equivalent to v2) | 1000.00 | 40 | 0.0000 | 4.38E+129 | 1.264911 | 1,264.911064 | 1.0x | 1.78E+30 | 0.000 | 1.265 | 1264.911 | 0.000 | 1.78E+30 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||||||
29 | Add liquidity with price in range | 1000.00 | 40 | 346.410 | -42.26% | 73.21% | 200.0000 | 600.0000 | 0.000000 | 414.110472 | 4.2x | 2.828 | 565.685 | 1.265 | 1264.911 | 1.633 | 979.796 | FALSCH | WAHR | FALSCH | |||||||||||||||||||||
30 | Add liquidity below current price | 1000.00 | 40 | 100.000 | -50.00% | 100.00% | 50.0000 | 200.0000 | 0.000000 | 282.842712 | 3.4x | 5.657 | 282.843 | 1.265 | 1264.911 | 2.828 | 565.685 | FALSCH | WAHR | FALSCH | |||||||||||||||||||||
31 | Add liquidity above current price | 1000.00 | 40 | 707.107 | -29.29% | 41.42% | 500.0000 | 1,000.0000 | 0.000000 | 370.483873 | 6.3x | 1.789 | 894.427 | 1.265 | 1264.911 | 1.265 | 1264.911 | WAHR | FALSCH | FALSCH | |||||||||||||||||||||
32 | |||||||||||||||||||||||||||||||||||||||||
33 | |||||||||||||||||||||||||||||||||||||||||
34 | |||||||||||||||||||||||||||||||||||||||||
35 | 2. Example Scenarios with price limits as inputs that are expressed as overall position size in ticks | ||||||||||||||||||||||||||||||||||||||||
36 | NOTE: Gray cells are inputs. Try plugging in different numbers. | ||||||||||||||||||||||||||||||||||||||||
37 | |||||||||||||||||||||||||||||||||||||||||
38 | Fee | 0.05% | |||||||||||||||||||||||||||||||||||||||
39 | Tick Size (based on fee) | 0.001 | |||||||||||||||||||||||||||||||||||||||
40 | |||||||||||||||||||||||||||||||||||||||||
41 | Inputs | Useful Outputs (real liquidity) | Details (virtual liquidity) | Temporary variables (to manage excel formulas) | |||||||||||||||||||||||||||||||||||||
42 | Scenario | Current Price | Virtual Liquidity (L) | Position Size | Position Center | % below | % above | Lower Limit (price) | Upper Limit (price) | Token0 Contribution Required | Token1 Contribution Required | Capital Efficiency multiplier | Token0 amount at lower limit | Token1 amount at lower limit | Token0 amount at current | Token1 amount at current | Token0 amount at upper limit | Token1 amount at upper limit | Price in Range | Price above range | Price below range | ||||||||||||||||||||
43 | Formulas | Input | Input | in ticks | using geometric mean | L/sqrt(low_limit) | L*sqrt(low_limit) | L/sqrt(curr_price) | L*sqrt(curr_price) | L/sqrt(upp_limit) | L*sqrt(upp_limit) | ||||||||||||||||||||||||||||||
44 | Add liquidity within 1 tick band | 1000.00 | 40 | 1 | 1,000.2913 | -0.0500% | 0.0500% | 999.7915 | 1,000.7913 | 0.000500 | 0.131846 | 4,002.5x | 1.265 | 1264.779 | 1.265 | 1264.911 | 1.264 | 1265.411 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
45 | Add liquidity within 2 tick band | 1000.00 | 40 | 2 | 1,000.2913 | -0.1498% | 0.1500% | 998.7928 | 1,001.7921 | 0.001132 | 0.763761 | 1,334.5x | 1.266 | 1264.147 | 1.265 | 1264.911 | 1.264 | 1266.044 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
46 | Add liquidity within 10 tick band | 1000.00 | 40 | 10 | 1,000.2913 | -0.5482% | 0.5512% | 994.8075 | 1,005.8053 | 0.003656 | 3.288269 | 364.3x | 1.268 | 1261.623 | 1.265 | 1264.911 | 1.261 | 1268.577 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
47 | Add liquidity within 20 tick band | 1000.00 | 40 | 20 | 1,000.2913 | -1.0440% | 1.0550% | 989.8484 | 1,010.8444 | 0.006803 | 6.436814 | 191.1x | 1.271 | 1258.474 | 1.265 | 1264.911 | 1.258 | 1271.751 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
48 | Add liquidity within 101 tick band | 1000.00 | 40 | 101 | 1,000.2913 | -4.9222% | 5.1770% | 951.0549 | 1,052.0767 | 0.031703 | 31.343947 | 40.1x | 1.297 | 1233.567 | 1.265 | 1264.911 | 1.233 | 1297.429 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
49 | Add liquidity within 1001 tick band | 1000.00 | 40 | 1001 | 1,000.2913 | -39.3621% | 64.9133% | 606.5557 | 1,649.6138 | 0.280064 | 279.776966 | 4.5x | 1.624 | 985.134 | 1.265 | 1264.911 | 0.985 | 1624.618 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
50 | Add liquidity within 10001 tick band | 1000.00 | 40 | 10001 | 1,000.2913 | -99.3249% | 14711.6839% | 6.7534 | 148,159.9878 | 1.160992 | 1,160.961895 | 1.1x | 15.392 | 103.949 | 1.265 | 1264.911 | 0.104 | 15396.622 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
51 | Add liquidity within 100001 tick band | 1000.00 | 40 | 100001 | 1,000.2913 | -100.0000% | 505930666641210000000000.00% | 0.0000 | 5.06E+24 | 1.264911 | 1,264.911064 | 1.0x | 89958508133.023 | 0.000 | 1.265 | 1264.911 | 0.000 | 89984714445123.600 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
52 | Totals | ||||||||||||||||||||||||||||||||||||||||
53 | |||||||||||||||||||||||||||||||||||||||||
54 | |||||||||||||||||||||||||||||||||||||||||
55 | |||||||||||||||||||||||||||||||||||||||||
56 | 3. Example Scenarios with desired capital efficiency as inputs | ||||||||||||||||||||||||||||||||||||||||
57 | Fee | 0.05% | |||||||||||||||||||||||||||||||||||||||
58 | Tick Size (based on fee) | 0.001 | |||||||||||||||||||||||||||||||||||||||
59 | |||||||||||||||||||||||||||||||||||||||||
60 | Inputs | Useful Outputs (real liquidity) | Details (virtual liquidity) | Temporary variables (to manage excel formulas) | |||||||||||||||||||||||||||||||||||||
61 | Scenario | Current Price | Virtual Liquidity (L) | Position Size | Position Center | % below | % above | Lower Limit (price) | Upper Limit (price) | Token0 Contribution Required | Token1 Contribution Required | Capital Efficiency multiplier | Token0 amount at lower limit | Token1 amount at lower limit | Token0 amount at current | Token1 amount at current | Token0 amount at upper limit | Token1 amount at upper limit | Price in Range | Price above range | Price below range | ||||||||||||||||||||
62 | Formulas | Input | Input | approximately in ticks | Input | L/sqrt(low_limit) | L*sqrt(low_limit) | L/sqrt(curr_price) | L*sqrt(curr_price) | L/sqrt(upp_limit) | L*sqrt(upp_limit) | ||||||||||||||||||||||||||||||
63 | Add liquidity for 4002.5x cap efficiency | 1000.00 | 40 | 1 | 1,000.2913 | -0.0500% | 0.0500% | 999.7915 | 1,000.7913 | 0.000500 | 0.131846 | 4,002.5x | 1.265 | 1264.779 | 1.265 | 1264.911 | 1.264 | 1265.411 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
64 | Add liquidity for 2000x cap efficiency | 1000.00 | 40 | 3 | 1,000.2913 | -0.1000% | 0.1001% | 999.2913 | 1,001.2924 | 0.000817 | 0.448317 | 2,000.0x | 1.265 | 1264.463 | 1.265 | 1264.911 | 1.264 | 1265.728 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
65 | Add liquidity for 1000x cap efficiency | 1000.00 | 40 | 5 | 1,000.2913 | -0.1999% | 0.2003% | 998.2917 | 1,002.2949 | 0.001449 | 1.080865 | 1,000.0x | 1.266 | 1263.830 | 1.265 | 1264.911 | 1.263 | 1266.362 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
66 | Add liquidity for 500x cap efficiency | 1000.00 | 40 | 9 | 1,000.2913 | -0.3996% | 0.4012% | 996.2942 | 1,004.3045 | 0.002714 | 2.345960 | 500.0x | 1.267 | 1262.565 | 1.265 | 1264.911 | 1.262 | 1267.631 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
67 | Add liquidity for 250x cap efficiency | 1000.00 | 40 | 17 | 1,000.2913 | -0.7984% | 0.8048% | 992.3050 | 1,008.3419 | 0.005243 | 4.876150 | 250.0x | 1.270 | 1260.035 | 1.265 | 1264.911 | 1.260 | 1270.176 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
68 | Add liquidity for 100x cap efficiency | 1000.00 | 40 | 41 | 1,000.2913 | -1.9900% | 2.0304% | 980.3855 | 1,020.6013 | 0.012831 | 12.466722 | 100.0x | 1.278 | 1252.444 | 1.265 | 1264.911 | 1.252 | 1277.874 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
69 | Add liquidity for 50x cap efficiency | 1000.00 | 40 | 81 | 1,000.2913 | -3.9600% | 4.1233% | 960.6798 | 1,041.5361 | 0.025479 | 25.117675 | 50.0x | 1.291 | 1239.793 | 1.265 | 1264.911 | 1.239 | 1290.914 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
70 | Add liquidity for 10x cap efficiency | 1000.00 | 40 | 423 | 1,000.2913 | -19.0000% | 23.46% | 810.2360 | 1,234.9276 | 0.126657 | 126.325299 | 10.0x | 1.405 | 1138.586 | 1.265 | 1264.911 | 1.138 | 1405.661 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
71 | Add liquidity for 5x cap efficiency | 1000.00 | 40 | 895 | 1,000.2913 | -36.0000% | 56.25% | 640.1864 | 1,562.9552 | 0.253130 | 252.834828 | 5.0x | 1.581 | 1012.076 | 1.265 | 1264.911 | 1.012 | 1581.369 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
72 | Add liquidity for 2x cap efficiency | 1000.00 | 40 | 2775 | 1,000.2913 | -75.0000% | 300.00% | 250.0728 | 4,001.1653 | 0.632548 | 632.363417 | 2.0x | 2.529 | 632.548 | 1.265 | 1264.911 | 0.632 | 2530.191 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
73 | Add liquidity for 1.5x cap efficiency | 1000.00 | 40 | 4397 | 1,000.2913 | -88.8889% | 800.00% | 111.1435 | 9,002.6218 | 0.843335 | 843.212632 | 1.5x | 3.794 | 421.698 | 1.265 | 1264.911 | 0.422 | 3795.286 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
74 | Add liquidity for 1.1x cap efficiency | 1000.00 | 40 | 9597 | 1,000.2913 | -99.1736% | 12000.00% | 8.2669 | 121,035.2492 | 1.149936 | 1,149.902401 | 1.1x | 13.912 | 115.009 | 1.265 | 1264.911 | 0.115 | 13916.048 | WAHR | FALSCH | FALSCH | ||||||||||||||||||||
75 | Add liquidity for 1x cap efficiency | 1000.00 | 40 | #DIV/0! | 1,000.2913 | -100.0000% | #DIV/0! | 0.0000 | #DIV/0! | #DIV/0! | #DIV/0! | 1.0x | #DIV/0! | 0.000 | 1.265 | 1264.911 | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | FALSCH | ||||||||||||||||||||
76 | Totals | ||||||||||||||||||||||||||||||||||||||||
77 | |||||||||||||||||||||||||||||||||||||||||
78 | |||||||||||||||||||||||||||||||||||||||||
79 | |||||||||||||||||||||||||||||||||||||||||
80 | |||||||||||||||||||||||||||||||||||||||||
81 | |||||||||||||||||||||||||||||||||||||||||
82 | |||||||||||||||||||||||||||||||||||||||||
83 | |||||||||||||||||||||||||||||||||||||||||
84 | |||||||||||||||||||||||||||||||||||||||||
85 | |||||||||||||||||||||||||||||||||||||||||
86 | |||||||||||||||||||||||||||||||||||||||||
87 | |||||||||||||||||||||||||||||||||||||||||
88 | |||||||||||||||||||||||||||||||||||||||||
89 | |||||||||||||||||||||||||||||||||||||||||
90 | |||||||||||||||||||||||||||||||||||||||||
91 | |||||||||||||||||||||||||||||||||||||||||
92 | |||||||||||||||||||||||||||||||||||||||||
93 | |||||||||||||||||||||||||||||||||||||||||
94 | |||||||||||||||||||||||||||||||||||||||||
95 | |||||||||||||||||||||||||||||||||||||||||
96 | |||||||||||||||||||||||||||||||||||||||||
97 | |||||||||||||||||||||||||||||||||||||||||
98 | |||||||||||||||||||||||||||||||||||||||||
99 | |||||||||||||||||||||||||||||||||||||||||
100 | |||||||||||||||||||||||||||||||||||||||||