DeFiPy 0.0.18__tar.gz → 0.0.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {DeFiPy-0.0.18 → defipy-0.0.20/DeFiPy.egg-info}/PKG-INFO +48 -15
  2. {DeFiPy-0.0.18 → defipy-0.0.20}/DeFiPy.egg-info/SOURCES.txt +3 -1
  3. {DeFiPy-0.0.18 → defipy-0.0.20}/DeFiPy.egg-info/requires.txt +1 -1
  4. DeFiPy-0.0.18/README.md → defipy-0.0.20/PKG-INFO +58 -11
  5. DeFiPy-0.0.18/DeFiPy.egg-info/PKG-INFO → defipy-0.0.20/README.md +42 -25
  6. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/__init__.py +2 -0
  7. defipy-0.0.20/python/prod/process/join/__init__.py +1 -0
  8. defipy-0.0.20/python/prod/utils/tools/v3/__init__.py +1 -0
  9. {DeFiPy-0.0.18 → defipy-0.0.20}/setup.py +5 -3
  10. {DeFiPy-0.0.18 → defipy-0.0.20}/DeFiPy.egg-info/dependency_links.txt +0 -0
  11. {DeFiPy-0.0.18 → defipy-0.0.20}/DeFiPy.egg-info/not-zip-safe +0 -0
  12. {DeFiPy-0.0.18 → defipy-0.0.20}/DeFiPy.egg-info/top_level.txt +0 -0
  13. {DeFiPy-0.0.18 → defipy-0.0.20}/LICENSE.txt +0 -0
  14. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/erc/__init__.py +0 -0
  15. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/basic/__init__.py +0 -0
  16. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/interest/__init__.py +0 -0
  17. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/interest/ips/__init__.py +0 -0
  18. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/interest/ips/aggregate/__init__.py +0 -0
  19. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/model/__init__.py +0 -0
  20. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/math/risk/__init__.py +0 -0
  21. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/__init__.py +0 -0
  22. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/burn/__init__.py +0 -0
  23. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/deposit/__init__.py +0 -0
  24. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/liquidity/__init__.py +0 -0
  25. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/mint/__init__.py +0 -0
  26. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/process/swap/__init__.py +0 -0
  27. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/simulate/__init__.py +0 -0
  28. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/utils/client/__init__.py +0 -0
  29. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/utils/data/__init__.py +0 -0
  30. {DeFiPy-0.0.18 → defipy-0.0.20}/python/prod/utils/interfaces/__init__.py +0 -0
  31. {DeFiPy-0.0.18 → defipy-0.0.20}/setup.cfg +0 -0
@@ -1,16 +1,20 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DeFiPy
3
- Version: 0.0.18
3
+ Version: 0.0.20
4
4
  Summary: DeFi Analytics with Python
5
5
  Home-page: http://github.com/defipy-devs/defipy
6
6
  Author: icmoore
7
7
  Author-email: defipy.devs@gmail.com
8
8
  License: MIT
9
- Platform: UNKNOWN
10
9
  Description-Content-Type: text/markdown
11
10
  License-File: LICENSE.txt
11
+ Requires-Dist: scipy>=1.7.3
12
+ Requires-Dist: bokeh==3.3.4
13
+ Requires-Dist: uniswappy==1.4.0
14
+ Requires-Dist: stableswappy==0.0.11
15
+ Requires-Dist: balancerpy==0.0.9
12
16
 
13
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
17
+ # DeFiPy: DeFi Analytics with Python (v 0.0.20)
14
18
 
15
19
  Welcome to the worlds first DeFi Python package with all major protocols intergrated into one package! Implement your analytics in one package with DeFiPy. Since DeFiPy is built with a modular design in mind, your can also silo your analytics by protocol
16
20
  using:
@@ -36,7 +40,7 @@ or
36
40
  > pip install defipy
