DeFiPy 0.0.18__tar.gz → 0.0.19__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 (30) hide show
  1. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/PKG-INFO +43 -12
  2. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/SOURCES.txt +2 -1
  3. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/requires.txt +1 -1
  4. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/PKG-INFO +43 -12
  5. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/README.md +42 -11
  6. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/__init__.py +1 -0
  7. DeFiPy-0.0.19/python/prod/utils/tools/v3/__init__.py +1 -0
  8. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/setup.py +4 -3
  9. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/dependency_links.txt +0 -0
  10. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/not-zip-safe +0 -0
  11. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/DeFiPy.egg-info/top_level.txt +0 -0
  12. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/LICENSE.txt +0 -0
  13. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/erc/__init__.py +0 -0
  14. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/basic/__init__.py +0 -0
  15. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/interest/__init__.py +0 -0
  16. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/interest/ips/__init__.py +0 -0
  17. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/interest/ips/aggregate/__init__.py +0 -0
  18. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/model/__init__.py +0 -0
  19. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/math/risk/__init__.py +0 -0
  20. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/__init__.py +0 -0
  21. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/burn/__init__.py +0 -0
  22. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/deposit/__init__.py +0 -0
  23. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/liquidity/__init__.py +0 -0
  24. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/mint/__init__.py +0 -0
  25. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/process/swap/__init__.py +0 -0
  26. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/simulate/__init__.py +0 -0
  27. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/utils/client/__init__.py +0 -0
  28. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/utils/data/__init__.py +0 -0
  29. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/python/prod/utils/interfaces/__init__.py +0 -0
  30. {DeFiPy-0.0.18 → DeFiPy-0.0.19}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DeFiPy
3
- Version: 0.0.18
3
+ Version: 0.0.19
4
4
  Summary: DeFi Analytics with Python
5
5
  Home-page: http://github.com/defipy-devs/defipy
6
6
  Author: icmoore
@@ -10,7 +10,7 @@ Platform: UNKNOWN
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE.txt
12
12
 
13
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
13
+ # DeFiPy: DeFi Analytics with Python (v 0.0.19)
14
14
 
15
15
  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
16
  using:
@@ -36,7 +36,7 @@ or
36
36
  > pip install defipy
37
37
  ```
38
38
 
39
- Uniswap Example
39
+ Uniswap V2 Example
40
40
  --------------------------
41
41
 
42
42
  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 +45,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
45
45
  from defipy import *
46
46
 
47
47
  user_nm = 'user_intro'
48
- eth_amount = 1000
49
- dai_amount = 1000000
50
-
51
- dai = ERC20("DAI", "0x01")
52
- eth = ERC20("ETH", "0x02")
48
+ eth_amount = 3162.277660168379
49
+ dai_amount = 316227.7660168379
53
50
 
54
- factory = UniswapFactory("ETH pool factory", "0x")
55
- exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP", address="0x11")
51
+ dai = ERC20("DAI", "0x111")
52
+ eth = ERC20("ETH", "0x09")
53
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
54
+ address="0x011")
55
+
56
+ factory = UniswapFactory("ETH pool factory", "0x2")
56
57
  lp = factory.deploy(exchg_data)
57
58
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
58
59
  lp.summary()
59
60
 
60
61
 
61
62
  #OUTPUT:
62
- Exchange ETH-DAI (LP)
63
- Reserves: ETH = 1000, DAI = 1000000
63
+ Exchange ETH-DAI (LP)
64
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
64
65
  Liquidity: 31622.776601683792
66
+
67
+ Uniswap V3 Example
68
+ --------------------------
69
+
70
+ from defipy import *
71
+
72
+ user = 'user_intro'
73
+ fee = UniV3Utils.FeeAmount.MEDIUM
74
+ tick_spacing = UniV3Utils.TICK_SPACINGS[fee]
75
+ lwr_tick = UniV3Utils.getMinTick(tick_spacing)
76
+ upr_tick = UniV3Utils.getMaxTick(tick_spacing)
77
+ init_price = UniV3Utils.encodePriceSqrt(100, 1)
78
+
79
+ dai = ERC20("DAI", "0x09")
80
+ eth = ERC20("ETH", "0x111")
81
+
82
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
83
+ address="0x011", version = 'V3',
84
+ tick_spacing = tick_spacing,
85
+ fee = fee)
86
+
87
+ factory = UniswapFactory("ETH pool factory", "0x2")
88
+ lp = factory.deploy(exchg_data)
89
+ lp.initialize(init_price)
90
+ out = lp.mint(user, lwr_tick, upr_tick, 31622.776601683792)
91
+ lp.summary()
92
+
93
+ Exchange ETH-DAI (LP)
94
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
95
+ Liquidity: 31622.776601683792
65
96
 
66
97
  Balancer Example
67
98
  --------------------------
@@ -31,4 +31,5 @@ python/prod/process/swap/__init__.py
31
31
  python/prod/simulate/__init__.py
32
32
  python/prod/utils/client/__init__.py
33
33
  python/prod/utils/data/__init__.py
34
- python/prod/utils/interfaces/__init__.py
34
+ python/prod/utils/interfaces/__init__.py
35
+ 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.3.0
4
4
  stableswappy==0.0.11
5
5
  balancerpy==0.0.9
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DeFiPy
3
- Version: 0.0.18
3
+ Version: 0.0.19
4
4
  Summary: DeFi Analytics with Python
5
5
  Home-page: http://github.com/defipy-devs/defipy
6
6
  Author: icmoore
@@ -10,7 +10,7 @@ Platform: UNKNOWN
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE.txt
12
12
 
13
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
13
+ # DeFiPy: DeFi Analytics with Python (v 0.0.19)
14
14
 
15
15
  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
16
  using:
@@ -36,7 +36,7 @@ or
36
36
  > pip install defipy
37
37
  ```
