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
|
@@ -6,157 +6,74 @@ from wayfinder_paths.adapters.balance_adapter.adapter import BalanceAdapter
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class TestBalanceAdapter:
|
|
9
|
-
@pytest.fixture
|
|
10
|
-
def mock_wallet_client(self):
|
|
11
|
-
mock_client = AsyncMock()
|
|
12
|
-
return mock_client
|
|
13
|
-
|
|
14
9
|
@pytest.fixture
|
|
15
10
|
def mock_token_client(self):
|
|
16
|
-
|
|
17
|
-
return mock_client
|
|
11
|
+
return AsyncMock()
|
|
18
12
|
|
|
19
13
|
@pytest.fixture
|
|
20
|
-
def adapter(self,
|
|
21
|
-
with (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return_value=mock_wallet_client,
|
|
25
|
-
),
|
|
26
|
-
patch(
|
|
27
|
-
"wayfinder_paths.adapters.balance_adapter.adapter.TokenClient",
|
|
28
|
-
return_value=mock_token_client,
|
|
29
|
-
),
|
|
14
|
+
def adapter(self, mock_token_client):
|
|
15
|
+
with patch(
|
|
16
|
+
"wayfinder_paths.adapters.balance_adapter.adapter.TokenClient",
|
|
17
|
+
return_value=mock_token_client,
|
|
30
18
|
):
|
|
31
19
|
return BalanceAdapter(config={})
|
|
32
20
|
|
|
33
|
-
@pytest.mark.asyncio
|
|
34
|
-
async def test_health_check(self, adapter):
|
|
35
|
-
health = await adapter.health_check()
|
|
36
|
-
assert isinstance(health, dict)
|
|
37
|
-
assert health.get("status") in {"healthy", "unhealthy", "error"}
|
|
38
|
-
|
|
39
|
-
@pytest.mark.asyncio
|
|
40
|
-
async def test_connect(self, adapter):
|
|
41
|
-
ok = await adapter.connect()
|
|
42
|
-
assert isinstance(ok, bool)
|
|
43
|
-
|
|
44
21
|
def test_adapter_type(self, adapter):
|
|
45
22
|
assert adapter.adapter_type == "BALANCE"
|
|
46
23
|
|
|
47
24
|
@pytest.mark.asyncio
|
|
48
|
-
async def
|
|
49
|
-
self, adapter, mock_token_client, mock_wallet_client
|
|
50
|
-
):
|
|
25
|
+
async def test_get_balance_with_token_id(self, adapter, mock_token_client):
|
|
51
26
|
mock_token_client.get_token_details = AsyncMock(
|
|
52
27
|
return_value={
|
|
53
28
|
"token_id": "usd-coin-base",
|
|
54
|
-
"address": "
|
|
29
|
+
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
55
30
|
"chain": {"id": 8453, "code": "base"},
|
|
56
31
|
}
|
|
57
32
|
)
|
|
58
|
-
mock_wallet_client.get_token_balance_for_address = AsyncMock(
|
|
59
|
-
return_value={"balance": 1000000}
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
success, balance = await adapter.get_balance(
|
|
63
|
-
query="usd-coin-base",
|
|
64
|
-
wallet_address="0xWallet",
|
|
65
|
-
)
|
|
66
33
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
with patch(
|
|
35
|
+
"wayfinder_paths.adapters.balance_adapter.adapter.get_token_balance",
|
|
36
|
+
new_callable=AsyncMock,
|
|
37
|
+
return_value=1000000,
|
|
38
|
+
) as mock_get_balance:
|
|
39
|
+
success, balance = await adapter.get_balance(
|
|
40
|
+
token_id="usd-coin-base",
|
|
41
|
+
wallet_address="0xWallet",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
assert success
|
|
45
|
+
assert balance == 1000000
|
|
46
|
+
mock_token_client.get_token_details.assert_called_once_with("usd-coin-base")
|
|
47
|
+
mock_get_balance.assert_called_once_with(
|
|
48
|
+
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 8453, "0xWallet"
|
|
49
|
+
)
|
|
75
50
|
|
|
76
51
|
@pytest.mark.asyncio
|
|
77
|
-
async def
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return_value=
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
wallet_address="0x123",
|
|
94
|
-
)
|
|
95
|
-
assert success
|
|
96
|
-
assert balance == 3000000
|
|
97
|
-
mock_token_client.get_token_details.assert_called_once_with("wsteth-base")
|
|
98
|
-
mock_wallet_client.get_token_balance_for_address.assert_called_once_with(
|
|
99
|
-
wallet_address="0x123",
|
|
100
|
-
query="wsteth-base",
|
|
101
|
-
chain_id=8453,
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
@pytest.mark.asyncio
|
|
105
|
-
async def test_get_balance_missing_query(self, adapter):
|
|
106
|
-
success, result = await adapter.get_balance(query={}, wallet_address="0xabc")
|
|
107
|
-
assert success is False
|
|
108
|
-
assert "missing query" in str(result)
|
|
109
|
-
|
|
110
|
-
@pytest.mark.asyncio
|
|
111
|
-
async def test_get_balance_with_pool_address(
|
|
112
|
-
self, adapter, mock_token_client, mock_wallet_client
|
|
113
|
-
):
|
|
114
|
-
mock_wallet_client.get_token_balance_for_address = AsyncMock(
|
|
115
|
-
return_value={"balance": 5000000}
|
|
116
|
-
)
|
|
117
|
-
mock_token_client.get_token_details = AsyncMock()
|
|
118
|
-
|
|
119
|
-
success, balance = await adapter.get_balance(
|
|
120
|
-
query="0xPoolAddress",
|
|
121
|
-
wallet_address="0xWallet",
|
|
122
|
-
chain_id=8453,
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
assert success
|
|
126
|
-
assert balance == 5000000
|
|
127
|
-
mock_wallet_client.get_token_balance_for_address.assert_called_once_with(
|
|
128
|
-
wallet_address="0xWallet",
|
|
129
|
-
query="0xPoolAddress",
|
|
130
|
-
chain_id=8453,
|
|
131
|
-
)
|
|
132
|
-
mock_token_client.get_token_details.assert_not_called()
|
|
52
|
+
async def test_get_balance_with_token_address(self, adapter, mock_token_client):
|
|
53
|
+
with patch(
|
|
54
|
+
"wayfinder_paths.adapters.balance_adapter.adapter.get_token_balance",
|
|
55
|
+
new_callable=AsyncMock,
|
|
56
|
+
return_value=5000000,
|
|
57
|
+
) as mock_get_balance:
|
|
58
|
+
success, balance = await adapter.get_balance(
|
|
59
|
+
token_address="0xTokenAddress",
|
|
60
|
+
wallet_address="0xWallet",
|
|
61
|
+
chain_id=8453,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
assert success
|
|
65
|
+
assert balance == 5000000
|
|
66
|
+
mock_get_balance.assert_called_once_with("0xTokenAddress", 8453, "0xWallet")
|
|
67
|
+
mock_token_client.get_token_details.assert_not_called()
|
|
133
68
|
|
|
134
69
|
@pytest.mark.asyncio
|
|
135
70
|
async def test_get_balance_token_not_found(self, adapter, mock_token_client):
|
|
136
71
|
mock_token_client.get_token_details = AsyncMock(return_value=None)
|
|
137
72
|
|
|
138
73
|
success, error = await adapter.get_balance(
|
|
139
|
-
|
|
140
|
-
wallet_address="0xWallet",
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
assert success is False
|
|
144
|
-
assert "Token not found" in str(error)
|
|
145
|
-
|
|
146
|
-
@pytest.mark.asyncio
|
|
147
|
-
async def test_get_balance_missing_chain_id(self, adapter, mock_token_client):
|
|
148
|
-
mock_token_client.get_token_details = AsyncMock(
|
|
149
|
-
return_value={
|
|
150
|
-
"token_id": "token-without-chain",
|
|
151
|
-
"address": "0x123",
|
|
152
|
-
"chain": {},
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
success, error = await adapter.get_balance(
|
|
157
|
-
query="token-without-chain",
|
|
74
|
+
token_id="invalid-token",
|
|
158
75
|
wallet_address="0xWallet",
|
|
159
76
|
)
|
|
160
77
|
|
|
161
78
|
assert success is False
|
|
162
|
-
assert "
|
|
79
|
+
assert "NoneType" in error or "subscriptable" in error
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Boros Adapter - wraps Boros API for fixed-rate market operations."""
|
|
2
|
+
|
|
3
|
+
from .adapter import BorosAdapter
|
|
4
|
+
from .types import (
|
|
5
|
+
BorosLimitOrder,
|
|
6
|
+
BorosMarketQuote,
|
|
7
|
+
BorosTenorQuote,
|
|
8
|
+
MarginHealth,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"BorosAdapter",
|
|
13
|
+
"BorosMarketQuote",
|
|
14
|
+
"BorosTenorQuote",
|
|
15
|
+
"BorosLimitOrder",
|
|
16
|
+
"MarginHealth",
|
|
17
|
+
]
|