37
41
  ```
38
42
 
39
- Uniswap Example
43
+ Uniswap V2 Example
40
44
  --------------------------
41
45
 
42
46
  To setup a liquidity pool, you must first create the tokens in the pair using the `ERC20` object. Next, create a liquidity pool (LP) factory using `IFactory` object. Once this is setup, an unlimited amount of LPs can be created; the procedures for such are as follows:
@@ -45,23 +49,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
45
49
  from defipy import *
46
50
 
47
51
  user_nm = 'user_intro'
48
- eth_amount = 1000
49
- dai_amount = 1000000
50
-
51
- dai = ERC20("DAI", "0x01")
52
- eth = ERC20("ETH", "0x02")
52
+ eth_amount = 3162.277660168379
53
+ dai_amount = 316227.7660168379
53
54
 
54
- factory = UniswapFactory("ETH pool factory", "0x")
55
- exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP", address="0x11")
55
+ dai = ERC20("DAI", "0x111")
56
+ eth = ERC20("ETH", "0x09")
57
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
58
+ address="0x011")
59
+
60
+ factory = UniswapFactory("ETH pool factory", "0x2")
56
61
  lp = factory.deploy(exchg_data)
57
62
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
58
63
  lp.summary()
59
64
 
60
65
 
61
66
  #OUTPUT:
62
- Exchange ETH-DAI (LP)
63
- Reserves: ETH = 1000, DAI = 1000000
67
+ Exchange ETH-DAI (LP)
68
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
64
69
  Liquidity: 31622.776601683792
70
+
71
+ Uniswap V3 Example
72
+ --------------------------
73
+
74
+ from defipy import *
75
+
76
+ user = 'user_intro'
77
+ fee = UniV3Utils.FeeAmount.MEDIUM
78
+ tick_spacing = UniV3Utils.TICK_SPACINGS[fee]
79
+ lwr_tick = UniV3Utils.getMinTick(tick_spacing)
80
+ upr_tick = UniV3Utils.getMaxTick(tick_spacing)
81
+ init_price = UniV3Utils.encodePriceSqrt(100, 1)
82
+
83
+ dai = ERC20("DAI", "0x09")
84
+ eth = ERC20("ETH", "0x111")
85
+
86
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
87
+ address="0x011", version = 'V3',
88
+ tick_spacing = tick_spacing,
89
+ fee = fee)
90
+
91
+ factory = UniswapFactory("ETH pool factory", "0x2")
92
+ lp = factory.deploy(exchg_data)
93
+ lp.initialize(init_price)
94
+ out = lp.mint(user, lwr_tick, upr_tick, 31622.776601683792)
95
+ lp.summary()
96
+
97
+ Exchange ETH-DAI (LP)
98
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
99
+ Liquidity: 31622.776601683792
65
100
 
66
101
  Balancer Example
67
102
  --------------------------
@@ -161,5 +196,3 @@ Click [dashboard.defipy.org](https://dashboard.defipy.org/) for live link; for m
161
196
  ```
162
197
  > bokeh serve --show python/application/quant_terminal/bokeh_server.py
163
198
  ```
164
-
165
-
@@ -25,10 +25,12 @@ python/prod/math/risk/__init__.py
25
25
  python/prod/process/__init__.py
26
26
  python/prod/process/burn/__init__.py
27
27
  python/prod/process/deposit/__init__.py
28
+ python/prod/process/join/__init__.py
28
29
  python/prod/process/liquidity/__init__.py
29
30
  python/prod/process/mint/__init__.py
30
31
  python/prod/process/swap/__init__.py
31
32
  python/prod/simulate/__init__.py
32
33
  python/prod/utils/client/__init__.py
33
34
  python/prod/utils/data/__init__.py
34
- python/prod/utils/interfaces/__init__.py
35
+ python/prod/utils/interfaces/__init__.py
36
+ python/prod/utils/tools/v3/__init__.py
@@ -1,5 +1,5 @@
1
1
  scipy>=1.7.3
2
2
  bokeh==3.3.4
3
- uniswappy==1.2.0
3
+ uniswappy==1.4.0
4
4
  stableswappy==0.0.11
5
5
  balancerpy==0.0.9
@@ -1,4 +1,20 @@
1
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
1
+ Metadata-Version: 2.1
2
+ Name: DeFiPy
3
+ Version: 0.0.20
4
+ Summary: DeFi Analytics with Python
5
+ Home-page: http://github.com/defipy-devs/defipy
6
+ Author: icmoore
7
+ Author-email: defipy.devs@gmail.com
8
+ License: MIT
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.txt
11
+ Requires-Dist: scipy>=1.7.3
12
+ Requires-Dist: bokeh==3.3.4
13
+ Requires-Dist: uniswappy==1.4.0
14
+ Requires-Dist: stableswappy==0.0.11
15
+ Requires-Dist: balancerpy==0.0.9
16
+
17
+ # DeFiPy: DeFi Analytics with Python (v 0.0.20)
2
18
 
3
19
  Welcome to the worlds first DeFi Python package with all major protocols intergrated into one package! Implement your analytics in one package with DeFiPy. Since DeFiPy is built with a modular design in mind, your can also silo your analytics by protocol
4
20
  using:
@@ -24,7 +40,7 @@ or
24
40
  > pip install defipy
25
41
  ```