38
38
 
39
- Uniswap Example
39
+ Uniswap V2 Example
40
40
  --------------------------
41
41
 
42
42
  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 +45,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
45
45
  from defipy import *
46
46
 
47
47
  user_nm = 'user_intro'
48
- eth_amount = 1000
49
- dai_amount = 1000000
50
-
51
- dai = ERC20("DAI", "0x01")
52
- eth = ERC20("ETH", "0x02")
48
+ eth_amount = 3162.277660168379
49
+ dai_amount = 316227.7660168379
53
50
 
54
- factory = UniswapFactory("ETH pool factory", "0x")
55
- exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP", address="0x11")
51
+ dai = ERC20("DAI", "0x111")
52
+ eth = ERC20("ETH", "0x09")
53
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
54
+ address="0x011")
55
+
56
+ factory = UniswapFactory("ETH pool factory", "0x2")
56
57
  lp = factory.deploy(exchg_data)
57
58
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
58
59
  lp.summary()
59
60
 
60
61
 
61
62
  #OUTPUT:
62
- Exchange ETH-DAI (LP)
63
- Reserves: ETH = 1000, DAI = 1000000
63
+ Exchange ETH-DAI (LP)
64
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
64
65
  Liquidity: 31622.776601683792
66
+
67
+ Uniswap V3 Example
68
+ --------------------------
69
+
70
+ from defipy import *
71
+
72
+ user = 'user_intro'
73
+ fee = UniV3Utils.FeeAmount.MEDIUM
74
+ tick_spacing = UniV3Utils.TICK_SPACINGS[fee]
75
+ lwr_tick = UniV3Utils.getMinTick(tick_spacing)
76
+ upr_tick = UniV3Utils.getMaxTick(tick_spacing)
77
+ init_price = UniV3Utils.encodePriceSqrt(100, 1)
78
+
79
+ dai = ERC20("DAI", "0x09")
80
+ eth = ERC20("ETH", "0x111")
81
+
82
+ exchg_data = UniswapExchangeData(tkn0 = eth, tkn1 = dai, symbol="LP",
83
+ address="0x011", version = 'V3',
84
+ tick_spacing = tick_spacing,
85
+ fee = fee)
86
+
87
+ factory = UniswapFactory("ETH pool factory", "0x2")
88
+ lp = factory.deploy(exchg_data)
89
+ lp.initialize(init_price)
90
+ out = lp.mint(user, lwr_tick, upr_tick, 31622.776601683792)
91
+ lp.summary()
92
+
93
+ Exchange ETH-DAI (LP)
94
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
95
+ Liquidity: 31622.776601683792
65
96
 
66
97
  Balancer Example
67
98
  --------------------------
@@ -1,4 +1,4 @@
1
- '# DeFiPy: DeFi Analytics with Python (v 0.0.18)
1
+ # DeFiPy: DeFi Analytics with Python (v 0.0.19)
2
2
 
3
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
4
4
  using:
@@ -24,7 +24,7 @@ or
24
24
  > pip install defipy
25
25
  ```
26
26
 
27
- Uniswap Example
27
+ Uniswap V2 Example
28
28
  --------------------------
29
29
 
30
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:
@@ -33,23 +33,54 @@ To setup a liquidity pool, you must first create the tokens in the pair using th
33
33
  from defipy import *
34
34
 
35
35
  user_nm = 'user_intro'
36
- eth_amount = 1000
37
- dai_amount = 1000000
38
-
39
- dai = ERC20("DAI", "0x01")
40
- eth = ERC20("ETH", "0x02")
36
+ eth_amount = 3162.277660168379
37
+ dai_amount = 316227.7660168379
41
38
 
42
- factory = UniswapFactory("ETH pool factory", "0x")
43
- 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")
44
45
  lp = factory.deploy(exchg_data)
45
46
  lp.add_liquidity("user0", eth_amount, dai_amount, eth_amount, dai_amount)
46
47
  lp.summary()
47
48
 
48
49
 
49
50
  #OUTPUT:
50
- Exchange ETH-DAI (LP)
51
- Reserves: ETH = 1000, DAI = 1000000
51
+ Exchange ETH-DAI (LP)
52
+ Reserves: ETH = 3162.277660168379, DAI = 316227.7660168379
52
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
53
84
 
54
85
  Balancer Example
55
86
  --------------------------
@@ -15,6 +15,7 @@ from defipy.simulate import *
15
15
  from defipy.utils.interfaces import *
16
16
  from defipy.utils.data import *
17
17
  from defipy.utils.client import *
18
+ from defipy.utils.tools.v3 import *
18
19
 
19
20
  from uniswappy.cpt.exchg import *
20
21
  from uniswappy.cpt.factory 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.19',
8
8
  description='DeFi Analytics with Python',
9
9
  long_description=long_description,
10
10
  long_description_content_type="text/markdown",
@@ -31,12 +31,13 @@ setup(name='DeFiPy',
31
31
  'defipy.simulate',
32
32
  'defipy.utils.interfaces',
33
33
  'defipy.utils.data',
34
- 'defipy.utils.client'
34
+ 'defipy.utils.client',
35
+ 'defipy.utils.tools.v3'
35
36
  ],
36
37
  install_requires=[
37
38
  'scipy >= 1.7.3',
38
39
  'bokeh == 3.3.4',
39
- 'uniswappy == 1.2.0',
40
+ 'uniswappy == 1.3.0',
40
41
  'stableswappy == 0.0.11',
41
42
  'balancerpy == 0.0.9'
42
43
  ],
File without changes
File without changes