DeFiPy 1.0.7__tar.gz → 1.0.8__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.
- {defipy-1.0.7 → defipy-1.0.8}/DeFiPy.egg-info/PKG-INFO +12 -5
- {defipy-1.0.7 → defipy-1.0.8}/DeFiPy.egg-info/SOURCES.txt +5 -0
- defipy-1.0.8/DeFiPy.egg-info/requires.txt +6 -0
- defipy-1.0.8/NOTICE +16 -0
- {defipy-1.0.7 → defipy-1.0.8}/PKG-INFO +12 -5
- {defipy-1.0.7 → defipy-1.0.8}/README.md +6 -1
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/__init__.py +4 -0
- defipy-1.0.8/python/prod/agents/PriceThresholdSwapAgent.py +56 -0
- defipy-1.0.8/python/prod/agents/__init__.py +1 -0
- defipy-1.0.8/python/prod/agents/config/PriceThresholdConfig.py +30 -0
- defipy-1.0.8/python/prod/agents/config/__init__.py +1 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/join/Join.py +3 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/liquidity/AddLiquidity.py +3 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/liquidity/RemoveLiquidity.py +3 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/swap/Swap.py +3 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/client/contract/ExecuteScript.py +16 -2
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/tools/UniswapScriptHelper.py +16 -2
- {defipy-1.0.7 → defipy-1.0.8}/setup.py +8 -5
- defipy-1.0.7/DeFiPy.egg-info/requires.txt +0 -5
- {defipy-1.0.7 → defipy-1.0.8}/DeFiPy.egg-info/dependency_links.txt +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/DeFiPy.egg-info/not-zip-safe +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/DeFiPy.egg-info/top_level.txt +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/LICENSE +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/analytics/risk/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/analytics/simulate/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/erc/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/basic/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/interest/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/interest/ips/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/interest/ips/aggregate/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/model/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/math/risk/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/burn/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/deposit/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/join/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/liquidity/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/mint/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/process/swap/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/client/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/client/contract/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/data/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/interfaces/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/tools/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/python/prod/utils/tools/v3/__init__.py +0 -0
- {defipy-1.0.7 → defipy-1.0.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DeFiPy
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Python SDK for DeFi Analytics, Simulation, and Agents
|
|
5
5
|
Home-page: http://github.com/defipy-devs/defipy
|
|
6
6
|
Author: icmoore
|
|
@@ -15,11 +15,13 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
|
15
15
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE
|
|
18
19
|
Requires-Dist: scipy>=1.7.3
|
|
20
|
+
Requires-Dist: pydantic>=2.11.0
|
|
19
21
|
Requires-Dist: bokeh==3.3.4
|
|
20
|
-
Requires-Dist: uniswappy
|
|
21
|
-
Requires-Dist: stableswappy
|
|
22
|
-
Requires-Dist: balancerpy
|
|
22
|
+
Requires-Dist: uniswappy>=1.7.4
|
|
23
|
+
Requires-Dist: stableswappy>=1.0.3
|
|
24
|
+
Requires-Dist: balancerpy>=1.0.4
|
|
23
25
|
|
|
24
26
|
# DeFiPy: Python SDK for DeFi Analytics and Agents
|
|
25
27
|
|
|
@@ -227,4 +229,9 @@ Click [dashboard.defipy.org](https://dashboard.defipy.org/) for live link; for m
|
|
|
227
229
|
|
|
228
230
|
```
|
|
229
231
|
> bokeh serve --show python/application/quant_terminal/bokeh_server.py
|
|
230
|
-
```
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## License
|
|
235
|
+
Licensed under the Apache License, Version 2.0.
|
|
236
|
+
See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for details.
|
|
237
|
+
Portions of this project may include code from third-party projects under compatible open-source licenses.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
LICENSE
|
|
2
|
+
NOTICE
|
|
2
3
|
README.md
|
|
3
4
|
setup.cfg
|
|
4
5
|
setup.py
|
|
@@ -15,6 +16,10 @@ defipy.egg-info/not-zip-safe
|
|
|
15
16
|
defipy.egg-info/requires.txt
|
|
16
17
|
defipy.egg-info/top_level.txt
|
|
17
18
|
python/prod/__init__.py
|
|
19
|
+
python/prod/agents/PriceThresholdSwapAgent.py
|
|
20
|
+
python/prod/agents/__init__.py
|
|
21
|
+
python/prod/agents/config/PriceThresholdConfig.py
|
|
22
|
+
python/prod/agents/config/__init__.py
|
|
18
23
|
python/prod/analytics/risk/__init__.py
|
|
19
24
|
python/prod/analytics/simulate/__init__.py
|
|
20
25
|
python/prod/erc/__init__.py
|
defipy-1.0.8/NOTICE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
This software includes code developed by the DeFiPy contributors (https://defipy.org)
|
|
2
|
+
|
|
3
|
+
Copyright 2023–2025 DeFiPy contributors
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
|
|
15
|
+
We kindly request that if you use DeFiPy in your project, you credit us by
|
|
16
|
+
retaining this notice and optionally linking to https://defipy.org.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DeFiPy
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Python SDK for DeFi Analytics, Simulation, and Agents
|
|
5
5
|
Home-page: http://github.com/defipy-devs/defipy
|
|
6
6
|
Author: icmoore
|
|
@@ -15,11 +15,13 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
|
15
15
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE
|
|
18
19
|
Requires-Dist: scipy>=1.7.3
|
|
20
|
+
Requires-Dist: pydantic>=2.11.0
|
|
19
21
|
Requires-Dist: bokeh==3.3.4
|
|
20
|
-
Requires-Dist: uniswappy
|
|
21
|
-
Requires-Dist: stableswappy
|
|
22
|
-
Requires-Dist: balancerpy
|
|
22
|
+
Requires-Dist: uniswappy>=1.7.4
|
|
23
|
+
Requires-Dist: stableswappy>=1.0.3
|
|
24
|
+
Requires-Dist: balancerpy>=1.0.4
|
|
23
25
|
|
|
24
26
|
# DeFiPy: Python SDK for DeFi Analytics and Agents
|
|
25
27
|
|
|
@@ -227,4 +229,9 @@ Click [dashboard.defipy.org](https://dashboard.defipy.org/) for live link; for m
|
|
|
227
229
|
|
|
228
230
|
```
|
|
229
231
|
> bokeh serve --show python/application/quant_terminal/bokeh_server.py
|
|
230
|
-
```
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## License
|
|
235
|
+
Licensed under the Apache License, Version 2.0.
|
|
236
|
+
See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for details.
|
|
237
|
+
Portions of this project may include code from third-party projects under compatible open-source licenses.
|
|
@@ -204,4 +204,9 @@ Click [dashboard.defipy.org](https://dashboard.defipy.org/) for live link; for m
|
|
|
204
204
|
|
|
205
205
|
```
|
|
206
206
|
> bokeh serve --show python/application/quant_terminal/bokeh_server.py
|
|
207
|
-
```
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
Licensed under the Apache License, Version 2.0.
|
|
211
|
+
See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for details.
|
|
212
|
+
Portions of this project may include code from third-party projects under compatible open-source licenses.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# This file participates in a symbolic cognition substrate.
|
|
2
|
+
|
|
1
3
|
from defipy.erc import *
|
|
2
4
|
from defipy.math.basic import *
|
|
3
5
|
from defipy.math.interest import *
|
|
@@ -19,6 +21,8 @@ from defipy.utils.data import *
|
|
|
19
21
|
from defipy.utils.client import *
|
|
20
22
|
from defipy.utils.client.contract import *
|
|
21
23
|
from defipy.utils.tools import *
|
|
24
|
+
from defipy.agents.config import *
|
|
25
|
+
from defipy.agents import *
|
|
22
26
|
|
|
23
27
|
from uniswappy.cpt.exchg import *
|
|
24
28
|
from uniswappy.cpt.factory import *
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# # ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
# # Apache 2.0 License (DeFiPy)
|
|
3
|
+
# # ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
# # Copyright 2023–2025 Ian Moore
|
|
5
|
+
# # Email: defipy.devs@gmail.com
|
|
6
|
+
# #
|
|
7
|
+
# # Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# # you may not use this file except in compliance with the License.
|
|
9
|
+
# # You may obtain a copy of the License at
|
|
10
|
+
# #
|
|
11
|
+
# # http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
# #
|
|
13
|
+
# # Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# # distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# # See the License for the specific language governing permissions and
|
|
17
|
+
# # limitations under the License.
|
|
18
|
+
|
|
19
|
+
# from pydantic import BaseModel
|
|
20
|
+
# from ..process.swap import Swap
|
|
21
|
+
# from uniswappy.cpt.quote import LPQuote
|
|
22
|
+
# from web3scout.event.process.retrieve_events import RetrieveEvents
|
|
23
|
+
# from web3scout.utils.connect import ConnectW3
|
|
24
|
+
# from .config import PriceThresholdConfig
|
|
25
|
+
|
|
26
|
+
# class PriceThresholdSwapAgent:
|
|
27
|
+
# def __init__(self, config: PriceThresholdConfig):
|
|
28
|
+
# self.config = config
|
|
29
|
+
# self.abi = ABIload(self.config.abi_name, self.config.platform) # Load ABI here
|
|
30
|
+
# self.connector = ConnectW3(self.config.provider_url) # Web3Scout setup
|
|
31
|
+
# self.event_retriever = EventRetriever(self.connector, self.abi)
|
|
32
|
+
|
|
33
|
+
# def get_current_price(self):
|
|
34
|
+
# # Use DeFiPy for price quote (simulated or via reserves)
|
|
35
|
+
# quote = LPQuote() # Or fetch reserves via Web3Scout
|
|
36
|
+
# price = quote.get_price(self.config.token_in, self.config.token_out) # Adjust per docs
|
|
37
|
+
# return price
|
|
38
|
+
|
|
39
|
+
# def check_condition(self):
|
|
40
|
+
# price = self.get_current_price()
|
|
41
|
+
# if price > self.config.threshold:
|
|
42
|
+
# return True
|
|
43
|
+
# return False
|
|
44
|
+
|
|
45
|
+
# def execute_action(self):
|
|
46
|
+
# if self.check_condition():
|
|
47
|
+
# swap = Swap()
|
|
48
|
+
# # Trigger swap; integrate with DeFiPy's Swap.apply()
|
|
49
|
+
# print(f"Swapping {self.config.swap_amount} {self.config.token_in} for {self.config.token_out}")
|
|
50
|
+
# # Add actual swap logic here, e.g., via Web3Scout transaction
|
|
51
|
+
|
|
52
|
+
# def run(self):
|
|
53
|
+
# # Loop or event-driven: Poll every 60s or listen to Sync events
|
|
54
|
+
# events = self.event_retriever.get_events('Sync') # Web3Scout for feeds
|
|
55
|
+
# for event in events:
|
|
56
|
+
# self.execute_action() # Or use a while loop for polling
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# from .PriceThresholdSwapAgent import PriceThresholdSwapAgent
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# # ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
# # Apache 2.0 License (DeFiPy)
|
|
3
|
+
# # ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
# # Copyright 2023–2025 Ian Moore
|
|
5
|
+
# # Email: defipy.devs@gmail.com
|
|
6
|
+
# #
|
|
7
|
+
# # Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# # you may not use this file except in compliance with the License.
|
|
9
|
+
# # You may obtain a copy of the License at
|
|
10
|
+
# #
|
|
11
|
+
# # http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
# #
|
|
13
|
+
# # Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# # distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# # See the License for the specific language governing permissions and
|
|
17
|
+
# # limitations under the License.
|
|
18
|
+
|
|
19
|
+
# from pydantic import BaseModel
|
|
20
|
+
|
|
21
|
+
# class PriceThresholdConfig(BaseModel):
|
|
22
|
+
|
|
23
|
+
# token_in: str # e.g., "ETH"
|
|
24
|
+
# token_out: str # e.g., "USDC"
|
|
25
|
+
# threshold: float # e.g., 3000.0 (price above which to swap)
|
|
26
|
+
# swap_amount: float # Amount to swap when triggered
|
|
27
|
+
# pool_address: str # Uniswap pool
|
|
28
|
+
# provider_url: str # e.g., Infura for Web3Scout
|
|
29
|
+
# abi_name: str # e.g., 'UniswapV2Pair' (new field for ABI identifier)
|
|
30
|
+
# platform: str # e.g., 'UNI' or 'SUSHI' for the protocol
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# from .PriceThresholdConfig import PriceThresholdConfig
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
# Apache 2.0 License (DeFiPy)
|
|
3
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
# Copyright 2023–2025 Ian Moore
|
|
3
5
|
# Email: defipy.devs@gmail.com
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
4
18
|
|
|
5
19
|
import subprocess
|
|
6
20
|
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
# Apache 2.0 License (DeFiPy)
|
|
3
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
# Copyright 2023–2025 Ian Moore
|
|
3
5
|
# Email: defipy.devs@gmail.com
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
4
18
|
|
|
5
19
|
from uniswappy.utils.tools.v3 import UniV3Helper
|
|
6
20
|
from uniswappy.process.swap import WithdrawSwap
|
|
@@ -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='1.0.
|
|
7
|
+
version='1.0.8',
|
|
8
8
|
description='Python SDK for DeFi Analytics, Simulation, and Agents',
|
|
9
9
|
long_description=long_description,
|
|
10
10
|
long_description_content_type="text/markdown",
|
|
@@ -45,13 +45,16 @@ setup(name='DeFiPy',
|
|
|
45
45
|
'defipy.utils.client',
|
|
46
46
|
'defipy.utils.client.contract',
|
|
47
47
|
'defipy.utils.tools',
|
|
48
|
-
'defipy.utils.tools.v3'
|
|
48
|
+
'defipy.utils.tools.v3',
|
|
49
|
+
'defipy.agents.config',
|
|
50
|
+
'defipy.agents',
|
|
49
51
|
],
|
|
50
52
|
install_requires=[
|
|
51
53
|
'scipy >= 1.7.3',
|
|
54
|
+
'pydantic >= 2.11.0',
|
|
52
55
|
'bokeh == 3.3.4',
|
|
53
|
-
'uniswappy
|
|
54
|
-
'stableswappy
|
|
55
|
-
'balancerpy
|
|
56
|
+
'uniswappy >= 1.7.4',
|
|
57
|
+
'stableswappy >= 1.0.3',
|
|
58
|
+
'balancerpy >= 1.0.4'
|
|
56
59
|
],
|
|
57
60
|
zip_safe=False)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|