wayfinder-paths 0.1.22__py3-none-any.whl → 0.1.24__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.
- wayfinder_paths/__init__.py +0 -4
- wayfinder_paths/adapters/balance_adapter/README.md +0 -1
- wayfinder_paths/adapters/balance_adapter/adapter.py +313 -167
- wayfinder_paths/adapters/balance_adapter/manifest.yaml +8 -0
- wayfinder_paths/adapters/balance_adapter/test_adapter.py +41 -124
- wayfinder_paths/adapters/boros_adapter/__init__.py +17 -0
- wayfinder_paths/adapters/boros_adapter/adapter.py +1574 -0
- wayfinder_paths/adapters/boros_adapter/client.py +476 -0
- wayfinder_paths/adapters/boros_adapter/manifest.yaml +10 -0
- wayfinder_paths/adapters/boros_adapter/parsers.py +88 -0
- wayfinder_paths/adapters/boros_adapter/test_adapter.py +460 -0
- wayfinder_paths/adapters/boros_adapter/test_golden.py +156 -0
- wayfinder_paths/adapters/boros_adapter/types.py +70 -0
- wayfinder_paths/adapters/boros_adapter/utils.py +85 -0
- wayfinder_paths/adapters/brap_adapter/README.md +22 -75
- wayfinder_paths/adapters/brap_adapter/adapter.py +187 -576
- wayfinder_paths/adapters/brap_adapter/examples.json +21 -140
- wayfinder_paths/adapters/brap_adapter/manifest.yaml +9 -0
- wayfinder_paths/adapters/brap_adapter/test_adapter.py +6 -234
- wayfinder_paths/adapters/hyperlend_adapter/adapter.py +180 -92
- wayfinder_paths/adapters/hyperlend_adapter/manifest.yaml +9 -0
- wayfinder_paths/adapters/hyperlend_adapter/test_adapter.py +82 -14
- wayfinder_paths/adapters/hyperliquid_adapter/__init__.py +2 -9
- wayfinder_paths/adapters/hyperliquid_adapter/adapter.py +586 -61
- wayfinder_paths/adapters/hyperliquid_adapter/executor.py +47 -68
- wayfinder_paths/adapters/hyperliquid_adapter/manifest.yaml +14 -0
- wayfinder_paths/adapters/hyperliquid_adapter/paired_filler.py +2 -3
- wayfinder_paths/adapters/hyperliquid_adapter/test_adapter.py +17 -21
- wayfinder_paths/adapters/hyperliquid_adapter/test_adapter_live.py +3 -6
- wayfinder_paths/adapters/hyperliquid_adapter/test_executor.py +4 -8
- wayfinder_paths/adapters/hyperliquid_adapter/test_utils.py +2 -2
- wayfinder_paths/adapters/ledger_adapter/README.md +4 -1
- wayfinder_paths/adapters/ledger_adapter/adapter.py +3 -3
- wayfinder_paths/adapters/ledger_adapter/manifest.yaml +7 -0
- wayfinder_paths/adapters/ledger_adapter/test_adapter.py +1 -2
- wayfinder_paths/adapters/moonwell_adapter/adapter.py +649 -547
- wayfinder_paths/adapters/moonwell_adapter/manifest.yaml +14 -0
- wayfinder_paths/adapters/moonwell_adapter/test_adapter.py +160 -239
- wayfinder_paths/adapters/multicall_adapter/__init__.py +7 -0
- wayfinder_paths/adapters/multicall_adapter/adapter.py +166 -0
- wayfinder_paths/adapters/multicall_adapter/manifest.yaml +5 -0
- wayfinder_paths/adapters/multicall_adapter/test_adapter.py +97 -0
- wayfinder_paths/adapters/pendle_adapter/README.md +102 -0
- wayfinder_paths/adapters/pendle_adapter/__init__.py +7 -0
- wayfinder_paths/adapters/pendle_adapter/adapter.py +1992 -0
- wayfinder_paths/adapters/pendle_adapter/examples.json +11 -0
- wayfinder_paths/adapters/pendle_adapter/manifest.yaml +21 -0
- wayfinder_paths/adapters/pendle_adapter/test_adapter.py +666 -0
- wayfinder_paths/adapters/pool_adapter/manifest.yaml +6 -0
- wayfinder_paths/adapters/token_adapter/adapter.py +14 -0
- wayfinder_paths/adapters/token_adapter/examples.json +0 -4
- wayfinder_paths/adapters/token_adapter/manifest.yaml +7 -0
- wayfinder_paths/conftest.py +24 -17
- wayfinder_paths/core/__init__.py +0 -3
- wayfinder_paths/core/adapters/BaseAdapter.py +0 -25
- wayfinder_paths/core/adapters/models.py +17 -7
- wayfinder_paths/core/clients/BRAPClient.py +4 -1
- wayfinder_paths/core/clients/ClientManager.py +0 -7
- wayfinder_paths/core/clients/LedgerClient.py +196 -172
- wayfinder_paths/core/clients/TokenClient.py +47 -1
- wayfinder_paths/core/clients/WayfinderClient.py +1 -3
- wayfinder_paths/core/clients/__init__.py +0 -5
- wayfinder_paths/core/clients/protocols.py +21 -35
- wayfinder_paths/core/clients/test_ledger_client.py +448 -0
- wayfinder_paths/core/config.py +10 -162
- wayfinder_paths/core/constants/__init__.py +73 -2
- wayfinder_paths/core/constants/base.py +8 -17
- wayfinder_paths/core/constants/chains.py +36 -0
- wayfinder_paths/core/constants/contracts.py +52 -0
- wayfinder_paths/core/constants/erc20_abi.py +0 -1
- wayfinder_paths/core/constants/hyperlend_abi.py +0 -4
- wayfinder_paths/core/constants/hyperliquid.py +16 -0
- wayfinder_paths/core/constants/moonwell_abi.py +0 -15
- wayfinder_paths/core/constants/tokens.py +9 -0
- wayfinder_paths/core/engine/manifest.py +66 -0
- wayfinder_paths/core/strategies/Strategy.py +0 -71
- wayfinder_paths/core/strategies/__init__.py +10 -1
- wayfinder_paths/core/strategies/opa_loop.py +167 -0
- wayfinder_paths/core/utils/evm_helpers.py +5 -15
- wayfinder_paths/core/utils/test_transaction.py +289 -0
- wayfinder_paths/core/utils/tokens.py +28 -0
- wayfinder_paths/core/utils/transaction.py +57 -8
- wayfinder_paths/core/utils/web3.py +8 -3
- wayfinder_paths/mcp/__init__.py +5 -0
- wayfinder_paths/mcp/preview.py +185 -0
- wayfinder_paths/mcp/scripting.py +84 -0
- wayfinder_paths/mcp/server.py +52 -0
- wayfinder_paths/mcp/state/profile_store.py +195 -0
- wayfinder_paths/mcp/state/store.py +89 -0
- wayfinder_paths/mcp/test_scripting.py +267 -0
- wayfinder_paths/mcp/tools/__init__.py +0 -0
- wayfinder_paths/mcp/tools/balances.py +290 -0
- wayfinder_paths/mcp/tools/discovery.py +158 -0
- wayfinder_paths/mcp/tools/execute.py +770 -0
- wayfinder_paths/mcp/tools/hyperliquid.py +931 -0
- wayfinder_paths/mcp/tools/quotes.py +288 -0
- wayfinder_paths/mcp/tools/run_script.py +286 -0
- wayfinder_paths/mcp/tools/strategies.py +188 -0
- wayfinder_paths/mcp/tools/tokens.py +46 -0
- wayfinder_paths/mcp/tools/wallets.py +354 -0
- wayfinder_paths/mcp/utils.py +129 -0
- wayfinder_paths/policies/enso.py +1 -2
- wayfinder_paths/policies/hyper_evm.py +6 -3
- wayfinder_paths/policies/hyperlend.py +1 -2
- wayfinder_paths/policies/hyperliquid.py +1 -1
- wayfinder_paths/policies/lifi.py +18 -0
- wayfinder_paths/policies/moonwell.py +12 -7
- wayfinder_paths/policies/prjx.py +1 -3
- wayfinder_paths/policies/util.py +8 -2
- wayfinder_paths/run_strategy.py +97 -300
- wayfinder_paths/strategies/basis_trading_strategy/constants.py +3 -1
- wayfinder_paths/strategies/basis_trading_strategy/strategy.py +47 -133
- wayfinder_paths/strategies/basis_trading_strategy/test_strategy.py +24 -53
- wayfinder_paths/strategies/boros_hype_strategy/__init__.py +3 -0
- wayfinder_paths/strategies/boros_hype_strategy/boros_ops_mixin.py +450 -0
- wayfinder_paths/strategies/boros_hype_strategy/constants.py +255 -0
- wayfinder_paths/strategies/boros_hype_strategy/examples.json +37 -0
- wayfinder_paths/strategies/boros_hype_strategy/hyperevm_ops_mixin.py +114 -0
- wayfinder_paths/strategies/boros_hype_strategy/hyperliquid_ops_mixin.py +642 -0
- wayfinder_paths/strategies/boros_hype_strategy/manifest.yaml +36 -0
- wayfinder_paths/strategies/boros_hype_strategy/planner.py +460 -0
- wayfinder_paths/strategies/boros_hype_strategy/risk_ops_mixin.py +886 -0
- wayfinder_paths/strategies/boros_hype_strategy/snapshot_mixin.py +494 -0
- wayfinder_paths/strategies/boros_hype_strategy/strategy.py +1194 -0
- wayfinder_paths/strategies/boros_hype_strategy/test_planner_golden.py +374 -0
- wayfinder_paths/{templates/strategy → strategies/boros_hype_strategy}/test_strategy.py +99 -63
- wayfinder_paths/strategies/boros_hype_strategy/types.py +365 -0
- wayfinder_paths/strategies/boros_hype_strategy/withdraw_mixin.py +997 -0
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py +15 -23
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/test_strategy.py +27 -62
- wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/strategy.py +84 -58
- wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/test_strategy.py +5 -15
- wayfinder_paths/strategies/stablecoin_yield_strategy/strategy.py +69 -164
- wayfinder_paths/strategies/stablecoin_yield_strategy/test_strategy.py +43 -76
- wayfinder_paths/tests/test_mcp_quote_swap.py +165 -0
- wayfinder_paths/tests/test_test_coverage.py +1 -4
- wayfinder_paths-0.1.24.dist-info/METADATA +378 -0
- wayfinder_paths-0.1.24.dist-info/RECORD +185 -0
- {wayfinder_paths-0.1.22.dist-info → wayfinder_paths-0.1.24.dist-info}/WHEEL +1 -1
- wayfinder_paths/core/clients/WalletClient.py +0 -41
- wayfinder_paths/core/engine/StrategyJob.py +0 -110
- wayfinder_paths/core/services/test_local_evm_txn.py +0 -145
- wayfinder_paths/scripts/create_strategy.py +0 -139
- wayfinder_paths/scripts/make_wallets.py +0 -142
- wayfinder_paths/templates/adapter/README.md +0 -150
- wayfinder_paths/templates/adapter/adapter.py +0 -16
- wayfinder_paths/templates/adapter/examples.json +0 -8
- wayfinder_paths/templates/adapter/test_adapter.py +0 -30
- wayfinder_paths/templates/strategy/README.md +0 -186
- wayfinder_paths/templates/strategy/examples.json +0 -11
- wayfinder_paths/templates/strategy/strategy.py +0 -35
- wayfinder_paths/tests/test_smoke_manifest.py +0 -63
- wayfinder_paths-0.1.22.dist-info/METADATA +0 -355
- wayfinder_paths-0.1.22.dist-info/RECORD +0 -129
- /wayfinder_paths/{scripts → mcp/state}/__init__.py +0 -0
- {wayfinder_paths-0.1.22.dist-info → wayfinder_paths-0.1.24.dist-info}/LICENSE +0 -0
|
@@ -56,7 +56,6 @@ def strategy():
|
|
|
56
56
|
|
|
57
57
|
@pytest.fixture
|
|
58
58
|
def mock_adapter_responses(strategy):
|
|
59
|
-
# Mock balance adapter
|
|
60
59
|
strategy.balance_adapter.get_balance = AsyncMock(return_value=(True, 1000000))
|
|
61
60
|
strategy.balance_adapter.move_from_main_wallet_to_strategy_wallet = AsyncMock(
|
|
62
61
|
return_value=(True, "success")
|
|
@@ -65,7 +64,6 @@ def mock_adapter_responses(strategy):
|
|
|
65
64
|
return_value=(True, "success")
|
|
66
65
|
)
|
|
67
66
|
|
|
68
|
-
# Mock token adapter
|
|
69
67
|
strategy.token_adapter.get_token = AsyncMock(
|
|
70
68
|
return_value=(True, {"decimals": 18, "symbol": "TEST"})
|
|
71
69
|
)
|
|
@@ -73,7 +71,6 @@ def mock_adapter_responses(strategy):
|
|
|
73
71
|
return_value=(True, {"current_price": 1.0})
|
|
74
72
|
)
|
|
75
73
|
|
|
76
|
-
# Mock moonwell adapter
|
|
77
74
|
strategy.moonwell_adapter.get_pos = AsyncMock(
|
|
78
75
|
return_value=(
|
|
79
76
|
True,
|
|
@@ -102,7 +99,6 @@ def mock_adapter_responses(strategy):
|
|
|
102
99
|
strategy.moonwell_adapter.set_collateral = AsyncMock(return_value=(True, "success"))
|
|
103
100
|
strategy.moonwell_adapter.claim_rewards = AsyncMock(return_value={})
|
|
104
101
|
|
|
105
|
-
# Mock brap adapter
|
|
106
102
|
strategy.brap_adapter.swap_from_token_ids = AsyncMock(
|
|
107
103
|
return_value=(True, {"to_amount": 1000000000000000000})
|
|
108
104
|
)
|
|
@@ -116,8 +112,8 @@ async def test_smoke(strategy, mock_adapter_responses):
|
|
|
116
112
|
examples = load_strategy_examples(Path(__file__))
|
|
117
113
|
smoke_data = examples["smoke"]
|
|
118
114
|
|
|
119
|
-
# Mock
|
|
120
|
-
with patch.object(strategy, "
|
|
115
|
+
# Mock _quote to return positive APY
|
|
116
|
+
with patch.object(strategy, "_quote", new_callable=AsyncMock) as mock_quote:
|
|
121
117
|
mock_quote.return_value = {"apy": 0.1, "data": {}}
|
|
122
118
|
|
|
123
119
|
# Status test
|
|
@@ -166,7 +162,7 @@ async def test_canonical_usage(strategy, mock_adapter_responses):
|
|
|
166
162
|
|
|
167
163
|
for example_name, example_data in canonical.items():
|
|
168
164
|
# Mock methods for canonical usage tests
|
|
169
|
-
with patch.object(strategy, "
|
|
165
|
+
with patch.object(strategy, "_quote", new_callable=AsyncMock) as mock_quote:
|
|
170
166
|
mock_quote.return_value = {"apy": 0.1, "data": {}}
|
|
171
167
|
|
|
172
168
|
if "deposit" in example_data:
|
|
@@ -226,7 +222,7 @@ async def test_status_returns_status_dict(strategy, mock_adapter_responses):
|
|
|
226
222
|
) as mock_peg:
|
|
227
223
|
mock_peg.return_value = 0.001
|
|
228
224
|
with patch.object(
|
|
229
|
-
strategy, "
|
|
225
|
+
strategy, "_quote", new_callable=AsyncMock
|
|
230
226
|
) as mock_quote:
|
|
231
227
|
mock_quote.return_value = {"apy": 0.1, "data": {}}
|
|
232
228
|
|
|
@@ -288,7 +284,7 @@ async def test_quote_returns_apy_info(strategy, mock_adapter_responses):
|
|
|
288
284
|
return_value=mock_response
|
|
289
285
|
)
|
|
290
286
|
|
|
291
|
-
quote = await strategy.
|
|
287
|
+
quote = await strategy._quote()
|
|
292
288
|
|
|
293
289
|
assert "apy" in quote
|
|
294
290
|
assert "information" in quote or "data" in quote
|
|
@@ -624,7 +620,6 @@ async def test_atomic_deposit_iteration_swaps_from_eth_when_borrow_surfaces_as_e
|
|
|
624
620
|
strategy.moonwell_adapter.borrow = AsyncMock(side_effect=borrow_side_effect)
|
|
625
621
|
|
|
626
622
|
async def wrap_eth_side_effect(*, amount: int):
|
|
627
|
-
# Wrap ETH to WETH
|
|
628
623
|
balances[ETH_TOKEN_ID] -= int(amount)
|
|
629
624
|
balances[WETH_TOKEN_ID] += int(amount)
|
|
630
625
|
return (True, {"block_number": 12346})
|
|
@@ -634,10 +629,8 @@ async def test_atomic_deposit_iteration_swaps_from_eth_when_borrow_surfaces_as_e
|
|
|
634
629
|
async def swap_side_effect(
|
|
635
630
|
*, from_token_id: str, to_token_id: str, amount: int, **_
|
|
636
631
|
):
|
|
637
|
-
# After wrapping, the swap should be WETH→wstETH
|
|
638
632
|
assert from_token_id == WETH_TOKEN_ID
|
|
639
633
|
assert to_token_id == WSTETH_TOKEN_ID
|
|
640
|
-
# Simulate receiving wstETH
|
|
641
634
|
balances[WSTETH_TOKEN_ID] += 123
|
|
642
635
|
return {"to_amount": 123}
|
|
643
636
|
|
|
@@ -897,7 +890,6 @@ async def test_partial_liquidate_prefers_wsteth_when_excess(strategy):
|
|
|
897
890
|
strategy.token_adapter.get_token = AsyncMock(side_effect=mock_get_token)
|
|
898
891
|
strategy.token_adapter.get_token_price = AsyncMock(side_effect=mock_get_price)
|
|
899
892
|
|
|
900
|
-
# Wallet balances (raw)
|
|
901
893
|
balances: dict[str, int] = {USDC_TOKEN_ID: 0, WSTETH_TOKEN_ID: 0}
|
|
902
894
|
|
|
903
895
|
async def mock_get_balance_raw(*, token_id: str, wallet_address: str, **_):
|
|
@@ -915,7 +907,6 @@ async def test_partial_liquidate_prefers_wsteth_when_excess(strategy):
|
|
|
915
907
|
snap.wsteth_price = 2000.0
|
|
916
908
|
snap.wsteth_dec = 18
|
|
917
909
|
|
|
918
|
-
# Collateral factors
|
|
919
910
|
strategy.moonwell_adapter.get_collateral_factor = AsyncMock(
|
|
920
911
|
return_value=(True, 0.8)
|
|
921
912
|
)
|
|
@@ -987,7 +978,6 @@ async def test_partial_liquidate_prefers_wsteth_when_excess(strategy):
|
|
|
987
978
|
|
|
988
979
|
@pytest.mark.asyncio
|
|
989
980
|
async def test_partial_liquidate_uses_usdc_collateral_when_no_wsteth_excess(strategy):
|
|
990
|
-
# Token metadata
|
|
991
981
|
strategy.token_adapter.get_token = AsyncMock(
|
|
992
982
|
side_effect=lambda token_id: (
|
|
993
983
|
True,
|