wayfinder-paths 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl

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.

Potentially problematic release.


This version of wayfinder-paths might be problematic. Click here for more details.

@@ -5,6 +5,7 @@ __version__ = "0.1.0"
5
5
  # Re-export commonly used items for convenience
6
6
  from wayfinder_paths.core import (
7
7
  BaseAdapter,
8
+ LiquidationResult,
8
9
  StatusDict,
9
10
  StatusTuple,
10
11
  Strategy,
@@ -2,7 +2,12 @@
2
2
 
3
3
  from wayfinder_paths.core.adapters.BaseAdapter import BaseAdapter
4
4
  from wayfinder_paths.core.engine.StrategyJob import StrategyJob
5
- from wayfinder_paths.core.strategies.Strategy import StatusDict, StatusTuple, Strategy
5
+ from wayfinder_paths.core.strategies.Strategy import (
6
+ LiquidationResult,
7
+ StatusDict,
8
+ StatusTuple,
9
+ Strategy,
10
+ )
6
11
 
7
12
  __all__ = [
8
13
  "Strategy",
@@ -8,6 +8,7 @@ from typing import Any, TypedDict
8
8
 
9
9
  from loguru import logger
10
10
 
11
+ from wayfinder_paths.core.clients.TokenClient import TokenDetails
11
12
  from wayfinder_paths.core.services.base import Web3Service
12
13
  from wayfinder_paths.core.strategies.descriptors import StratDescriptor
13
14
 
@@ -40,6 +41,12 @@ class StrategyConfig(TypedDict, total=False):
40
41
  wallet_type: str | None
41
42
 
42
43
 
44
+ class LiquidationResult(TypedDict):
45
+ usd_value: float
46
+ token: TokenDetails
47
+ amt: int
48
+
49
+
43
50
  class Strategy(ABC):
44
51
  name: str | None = None
45
52
  INFO: StratDescriptor | None = None
@@ -173,6 +180,8 @@ class Strategy(ABC):
173
180
  strategy_status=status,
174
181
  )
175
182
 
183
+ return status
184
+
176
185
  def register_adapters(self, adapters: list[Any]) -> None:
177
186
  """Register adapters for use by the strategy"""
178
187
  self.adapters = {}
@@ -246,7 +255,9 @@ class Strategy(ABC):
246
255
 
247
256
  return health
248
257
 
249
- async def partial_liquidate(self, usd_value: float) -> StatusTuple:
258
+ async def partial_liquidate(
259
+ self, usd_value: float
260
+ ) -> tuple[bool, LiquidationResult]:
250
261
  """
251
262
  Partially liquidate strategy positions by USD value.
252
263
  Optional method that can be overridden by subclasses.
@@ -42,6 +42,7 @@ DEFAULT_TOKEN_REWARDS = [
42
42
  "name": "B3",
43
43
  "address": "0xB3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3",
44
44
  "image_url": "https://storage.googleapis.com/prod-wayfinder-app-assets/asset-icons/B3.png",
45
+ "chain_id": 8453,
45
46
  },
46
47
  ]
47
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wayfinder-paths
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Wayfinder Path: strategies and adapters
5
5
  Author: Wayfinder
6
6
  Author-email: dev@wayfinder.ai
@@ -1,5 +1,5 @@
1
1
  wayfinder_paths/CONFIG_GUIDE.md,sha256=PN2ClAZ8FCF16_sstaUxbfvQkVAyXdtRvTrrj-qJPuk,13397
2
- wayfinder_paths/__init__.py,sha256=JKuLfydWVBIb3fH9o-KBdEdq_7nLt0jAq2y4Al7veMU,404
2
+ wayfinder_paths/__init__.py,sha256=YgOg-PRPT3ROh0zg6hgQyQE-YFkFGw6TM77zDvB4_sE,427
3
3
  wayfinder_paths/abis/generic/erc20.json,sha256=geyzVzdTNt3u1XHKxi4seszP_GIWIzPTl0FYgiftRnM,9336
4
4
  wayfinder_paths/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  wayfinder_paths/adapters/balance_adapter/README.md,sha256=g5LXIJ-_6mM6FRwvEJp3jLJeUXfHxauiNRfnYRhJbps,4046
@@ -37,7 +37,7 @@ wayfinder_paths/adapters/token_adapter/manifest.yaml,sha256=KQgbHAUaJ6JYjTlOJ9HG
37
37
  wayfinder_paths/adapters/token_adapter/test_adapter.py,sha256=xnJ-nglMnCFqYnH9D-xcnIy-pmPZK6_puNZ9hPthIMI,4701
38
38
  wayfinder_paths/config.example.json,sha256=gDvS7W-cbaNe2IV7Q72di_PYpCDKODojELaXdd77Gx4,605
39
39
  wayfinder_paths/conftest.py,sha256=pqDNijXn9_zmbAdkt_2a18UQLjtsDkNTBJVTgC6H2nA,1136
40
- wayfinder_paths/core/__init__.py,sha256=tcpxajbeBGbxFDtI5N05BOV7cMzduuwRbKh3O-DjiRI,358
40
+ wayfinder_paths/core/__init__.py,sha256=AJK8oS2dCVuJ2pmSxqXOCvuWacNaVEU3yALEqsD3rog,398
41
41
  wayfinder_paths/core/adapters/BaseAdapter.py,sha256=bzc3ER7aKOsmk9cxyoJxGdI54eibbpcMC8nGYJUrsp0,2033
42
42
  wayfinder_paths/core/adapters/__init__.py,sha256=ZqzkliXm5RjWxYJyJR88XHb3npZFiThk7HoVZe3JF60,108
43
43
  wayfinder_paths/core/adapters/base.py,sha256=j10cZ5NwqaAhN2mH_j24tG8r7_7NWtx8F6S7sJ9wOi8,100
@@ -70,10 +70,10 @@ wayfinder_paths/core/services/local_evm_txn.py,sha256=n0LJOH9-Gy9JDjMvz16Lk1PD9g
70
70
  wayfinder_paths/core/services/local_token_txn.py,sha256=S9RJq2_fm1sqmJmn83vMo69-GQLeCkQ-20rrv0ezU1g,8049
71
71
  wayfinder_paths/core/services/web3_service.py,sha256=_8sEpkWzSzp7dQR5OCwScypyOsEv5s2BeuO8TqB_H-w,1558
72
72
  wayfinder_paths/core/settings.py,sha256=VqNOU84OsX_6KAWr9JdPfyxtV14yTH1uZl2zuKeiJ3g,1921
73
- wayfinder_paths/core/strategies/Strategy.py,sha256=eGgiILhtqk2-AsAFW3i3basDKn1F_K-datITW66DeEQ,9281
73
+ wayfinder_paths/core/strategies/Strategy.py,sha256=7Fn29fhCW3TJ1rJnWJHd4e5ndeDfFjNbeAgAazAynUs,9499
74
74
  wayfinder_paths/core/strategies/__init__.py,sha256=2NjvvDw6sIQGUFV4Qo1olXTxUOY3GmCM8Ivz_J1FSmc,157
75
75
  wayfinder_paths/core/strategies/base.py,sha256=-s0qeiGZl5CHTUL2PavGXM7ACkNlaa0c4jeZR_4DuBM,155
76
- wayfinder_paths/core/strategies/descriptors.py,sha256=yZ9vnaZo5xYUpHfdJTumxYdDkIY8odp2fiezf_v0Cro,1622
76
+ wayfinder_paths/core/strategies/descriptors.py,sha256=E8vi7ssaj6rglKVp1xl4PlUlJYLSoayXkTzsPb78vrs,1648
77
77
  wayfinder_paths/core/utils/__init__.py,sha256=TEylMYHnG37Z3mizSmw28bUm0vyNBFzf0Nc8dB_7l1A,73
78
78
  wayfinder_paths/core/utils/evm_helpers.py,sha256=sJUGpwbc3jD9h1BaaYC4mPDs25S3YKyoY1NfvHq9BBg,6491
79
79
  wayfinder_paths/core/utils/wallets.py,sha256=tGgVxDW2ZvkvJIb6yow1cirrqhQ67_X9IqxZocBEy2k,2438
@@ -120,7 +120,7 @@ wayfinder_paths/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
120
120
  wayfinder_paths/tests/test_smoke_manifest.py,sha256=YjVzHTWys5o6Ae2cUuuJPhk-QgKxT1InDFHLjpouRiY,1267
121
121
  wayfinder_paths/tests/test_test_coverage.py,sha256=9NrZeVmP02D4W7Qc0XjciC05bhvdTCVibYjTGfa_GQk,7893
122
122
  wayfinder_paths/tests/test_utils.py,sha256=pxHT0QKFlyJeJo8bFnKXzWcOdi6t8rbJ0JFCBaFCBRQ,2112
123
- wayfinder_paths-0.1.5.dist-info/LICENSE,sha256=dYKnlkC_xosBAEQNUvB6cHMuhFgcUtN0oBR7E8_aR2Y,1066
124
- wayfinder_paths-0.1.5.dist-info/METADATA,sha256=RcIPhwnOY1-nifh2nPVoUHWeo1b1lYyZDULOZ-nWVbg,31321
125
- wayfinder_paths-0.1.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
126
- wayfinder_paths-0.1.5.dist-info/RECORD,,
123
+ wayfinder_paths-0.1.6.dist-info/LICENSE,sha256=dYKnlkC_xosBAEQNUvB6cHMuhFgcUtN0oBR7E8_aR2Y,1066
124
+ wayfinder_paths-0.1.6.dist-info/METADATA,sha256=la0fKZVElWMOQkPIfI-0nXUfsy3LmmsTJ4dqAC_CS9A,31321
125
+ wayfinder_paths-0.1.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
126
+ wayfinder_paths-0.1.6.dist-info/RECORD,,