26
42
 
27
- Uniswap Example
43
+ Uniswap V2 Example
28
44
  --------------------------
29
45
 
30
46
  To setup a liquidity pool, you must first create the tokens in the pair using the `ERC20` object. Next, create a liquidity pool (LP) factory using `IFactory` object. Once this is setup, an unlimited amount of LPs can be created; the procedures for such are as follows:
@@ -33,23 +49,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
33
49
  from defipy import *
34
50
 
35
51
  user_nm = 'user_intro'
36
- eth_amount = 1000
37
- dai_amount = 1000000
38
-
39
- dai = ERC20("DAI", "0x01")
40
- eth = ERC20("ETH", "0x02")
52
+ eth_amount = 3162.277660168379
53
+ dai_amount = 316227.7660168379
41
54
 
42
- factory = UniswapFactory("ETH pool factory", "0x")
43
- exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP", address="0x11")
55
+ dai = ERC20("DAI", "0x111")
56
+ eth = ERC20("ETH", "0x09")
57
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
58
+ address="0x011")
59
+
60
+ factory = UniswapFactory("ETH pool factory", "0x2")
44
61
  lp = factory.deploy(exchg_data)
45
62
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
46
63
  lp.summary()
47
64
 
48
65
 
49
66
  #OUTPUT:
50
- Exchange ETH-DAI (LP)
51
- Reserves: ETH = 1000, DAI = 1000000
67
+ Exchange ETH-DAI (LP)
68
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
52
69
  Liquidity: 31622.776601683792
70
+
71
+ Uniswap V3 Example
72
+ --------------------------
73
+
74
+ from defipy import *
75
+
76
+ user = 'user_intro'
77
+ fee = UniV3Utils.FeeAmount.MEDIUM
78
+ tick_spacing = UniV3Utils.TICK_SPACINGS[fee]
79
+ lwr_tick = UniV3Utils.getMinTick(tick_spacing)
80
+ upr_tick = UniV3Utils.getMaxTick(tick_spacing)
81
+ init_price = UniV3Utils.encodePriceSqrt(100, 1)
82
+
83
+ dai = ERC20("DAI", "0x09")
84
+ eth = ERC20("ETH", "0x111")
85
+
86
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
87
+ address="0x011", version = 'V3',
88
+ tick_spacing = tick_spacing,
89
+ fee = fee)
90
+
91
+ factory = UniswapFactory("ETH pool factory", "0x2")
92
+ lp = factory.deploy(exchg_data)
93
+ lp.initialize(init_price)
94
+ out = lp.mint(user, lwr_tick, upr_tick, 31622.776601683792)
95
+ lp.summary()
96
+
97
+ Exchange ETH-DAI (LP)
98
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
99
+ Liquidity: 31622.776601683792
53
100
 
54
101
  Balancer Example
55
102
  --------------------------
@@ -1,16 +1,4 @@
1
- Metadata-Version: 2.1
2
- Name: DeFiPy
3
- Version: 0.0.18
4
- Summary: DeFi Analytics with Python
5
- Home-page: http://github.com/defipy-devs/defipy
6
- Author: icmoore
7
- Author-email: defipy.devs@gmail.com
8
- License: MIT
9
- Platform: UNKNOWN
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE.txt
12
-
13
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
1
+ # DeFiPy: DeFi Analytics with Python (v 0.0.20)
14
2
 
15
3
  Welcome to the worlds first DeFi Python package with all major protocols intergrated into one package! Implement your analytics in one package with DeFiPy. Since DeFiPy is built with a modular design in mind, your can also silo your analytics by protocol
16
4
  using:
@@ -36,7 +24,7 @@ or
36
24
  > pip install defipy
37
25
  ```
38
26
 
39
- Uniswap Example
27
+ Uniswap V2 Example
40
28
  --------------------------
41
29
 
42
30
  To setup a liquidity pool, you must first create the tokens in the pair using the `ERC20` object. Next, create a liquidity pool (LP) factory using `IFactory` object. Once this is setup, an unlimited amount of LPs can be created; the procedures for such are as follows:
@@ -45,23 +33,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
45
33
  from defipy import *
46
34
 
47
35
  user_nm = 'user_intro'
48
- eth_amount = 1000
49
- dai_amount = 1000000
50
-
51
- dai = ERC20("DAI", "0x01")
52
- eth = ERC20("ETH", "0x02")
36
+ eth_amount = 3162.277660168379
37
+ dai_amount = 316227.7660168379
53
38
 
54
- factory = UniswapFactory("ETH pool factory", "0x")
55
- exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP", address="0x11")
39
+ dai = ERC20("DAI", "0x111")
40
+ eth = ERC20("ETH", "0x09")
41
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
42
+ address="0x011")
43
+
44
+ factory = UniswapFactory("ETH pool factory", "0x2")
56
45
  lp = factory.deploy(exchg_data)
57
46
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
58
47
  lp.summary()
59
48
 
60
49
 
61
50
  #OUTPUT:
62
- Exchange ETH-DAI (LP)
63
- Reserves: ETH = 1000, DAI = 1000000
51
+ Exchange ETH-DAI (LP)
52
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
64
53
  Liquidity: 31622.776601683792
54
+
55
+ Uniswap V3 Example
56
+ --------------------------
57
+
58
+ from defipy import *
59
+
60
+ user = 'user_intro'
61
+ fee = UniV3Utils.FeeAmount.MEDIUM
62
+ tick_spacing = UniV3Utils.TICK_SPACINGS[fee]
63
+ lwr_tick = UniV3Utils.getMinTick(tick_spacing)
64
+ upr_tick = UniV3Utils.getMaxTick(tick_spacing)
65
+ init_price = UniV3Utils.encodePriceSqrt(100, 1)
66
+
67
+ dai = ERC20("DAI", "0x09")
68
+ eth = ERC20("ETH", "0x111")
69
+
70
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
71
+ address="0x011", version = 'V3',
72
+ tick_spacing = tick_spacing,
73
+ fee = fee)
74
+
75
+ factory = UniswapFactory("ETH pool factory", "0x2")
76
+ lp = factory.deploy(exchg_data)
77
+ lp.initialize(init_price)
78
+ out = lp.mint(user, lwr_tick, upr_tick, 31622.776601683792)
79
+ lp.summary()
80
+
81
+ Exchange ETH-DAI (LP)
82
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
83
+ Liquidity: 31622.776601683792
65
84
 
66
85
  Balancer Example
67
86
  --------------------------
@@ -161,5 +180,3 @@ Click [dashboard.defipy.org](https://dashboard.defipy.org/) for live link; for m
161
180
  ```
162
181
  > bokeh serve --show python/application/quant_terminal/bokeh_server.py
163
182
  ```
164
-
165
-
@@ -11,10 +11,12 @@ from defipy.process.deposit import *
11
11
  from defipy.process.liquidity import *
12
12
  from defipy.process.mint import *
13
13
  from defipy.process.swap import *
14
+ from defipy.process.join import *
14
15
  from defipy.simulate import *
15
16
  from defipy.utils.interfaces import *
16
17
  from defipy.utils.data import *
17
18
  from defipy.utils.client import *
19
+ from defipy.utils.tools.v3 import *
18
20
 
19
21
  from uniswappy.cpt.exchg import *
20
22
  from uniswappy.cpt.factory import *
@@ -0,0 +1 @@
1
+ from uniswappy.process.join import *
@@ -0,0 +1 @@
1
+ from uniswappy.utils.tools.v3 import *
@@ -4,7 +4,7 @@ with open('README.md') as f:
4
4
  long_description = f.read()
5
5
 
6
6
  setup(name='DeFiPy',
7
- version='0.0.18',
7
+ version='0.0.20',
8
8
  description='DeFi Analytics with Python',
9
9
  long_description=long_description,
10
10
  long_description_content_type="text/markdown",
@@ -28,15 +28,17 @@ setup(name='DeFiPy',
28
28
  'defipy.process.liquidity',
29
29
  'defipy.process.mint',
30
30
  'defipy.process.swap',
31
+ 'defipy.process.join',
31
32
  'defipy.simulate',
32
33
  'defipy.utils.interfaces',
33
34
  'defipy.utils.data',
34
- 'defipy.utils.client'
35
+ 'defipy.utils.client',
36
+ 'defipy.utils.tools.v3'
35
37
  ],
36
38
  install_requires=[
37
39
  'scipy >= 1.7.3',
38
40
  'bokeh == 3.3.4',
39
- 'uniswappy == 1.2.0',
41
+ 'uniswappy == 1.4.0',
40
42
  'stableswappy == 0.0.11',
41
43
  'balancerpy == 0.0.9'
42
44
  ],
File without changes
File without changes