wayfinder-paths 0.1.4__tar.gz → 0.1.6__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.
Potentially problematic release.
This version of wayfinder-paths might be problematic. Click here for more details.
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/PKG-INFO +46 -47
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/README.md +45 -46
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/pyproject.toml +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/CONFIG_GUIDE.md +14 -14
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/__init__.py +4 -3
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/balance_adapter/README.md +10 -10
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/balance_adapter/adapter.py +10 -9
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/balance_adapter/examples.json +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/README.md +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/adapter.py +28 -21
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/hyperlend_adapter/adapter.py +33 -26
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/README.md +26 -39
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/adapter.py +78 -75
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/examples.json +10 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/manifest.yaml +4 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/test_adapter.py +31 -26
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/README.md +1 -13
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/adapter.py +12 -19
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/adapter.py +8 -4
- wayfinder_paths-0.1.6/wayfinder_paths/core/__init__.py +18 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/adapters/BaseAdapter.py +20 -3
- wayfinder_paths-0.1.6/wayfinder_paths/core/adapters/models.py +41 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/BRAPClient.py +21 -2
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/ClientManager.py +42 -63
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/HyperlendClient.py +46 -5
- wayfinder_paths-0.1.6/wayfinder_paths/core/clients/LedgerClient.py +448 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/PoolClient.py +51 -19
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/SimulationClient.py +16 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/TokenClient.py +34 -18
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/TransactionClient.py +18 -2
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/WalletClient.py +35 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/WayfinderClient.py +16 -5
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/protocols.py +69 -62
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/sdk_example.py +0 -5
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/config.py +192 -103
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/constants/base.py +17 -0
- wayfinder_paths-0.1.4/wayfinder_paths/core/engine/VaultJob.py → wayfinder_paths-0.1.6/wayfinder_paths/core/engine/StrategyJob.py +25 -19
- wayfinder_paths-0.1.6/wayfinder_paths/core/engine/__init__.py +5 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/services/base.py +6 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/services/local_evm_txn.py +3 -2
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/settings.py +2 -2
- wayfinder_paths-0.1.6/wayfinder_paths/core/strategies/Strategy.py +280 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/strategies/descriptors.py +1 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/utils/evm_helpers.py +12 -10
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/wallets/README.md +3 -3
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/wallets/WalletManager.py +3 -3
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/run_strategy.py +26 -24
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/scripts/make_wallets.py +6 -6
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/README.md +6 -6
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py +36 -156
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/test_strategy.py +6 -6
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/stablecoin_yield_strategy/README.md +11 -11
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/stablecoin_yield_strategy/manifest.yaml +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/stablecoin_yield_strategy/strategy.py +92 -92
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/stablecoin_yield_strategy/test_strategy.py +6 -6
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/adapter/README.md +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/adapter/test_adapter.py +1 -1
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/strategy/README.md +4 -4
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/strategy/test_strategy.py +7 -7
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/tests/test_test_coverage.py +5 -5
- wayfinder_paths-0.1.4/wayfinder_paths/core/__init__.py +0 -13
- wayfinder_paths-0.1.4/wayfinder_paths/core/clients/LedgerClient.py +0 -222
- wayfinder_paths-0.1.4/wayfinder_paths/core/engine/__init__.py +0 -5
- wayfinder_paths-0.1.4/wayfinder_paths/core/strategies/Strategy.py +0 -183
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/LICENSE +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/abis/generic/erc20.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/balance_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/balance_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/brap_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/hyperlend_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/hyperlend_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/hyperlend_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/ledger_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/pool_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/README.md +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/adapters/token_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/config.example.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/conftest.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/adapters/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/adapters/base.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/AuthClient.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/clients/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/constants/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/constants/erc20_abi.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/constants/hyperlend_abi.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/engine/manifest.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/services/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/services/local_token_txn.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/services/web3_service.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/strategies/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/strategies/base.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/utils/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/utils/wallets.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/core/wallets/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/enso.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/erc20.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/evm.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/hyper_evm.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/hyperlend.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/hyperliquid.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/moonwell.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/prjx.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/policies/util.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/scripts/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/scripts/create_strategy.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/scripts/validate_manifests.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/config.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/strategies/stablecoin_yield_strategy/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/adapter/adapter.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/adapter/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/strategy/examples.json +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/templates/strategy/strategy.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/tests/__init__.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/tests/test_smoke_manifest.py +0 -0
- {wayfinder_paths-0.1.4 → wayfinder_paths-0.1.6}/wayfinder_paths/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wayfinder-paths
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Wayfinder Path: strategies and adapters
|
|
5
5
|
Author: Wayfinder
|
|
6
6
|
Author-email: dev@wayfinder.ai
|
|
@@ -20,13 +20,13 @@ Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
|
20
20
|
Requires-Dist: web3 (>=7.13.0,<8.0.0)
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
|
|
23
|
-
# 🔐 Wayfinder
|
|
23
|
+
# 🔐 Wayfinder Paths
|
|
24
24
|
|
|
25
25
|
[](https://www.python.org/downloads/)
|
|
26
26
|
[](https://www.docker.com/)
|
|
27
27
|
[](https://discord.gg/fUVwGMXjm3)
|
|
28
28
|
|
|
29
|
-
Open-source platform for community-contributed crypto trading strategies and adapters. Build, test, and deploy automated trading
|
|
29
|
+
Open-source platform for community-contributed crypto trading strategies and adapters. Build, test, and deploy automated trading strategies with direct wallet integration.
|
|
30
30
|
|
|
31
31
|
## 🚀 Quick Start
|
|
32
32
|
|
|
@@ -68,27 +68,26 @@ wayfinder_paths/
|
|
|
68
68
|
│ ├── core/ # Core engine (maintained by team)
|
|
69
69
|
│ │ ├── clients/ # API client managers
|
|
70
70
|
│ │ ├── adapters/ # Base adapter interfaces
|
|
71
|
-
│ │ ├── engine/ # Trading engine &
|
|
71
|
+
│ │ ├── engine/ # Trading engine & StrategyJob
|
|
72
72
|
│ │ ├── strategies/ # Base strategy classes
|
|
73
73
|
│ │ └── config.py # Configuration system
|
|
74
|
-
│ ├──
|
|
75
|
-
│ │ ├──
|
|
76
|
-
│ │ │ ├──
|
|
77
|
-
│ │ │
|
|
78
|
-
│ │ │
|
|
79
|
-
│ │ │
|
|
80
|
-
│ │ │
|
|
81
|
-
│ │
|
|
82
|
-
│ │
|
|
83
|
-
│
|
|
84
|
-
│ │
|
|
85
|
-
│ │
|
|
86
|
-
│ │
|
|
87
|
-
│ │
|
|
88
|
-
│ │
|
|
89
|
-
│ │
|
|
90
|
-
│ │
|
|
91
|
-
│ │ └── ...
|
|
74
|
+
│ ├── adapters/ # Your exchange/protocol integrations (community contributions)
|
|
75
|
+
│ │ ├── balance_adapter/
|
|
76
|
+
│ │ │ ├── adapter.py # Adapter implementation
|
|
77
|
+
│ │ │ ├── manifest.yaml # Adapter manifest (caps, entrypoint)
|
|
78
|
+
│ │ │ ├── examples.json # Example inputs for smoke
|
|
79
|
+
│ │ │ ├── README.md # Local notes
|
|
80
|
+
│ │ │ └── test_adapter.py # Local smoke test
|
|
81
|
+
│ │ ├── brap_adapter/
|
|
82
|
+
│ │ └── ...
|
|
83
|
+
│ ├── strategies/ # Your trading strategies (community contributions)
|
|
84
|
+
│ │ ├── stablecoin_yield_strategy/
|
|
85
|
+
│ │ │ ├── strategy.py # Strategy implementation
|
|
86
|
+
│ │ │ ├── manifest.yaml # Strategy manifest
|
|
87
|
+
│ │ │ ├── examples.json # Example inputs
|
|
88
|
+
│ │ │ ├── README.md # Local notes
|
|
89
|
+
│ │ │ └── test_strategy.py # Local smoke test
|
|
90
|
+
│ │ └── ...
|
|
92
91
|
│ ├── tests/ # Test suite
|
|
93
92
|
│ ├── CONFIG_GUIDE.md # Configuration documentation
|
|
94
93
|
│ ├── config.example.json # Example configuration
|
|
@@ -109,8 +108,8 @@ We welcome contributions! This is an open-source project where community members
|
|
|
109
108
|
1. **Fork the repository** and clone your fork
|
|
110
109
|
2. **Create a feature branch**: `git checkout -b feature/my-strategy`
|
|
111
110
|
3. **Copy a template** to get started:
|
|
112
|
-
- **For adapters**: Copy `wayfinder_paths/
|
|
113
|
-
- **For strategies**: Copy `wayfinder_paths/
|
|
111
|
+
- **For adapters**: Copy `wayfinder_paths/templates/adapter/` to `wayfinder_paths/adapters/my_adapter/`
|
|
112
|
+
- **For strategies**: Copy `wayfinder_paths/templates/strategy/` to `wayfinder_paths/strategies/my_strategy/`
|
|
114
113
|
4. **Customize** the template (rename classes, update manifest, implement methods)
|
|
115
114
|
5. **Test your code** thoroughly using the provided test framework
|
|
116
115
|
6. **Validate manifests**: Run `just validate-manifests`
|
|
@@ -125,9 +124,9 @@ We welcome contributions! This is an open-source project where community members
|
|
|
125
124
|
### Contributor Guidelines
|
|
126
125
|
|
|
127
126
|
#### For Adapters
|
|
128
|
-
- **Start from the template**: Copy `wayfinder_paths/
|
|
127
|
+
- **Start from the template**: Copy `wayfinder_paths/templates/adapter/` as a starting point
|
|
129
128
|
- Extend `BaseAdapter` from `wayfinder_paths/core/adapters/BaseAdapter.py`
|
|
130
|
-
- Create a `manifest.yaml` (template at `wayfinder_paths/
|
|
129
|
+
- Create a `manifest.yaml` (template at `wayfinder_paths/templates/adapter/manifest.yaml`) with:
|
|
131
130
|
- `entrypoint`: Full import path to your adapter class
|
|
132
131
|
- `capabilities`: List of capabilities your adapter provides
|
|
133
132
|
- `dependencies`: List of required client classes (e.g., `PoolClient`, `TokenClient`)
|
|
@@ -138,9 +137,9 @@ We welcome contributions! This is an open-source project where community members
|
|
|
138
137
|
- Validate your manifest: `just validate-manifests`
|
|
139
138
|
|
|
140
139
|
#### For Strategies
|
|
141
|
-
- **Start from the template**: Use `just create-strategy "Strategy Name"` to create a new strategy with its own wallet, or copy `wayfinder_paths/
|
|
140
|
+
- **Start from the template**: Use `just create-strategy "Strategy Name"` to create a new strategy with its own wallet, or copy `wayfinder_paths/templates/strategy/` manually
|
|
142
141
|
- Extend `Strategy` from `wayfinder_paths/core/strategies/Strategy.py`
|
|
143
|
-
- Create a `manifest.yaml` (template at `wayfinder_paths/
|
|
142
|
+
- Create a `manifest.yaml` (template at `wayfinder_paths/templates/strategy/manifest.yaml`) with:
|
|
144
143
|
- `entrypoint`: Full import path to your strategy class
|
|
145
144
|
- `name`: Strategy directory name (used for wallet lookup)
|
|
146
145
|
- `permissions.policy`: Security policy for transaction permissions
|
|
@@ -177,9 +176,9 @@ just create-strategy "My Strategy Name"
|
|
|
177
176
|
|
|
178
177
|
# Or manually copy a template:
|
|
179
178
|
# For adapters:
|
|
180
|
-
cp -r wayfinder_paths/
|
|
179
|
+
cp -r wayfinder_paths/templates/adapter wayfinder_paths/adapters/my_adapter
|
|
181
180
|
# For strategies:
|
|
182
|
-
cp -r wayfinder_paths/
|
|
181
|
+
cp -r wayfinder_paths/templates/strategy wayfinder_paths/strategies/my_strategy
|
|
183
182
|
|
|
184
183
|
# 5. Customize the template (see template README.md files for details)
|
|
185
184
|
|
|
@@ -190,8 +189,8 @@ just validate-manifests
|
|
|
190
189
|
poetry run pytest -k smoke -v
|
|
191
190
|
|
|
192
191
|
# Or test your specific contribution
|
|
193
|
-
poetry run pytest wayfinder_paths/
|
|
194
|
-
poetry run pytest wayfinder_paths/
|
|
192
|
+
poetry run pytest wayfinder_paths/strategies/your_strategy/ -v
|
|
193
|
+
poetry run pytest wayfinder_paths/adapters/your_adapter/ -v
|
|
195
194
|
|
|
196
195
|
# 8. Test your contribution locally
|
|
197
196
|
poetry run python wayfinder_paths/run_strategy.py your_strategy --action status
|
|
@@ -228,7 +227,7 @@ Every adapter and strategy requires a `manifest.yaml` file that declares its met
|
|
|
228
227
|
|
|
229
228
|
Adapter manifests declare the capabilities an adapter provides and the clients it depends on.
|
|
230
229
|
|
|
231
|
-
**Template:** Copy `wayfinder_paths/
|
|
230
|
+
**Template:** Copy `wayfinder_paths/templates/adapter/manifest.yaml` as a starting point.
|
|
232
231
|
|
|
233
232
|
**Schema:**
|
|
234
233
|
```yaml
|
|
@@ -248,7 +247,7 @@ dependencies:
|
|
|
248
247
|
- `capabilities`: List of abstract capabilities this adapter provides (required, non-empty)
|
|
249
248
|
- `dependencies`: List of client class names from `core.clients` that this adapter requires (required, non-empty)
|
|
250
249
|
|
|
251
|
-
**Example** (`
|
|
250
|
+
**Example** (`wayfinder_paths/adapters/pool_adapter/manifest.yaml`):
|
|
252
251
|
```yaml
|
|
253
252
|
schema_version: "0.1"
|
|
254
253
|
entrypoint: "adapters.pool_adapter.adapter.PoolAdapter"
|
|
@@ -266,7 +265,7 @@ dependencies:
|
|
|
266
265
|
|
|
267
266
|
Strategy manifests declare permissions and required adapters with their capabilities.
|
|
268
267
|
|
|
269
|
-
**Template:** Copy `wayfinder_paths/
|
|
268
|
+
**Template:** Copy `wayfinder_paths/templates/strategy/manifest.yaml` as a starting point.
|
|
270
269
|
|
|
271
270
|
**Schema:**
|
|
272
271
|
```yaml
|
|
@@ -290,7 +289,7 @@ adapters:
|
|
|
290
289
|
- `name`: Adapter type identifier (e.g., "POOL", "BRAP")
|
|
291
290
|
- `capabilities`: List of capabilities required from this adapter
|
|
292
291
|
|
|
293
|
-
**Example** (`
|
|
292
|
+
**Example** (`wayfinder_paths/strategies/stablecoin_yield_strategy/manifest.yaml`):
|
|
294
293
|
```yaml
|
|
295
294
|
schema_version: "0.1"
|
|
296
295
|
entrypoint: "strategies.stablecoin_yield_strategy.strategy.StablecoinYieldStrategy"
|
|
@@ -357,8 +356,8 @@ For each manifest file:
|
|
|
357
356
|
```
|
|
358
357
|
|
|
359
358
|
The script automatically discovers all manifests by scanning:
|
|
360
|
-
- `wayfinder_paths/
|
|
361
|
-
- `wayfinder_paths/
|
|
359
|
+
- `wayfinder_paths/adapters/*/manifest.yaml` for adapter manifests
|
|
360
|
+
- `wayfinder_paths/strategies/*/manifest.yaml` for strategy manifests
|
|
362
361
|
|
|
363
362
|
All errors are collected and reported at the end, with the script exiting with code 1 if any validation fails.
|
|
364
363
|
|
|
@@ -381,7 +380,7 @@ See [CONFIG_GUIDE.md](wayfinder_paths/CONFIG_GUIDE.md) for details.
|
|
|
381
380
|
|
|
382
381
|
### Authentication
|
|
383
382
|
|
|
384
|
-
Wayfinder
|
|
383
|
+
Wayfinder Paths supports two authentication methods:
|
|
385
384
|
|
|
386
385
|
#### 1. Service Account Authentication (API Key)
|
|
387
386
|
For backend services and automated systems with higher rate limits:
|
|
@@ -445,7 +444,7 @@ See [CONFIG_GUIDE.md](wayfinder_paths/CONFIG_GUIDE.md) for detailed authenticati
|
|
|
445
444
|
Adapters connect to exchanges and DeFi protocols using the client system.
|
|
446
445
|
|
|
447
446
|
```python
|
|
448
|
-
# wayfinder_paths/
|
|
447
|
+
# wayfinder_paths/adapters/my_adapter/adapter.py
|
|
449
448
|
from wayfinder_paths.core.adapters.BaseAdapter import BaseAdapter
|
|
450
449
|
from wayfinder_paths.core.clients.PoolClient import PoolClient
|
|
451
450
|
|
|
@@ -475,7 +474,7 @@ class MyAdapter(BaseAdapter):
|
|
|
475
474
|
Strategies implement trading logic using adapters and the unified client system.
|
|
476
475
|
|
|
477
476
|
```python
|
|
478
|
-
# wayfinder_paths/
|
|
477
|
+
# wayfinder_paths/strategies/my_strategy/strategy.py
|
|
479
478
|
from wayfinder_paths.core.services.web3_service import DefaultWeb3Service
|
|
480
479
|
from wayfinder_paths.core.strategies.Strategy import StatusDict, StatusTuple, Strategy
|
|
481
480
|
from wayfinder_paths.adapters.balance_adapter.adapter import BalanceAdapter
|
|
@@ -501,7 +500,7 @@ class MyStrategy(Strategy):
|
|
|
501
500
|
async def deposit(
|
|
502
501
|
self, main_token_amount: float = 0.0, gas_token_amount: float = 0.0
|
|
503
502
|
) -> StatusTuple:
|
|
504
|
-
"""Move funds from main wallet into the
|
|
503
|
+
"""Move funds from main wallet into the strategy wallet."""
|
|
505
504
|
if main_token_amount <= 0:
|
|
506
505
|
return (False, "Nothing to deposit")
|
|
507
506
|
|
|
@@ -524,7 +523,7 @@ class MyStrategy(Strategy):
|
|
|
524
523
|
"""Report balances back to the runner"""
|
|
525
524
|
success, balance = await self.balance_adapter.get_balance(
|
|
526
525
|
token_id=self.config.get("token_id"),
|
|
527
|
-
wallet_address=self.config.get("
|
|
526
|
+
wallet_address=self.config.get("strategy_wallet", {}).get("address"),
|
|
528
527
|
)
|
|
529
528
|
return {
|
|
530
529
|
"portfolio_value": float(balance or 0),
|
|
@@ -535,10 +534,10 @@ class MyStrategy(Strategy):
|
|
|
535
534
|
|
|
536
535
|
### Built-in adapters
|
|
537
536
|
|
|
538
|
-
- **BALANCE (BalanceAdapter)**: wraps `WalletClient`/`TokenClient` to read wallet, token, and pool balances and now orchestrates transfers between the main/
|
|
537
|
+
- **BALANCE (BalanceAdapter)**: wraps `WalletClient`/`TokenClient` to read wallet, token, and pool balances and now orchestrates transfers between the main/strategy wallets with ledger bookkeeping. Requires a `Web3Service` so it can share the same wallet provider as the strategy.
|
|
539
538
|
- **POOL (PoolAdapter)**: composes `PoolClient` to fetch pools, llama analytics, combined reports, high-yield searches, and search helpers.
|
|
540
539
|
- **BRAP (BRAPAdapter)**: integrates the cross-chain quote service for swaps/bridges, including fee breakdowns, route comparisons, validation helpers, and swap execution/ledger recording when provided a `Web3Service`.
|
|
541
|
-
- **LEDGER (LedgerAdapter)**: records deposits, withdrawals, custom operations, and cashflows via `LedgerClient`, and can read
|
|
540
|
+
- **LEDGER (LedgerAdapter)**: records deposits, withdrawals, custom operations, and cashflows via `LedgerClient`, and can read strategy transaction summaries.
|
|
542
541
|
- **TOKEN (TokenAdapter)**: lightweight wrapper around `TokenClient` for token metadata, live price snapshots, and gas token lookups.
|
|
543
542
|
- **HYPERLEND (HyperlendAdapter)**: connects to `HyperlendClient` for lending/supply caps inside the HyperLend strategy.
|
|
544
543
|
|
|
@@ -560,8 +559,8 @@ just create-wallets
|
|
|
560
559
|
poetry run pytest -k smoke -v
|
|
561
560
|
|
|
562
561
|
# 3. Test your specific contribution
|
|
563
|
-
poetry run pytest wayfinder_paths/
|
|
564
|
-
poetry run pytest wayfinder_paths/
|
|
562
|
+
poetry run pytest wayfinder_paths/strategies/my_strategy/ -v # Strategy
|
|
563
|
+
poetry run pytest wayfinder_paths/adapters/my_adapter/ -v # Adapter
|
|
565
564
|
```
|
|
566
565
|
|
|
567
566
|
### Testing Your Contribution
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# 🔐 Wayfinder
|
|
1
|
+
# 🔐 Wayfinder Paths
|
|
2
2
|
|
|
3
3
|
[](https://www.python.org/downloads/)
|
|
4
4
|
[](https://www.docker.com/)
|
|
5
5
|
[](https://discord.gg/fUVwGMXjm3)
|
|
6
6
|
|
|
7
|
-
Open-source platform for community-contributed crypto trading strategies and adapters. Build, test, and deploy automated trading
|
|
7
|
+
Open-source platform for community-contributed crypto trading strategies and adapters. Build, test, and deploy automated trading strategies with direct wallet integration.
|
|
8
8
|
|
|
9
9
|
## 🚀 Quick Start
|
|
10
10
|
|
|
@@ -46,27 +46,26 @@ wayfinder_paths/
|
|
|
46
46
|
│ ├── core/ # Core engine (maintained by team)
|
|
47
47
|
│ │ ├── clients/ # API client managers
|
|
48
48
|
│ │ ├── adapters/ # Base adapter interfaces
|
|
49
|
-
│ │ ├── engine/ # Trading engine &
|
|
49
|
+
│ │ ├── engine/ # Trading engine & StrategyJob
|
|
50
50
|
│ │ ├── strategies/ # Base strategy classes
|
|
51
51
|
│ │ └── config.py # Configuration system
|
|
52
|
-
│ ├──
|
|
53
|
-
│ │ ├──
|
|
54
|
-
│ │ │ ├──
|
|
55
|
-
│ │ │
|
|
56
|
-
│ │ │
|
|
57
|
-
│ │ │
|
|
58
|
-
│ │ │
|
|
59
|
-
│ │
|
|
60
|
-
│ │
|
|
61
|
-
│
|
|
62
|
-
│ │
|
|
63
|
-
│ │
|
|
64
|
-
│ │
|
|
65
|
-
│ │
|
|
66
|
-
│ │
|
|
67
|
-
│ │
|
|
68
|
-
│ │
|
|
69
|
-
│ │ └── ...
|
|
52
|
+
│ ├── adapters/ # Your exchange/protocol integrations (community contributions)
|
|
53
|
+
│ │ ├── balance_adapter/
|
|
54
|
+
│ │ │ ├── adapter.py # Adapter implementation
|
|
55
|
+
│ │ │ ├── manifest.yaml # Adapter manifest (caps, entrypoint)
|
|
56
|
+
│ │ │ ├── examples.json # Example inputs for smoke
|
|
57
|
+
│ │ │ ├── README.md # Local notes
|
|
58
|
+
│ │ │ └── test_adapter.py # Local smoke test
|
|
59
|
+
│ │ ├── brap_adapter/
|
|
60
|
+
│ │ └── ...
|
|
61
|
+
│ ├── strategies/ # Your trading strategies (community contributions)
|
|
62
|
+
│ │ ├── stablecoin_yield_strategy/
|
|
63
|
+
│ │ │ ├── strategy.py # Strategy implementation
|
|
64
|
+
│ │ │ ├── manifest.yaml # Strategy manifest
|
|
65
|
+
│ │ │ ├── examples.json # Example inputs
|
|
66
|
+
│ │ │ ├── README.md # Local notes
|
|
67
|
+
│ │ │ └── test_strategy.py # Local smoke test
|
|
68
|
+
│ │ └── ...
|
|
70
69
|
│ ├── tests/ # Test suite
|
|
71
70
|
│ ├── CONFIG_GUIDE.md # Configuration documentation
|
|
72
71
|
│ ├── config.example.json # Example configuration
|
|
@@ -87,8 +86,8 @@ We welcome contributions! This is an open-source project where community members
|
|
|
87
86
|
1. **Fork the repository** and clone your fork
|
|
88
87
|
2. **Create a feature branch**: `git checkout -b feature/my-strategy`
|
|
89
88
|
3. **Copy a template** to get started:
|
|
90
|
-
- **For adapters**: Copy `wayfinder_paths/
|
|
91
|
-
- **For strategies**: Copy `wayfinder_paths/
|
|
89
|
+
- **For adapters**: Copy `wayfinder_paths/templates/adapter/` to `wayfinder_paths/adapters/my_adapter/`
|
|
90
|
+
- **For strategies**: Copy `wayfinder_paths/templates/strategy/` to `wayfinder_paths/strategies/my_strategy/`
|
|
92
91
|
4. **Customize** the template (rename classes, update manifest, implement methods)
|
|
93
92
|
5. **Test your code** thoroughly using the provided test framework
|
|
94
93
|
6. **Validate manifests**: Run `just validate-manifests`
|
|
@@ -103,9 +102,9 @@ We welcome contributions! This is an open-source project where community members
|
|
|
103
102
|
### Contributor Guidelines
|
|
104
103
|
|
|
105
104
|
#### For Adapters
|
|
106
|
-
- **Start from the template**: Copy `wayfinder_paths/
|
|
105
|
+
- **Start from the template**: Copy `wayfinder_paths/templates/adapter/` as a starting point
|
|
107
106
|
- Extend `BaseAdapter` from `wayfinder_paths/core/adapters/BaseAdapter.py`
|
|
108
|
-
- Create a `manifest.yaml` (template at `wayfinder_paths/
|
|
107
|
+
- Create a `manifest.yaml` (template at `wayfinder_paths/templates/adapter/manifest.yaml`) with:
|
|
109
108
|
- `entrypoint`: Full import path to your adapter class
|
|
110
109
|
- `capabilities`: List of capabilities your adapter provides
|
|
111
110
|
- `dependencies`: List of required client classes (e.g., `PoolClient`, `TokenClient`)
|
|
@@ -116,9 +115,9 @@ We welcome contributions! This is an open-source project where community members
|
|
|
116
115
|
- Validate your manifest: `just validate-manifests`
|
|
117
116
|
|
|
118
117
|
#### For Strategies
|
|
119
|
-
- **Start from the template**: Use `just create-strategy "Strategy Name"` to create a new strategy with its own wallet, or copy `wayfinder_paths/
|
|
118
|
+
- **Start from the template**: Use `just create-strategy "Strategy Name"` to create a new strategy with its own wallet, or copy `wayfinder_paths/templates/strategy/` manually
|
|
120
119
|
- Extend `Strategy` from `wayfinder_paths/core/strategies/Strategy.py`
|
|
121
|
-
- Create a `manifest.yaml` (template at `wayfinder_paths/
|
|
120
|
+
- Create a `manifest.yaml` (template at `wayfinder_paths/templates/strategy/manifest.yaml`) with:
|
|
122
121
|
- `entrypoint`: Full import path to your strategy class
|
|
123
122
|
- `name`: Strategy directory name (used for wallet lookup)
|
|
124
123
|
- `permissions.policy`: Security policy for transaction permissions
|
|
@@ -155,9 +154,9 @@ just create-strategy "My Strategy Name"
|
|
|
155
154
|
|
|
156
155
|
# Or manually copy a template:
|
|
157
156
|
# For adapters:
|
|
158
|
-
cp -r wayfinder_paths/
|
|
157
|
+
cp -r wayfinder_paths/templates/adapter wayfinder_paths/adapters/my_adapter
|
|
159
158
|
# For strategies:
|
|
160
|
-
cp -r wayfinder_paths/
|
|
159
|
+
cp -r wayfinder_paths/templates/strategy wayfinder_paths/strategies/my_strategy
|
|
161
160
|
|
|
162
161
|
# 5. Customize the template (see template README.md files for details)
|
|
163
162
|
|
|
@@ -168,8 +167,8 @@ just validate-manifests
|
|
|
168
167
|
poetry run pytest -k smoke -v
|
|
169
168
|
|
|
170
169
|
# Or test your specific contribution
|
|
171
|
-
poetry run pytest wayfinder_paths/
|
|
172
|
-
poetry run pytest wayfinder_paths/
|
|
170
|
+
poetry run pytest wayfinder_paths/strategies/your_strategy/ -v
|
|
171
|
+
poetry run pytest wayfinder_paths/adapters/your_adapter/ -v
|
|
173
172
|
|
|
174
173
|
# 8. Test your contribution locally
|
|
175
174
|
poetry run python wayfinder_paths/run_strategy.py your_strategy --action status
|
|
@@ -206,7 +205,7 @@ Every adapter and strategy requires a `manifest.yaml` file that declares its met
|
|
|
206
205
|
|
|
207
206
|
Adapter manifests declare the capabilities an adapter provides and the clients it depends on.
|
|
208
207
|
|
|
209
|
-
**Template:** Copy `wayfinder_paths/
|
|
208
|
+
**Template:** Copy `wayfinder_paths/templates/adapter/manifest.yaml` as a starting point.
|
|
210
209
|
|
|
211
210
|
**Schema:**
|
|
212
211
|
```yaml
|
|
@@ -226,7 +225,7 @@ dependencies:
|
|
|
226
225
|
- `capabilities`: List of abstract capabilities this adapter provides (required, non-empty)
|
|
227
226
|
- `dependencies`: List of client class names from `core.clients` that this adapter requires (required, non-empty)
|
|
228
227
|
|
|
229
|
-
**Example** (`
|
|
228
|
+
**Example** (`wayfinder_paths/adapters/pool_adapter/manifest.yaml`):
|
|
230
229
|
```yaml
|
|
231
230
|
schema_version: "0.1"
|
|
232
231
|
entrypoint: "adapters.pool_adapter.adapter.PoolAdapter"
|
|
@@ -244,7 +243,7 @@ dependencies:
|
|
|
244
243
|
|
|
245
244
|
Strategy manifests declare permissions and required adapters with their capabilities.
|
|
246
245
|
|
|
247
|
-
**Template:** Copy `wayfinder_paths/
|
|
246
|
+
**Template:** Copy `wayfinder_paths/templates/strategy/manifest.yaml` as a starting point.
|
|
248
247
|
|
|
249
248
|
**Schema:**
|
|
250
249
|
```yaml
|
|
@@ -268,7 +267,7 @@ adapters:
|
|
|
268
267
|
- `name`: Adapter type identifier (e.g., "POOL", "BRAP")
|
|
269
268
|
- `capabilities`: List of capabilities required from this adapter
|
|
270
269
|
|
|
271
|
-
**Example** (`
|
|
270
|
+
**Example** (`wayfinder_paths/strategies/stablecoin_yield_strategy/manifest.yaml`):
|
|
272
271
|
```yaml
|
|
273
272
|
schema_version: "0.1"
|
|
274
273
|
entrypoint: "strategies.stablecoin_yield_strategy.strategy.StablecoinYieldStrategy"
|
|
@@ -335,8 +334,8 @@ For each manifest file:
|
|
|
335
334
|
```
|
|
336
335
|
|
|
337
336
|
The script automatically discovers all manifests by scanning:
|
|
338
|
-
- `wayfinder_paths/
|
|
339
|
-
- `wayfinder_paths/
|
|
337
|
+
- `wayfinder_paths/adapters/*/manifest.yaml` for adapter manifests
|
|
338
|
+
- `wayfinder_paths/strategies/*/manifest.yaml` for strategy manifests
|
|
340
339
|
|
|
341
340
|
All errors are collected and reported at the end, with the script exiting with code 1 if any validation fails.
|
|
342
341
|
|
|
@@ -359,7 +358,7 @@ See [CONFIG_GUIDE.md](wayfinder_paths/CONFIG_GUIDE.md) for details.
|
|
|
359
358
|
|
|
360
359
|
### Authentication
|
|
361
360
|
|
|
362
|
-
Wayfinder
|
|
361
|
+
Wayfinder Paths supports two authentication methods:
|
|
363
362
|
|
|
364
363
|
#### 1. Service Account Authentication (API Key)
|
|
365
364
|
For backend services and automated systems with higher rate limits:
|
|
@@ -423,7 +422,7 @@ See [CONFIG_GUIDE.md](wayfinder_paths/CONFIG_GUIDE.md) for detailed authenticati
|
|
|
423
422
|
Adapters connect to exchanges and DeFi protocols using the client system.
|
|
424
423
|
|
|
425
424
|
```python
|
|
426
|
-
# wayfinder_paths/
|
|
425
|
+
# wayfinder_paths/adapters/my_adapter/adapter.py
|
|
427
426
|
from wayfinder_paths.core.adapters.BaseAdapter import BaseAdapter
|
|
428
427
|
from wayfinder_paths.core.clients.PoolClient import PoolClient
|
|
429
428
|
|
|
@@ -453,7 +452,7 @@ class MyAdapter(BaseAdapter):
|
|
|
453
452
|
Strategies implement trading logic using adapters and the unified client system.
|
|
454
453
|
|
|
455
454
|
```python
|
|
456
|
-
# wayfinder_paths/
|
|
455
|
+
# wayfinder_paths/strategies/my_strategy/strategy.py
|
|
457
456
|
from wayfinder_paths.core.services.web3_service import DefaultWeb3Service
|
|
458
457
|
from wayfinder_paths.core.strategies.Strategy import StatusDict, StatusTuple, Strategy
|
|
459
458
|
from wayfinder_paths.adapters.balance_adapter.adapter import BalanceAdapter
|
|
@@ -479,7 +478,7 @@ class MyStrategy(Strategy):
|
|
|
479
478
|
async def deposit(
|
|
480
479
|
self, main_token_amount: float = 0.0, gas_token_amount: float = 0.0
|
|
481
480
|
) -> StatusTuple:
|
|
482
|
-
"""Move funds from main wallet into the
|
|
481
|
+
"""Move funds from main wallet into the strategy wallet."""
|
|
483
482
|
if main_token_amount <= 0:
|
|
484
483
|
return (False, "Nothing to deposit")
|
|
485
484
|
|
|
@@ -502,7 +501,7 @@ class MyStrategy(Strategy):
|
|
|
502
501
|
"""Report balances back to the runner"""
|
|
503
502
|
success, balance = await self.balance_adapter.get_balance(
|
|
504
503
|
token_id=self.config.get("token_id"),
|
|
505
|
-
wallet_address=self.config.get("
|
|
504
|
+
wallet_address=self.config.get("strategy_wallet", {}).get("address"),
|
|
506
505
|
)
|
|
507
506
|
return {
|
|
508
507
|
"portfolio_value": float(balance or 0),
|
|
@@ -513,10 +512,10 @@ class MyStrategy(Strategy):
|
|
|
513
512
|
|
|
514
513
|
### Built-in adapters
|
|
515
514
|
|
|
516
|
-
- **BALANCE (BalanceAdapter)**: wraps `WalletClient`/`TokenClient` to read wallet, token, and pool balances and now orchestrates transfers between the main/
|
|
515
|
+
- **BALANCE (BalanceAdapter)**: wraps `WalletClient`/`TokenClient` to read wallet, token, and pool balances and now orchestrates transfers between the main/strategy wallets with ledger bookkeeping. Requires a `Web3Service` so it can share the same wallet provider as the strategy.
|
|
517
516
|
- **POOL (PoolAdapter)**: composes `PoolClient` to fetch pools, llama analytics, combined reports, high-yield searches, and search helpers.
|
|
518
517
|
- **BRAP (BRAPAdapter)**: integrates the cross-chain quote service for swaps/bridges, including fee breakdowns, route comparisons, validation helpers, and swap execution/ledger recording when provided a `Web3Service`.
|
|
519
|
-
- **LEDGER (LedgerAdapter)**: records deposits, withdrawals, custom operations, and cashflows via `LedgerClient`, and can read
|
|
518
|
+
- **LEDGER (LedgerAdapter)**: records deposits, withdrawals, custom operations, and cashflows via `LedgerClient`, and can read strategy transaction summaries.
|
|
520
519
|
- **TOKEN (TokenAdapter)**: lightweight wrapper around `TokenClient` for token metadata, live price snapshots, and gas token lookups.
|
|
521
520
|
- **HYPERLEND (HyperlendAdapter)**: connects to `HyperlendClient` for lending/supply caps inside the HyperLend strategy.
|
|
522
521
|
|
|
@@ -538,8 +537,8 @@ just create-wallets
|
|
|
538
537
|
poetry run pytest -k smoke -v
|
|
539
538
|
|
|
540
539
|
# 3. Test your specific contribution
|
|
541
|
-
poetry run pytest wayfinder_paths/
|
|
542
|
-
poetry run pytest wayfinder_paths/
|
|
540
|
+
poetry run pytest wayfinder_paths/strategies/my_strategy/ -v # Strategy
|
|
541
|
+
poetry run pytest wayfinder_paths/adapters/my_adapter/ -v # Adapter
|
|
543
542
|
```
|
|
544
543
|
|
|
545
544
|
### Testing Your Contribution
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Configuration Guide
|
|
2
2
|
|
|
3
|
-
This guide explains how to configure your
|
|
3
|
+
This guide explains how to configure your strategies for local testing.
|
|
4
4
|
|
|
5
5
|
## Quick Setup
|
|
6
6
|
|
|
@@ -64,7 +64,7 @@ cp wayfinder_paths/config.example.json config.json
|
|
|
64
64
|
|
|
65
65
|
**Other Optional fields:**
|
|
66
66
|
- `user.main_wallet_address` - Override auto-loaded main wallet
|
|
67
|
-
- `user.
|
|
67
|
+
- `user.strategy_wallet_address` - Override auto-loaded strategy wallet
|
|
68
68
|
|
|
69
69
|
**Security Note:** Never commit `config.json` to version control. Add it to `.gitignore`.
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ These are managed automatically by Wayfinder:
|
|
|
74
74
|
- `api_base_url` - Wayfinder backend API endpoint
|
|
75
75
|
- `wallets_path` - Location of generated wallets.json
|
|
76
76
|
- `job_id` - Auto-generated by Wayfinder
|
|
77
|
-
- `job_type` - Set to "
|
|
77
|
+
- `job_type` - Set to "strategy"
|
|
78
78
|
|
|
79
79
|
## Strategy Configuration
|
|
80
80
|
|
|
@@ -125,8 +125,8 @@ Each strategy should have its own dedicated wallet for isolation and security. T
|
|
|
125
125
|
When you run a strategy:
|
|
126
126
|
1. The system uses the strategy directory name (e.g., `hyperlend_stable_yield_strategy`) to look up a wallet
|
|
127
127
|
2. It searches `wallets.json` for a wallet with a matching `label`
|
|
128
|
-
3. If found, that wallet is used as the strategy's
|
|
129
|
-
4. Falls back to `
|
|
128
|
+
3. If found, that wallet is used as the strategy's dedicated wallet
|
|
129
|
+
4. Falls back to `strategy_wallet_address` from config if explicitly provided
|
|
130
130
|
|
|
131
131
|
### Creating a Strategy with Wallet
|
|
132
132
|
|
|
@@ -188,11 +188,11 @@ Strategies access wallets the same way as before:
|
|
|
188
188
|
|
|
189
189
|
```python
|
|
190
190
|
# In strategy code
|
|
191
|
-
|
|
191
|
+
strategy_address = self.config.get("strategy_wallet").get("address")
|
|
192
192
|
main_address = self.config.get("main_wallet").get("address")
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
The
|
|
195
|
+
The strategy wallet is automatically populated from the wallet with label matching the strategy directory name.
|
|
196
196
|
|
|
197
197
|
## Loading Configuration
|
|
198
198
|
|
|
@@ -206,14 +206,14 @@ For programmatic use:
|
|
|
206
206
|
|
|
207
207
|
```python
|
|
208
208
|
from pathlib import Path
|
|
209
|
-
from core.config import
|
|
209
|
+
from core.config import StrategyJobConfig
|
|
210
210
|
import json
|
|
211
211
|
|
|
212
212
|
# Load from file
|
|
213
213
|
with open("config.json") as f:
|
|
214
214
|
config_data = json.load(f)
|
|
215
215
|
|
|
216
|
-
config =
|
|
216
|
+
config = StrategyJobConfig.from_dict(config_data)
|
|
217
217
|
|
|
218
218
|
# Configuration now has:
|
|
219
219
|
# - config.user.username & password (for Wayfinder backend)
|
|
@@ -223,13 +223,13 @@ config = VaultConfig.from_dict(config_data)
|
|
|
223
223
|
|
|
224
224
|
## Wallet Abstraction
|
|
225
225
|
|
|
226
|
-
The
|
|
226
|
+
The strategy system supports multiple wallet types through a wallet abstraction layer. By default, adapters use local private keys (self-custodial wallets), but you can inject custom wallet providers for custodial wallets like Privy or Turnkey.
|
|
227
227
|
|
|
228
228
|
### Default Behavior (Local Wallets)
|
|
229
229
|
|
|
230
230
|
By default, adapters use `LocalWalletProvider` which resolves private keys from:
|
|
231
231
|
- `wallets.json` (matched by address)
|
|
232
|
-
- Environment variables (`PRIVATE_KEY`, `
|
|
232
|
+
- Environment variables (`PRIVATE_KEY`, `PRIVATE_KEY_STRATEGY`)
|
|
233
233
|
- Wallet config in `config.json`
|
|
234
234
|
|
|
235
235
|
No code changes are required - existing strategies continue to work.
|
|
@@ -264,7 +264,7 @@ See `core/wallets/README.md` for details on implementing custom wallet providers
|
|
|
264
264
|
|
|
265
265
|
## Authentication with Wayfinder Backend
|
|
266
266
|
|
|
267
|
-
Wayfinder
|
|
267
|
+
Wayfinder Paths supports **dual authentication** for different use cases:
|
|
268
268
|
|
|
269
269
|
### 1. Service Account Authentication (API Key)
|
|
270
270
|
|
|
@@ -318,7 +318,7 @@ export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
|
318
318
|
The `username` and `password` in your config authenticate with the Wayfinder backend to access:
|
|
319
319
|
- Wallet management
|
|
320
320
|
- Transaction signing services
|
|
321
|
-
-
|
|
321
|
+
- Strategy execution services
|
|
322
322
|
|
|
323
323
|
```json
|
|
324
324
|
{
|
|
@@ -343,7 +343,7 @@ The `username` and `password` in your config authenticate with the Wayfinder bac
|
|
|
343
343
|
|
|
344
344
|
## Configuration in Strategies
|
|
345
345
|
|
|
346
|
-
Strategies receive configuration automatically through
|
|
346
|
+
Strategies receive configuration automatically through StrategyJob:
|
|
347
347
|
|
|
348
348
|
```python
|
|
349
349
|
from core.strategies.Strategy import Strategy
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
"""Wayfinder Path - Trading strategies and adapters for automated
|
|
1
|
+
"""Wayfinder Path - Trading strategies and adapters for automated strategy management"""
|
|
2
2
|
|
|
3
3
|
__version__ = "0.1.0"
|
|
4
4
|
|
|
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,
|
|
11
|
-
|
|
12
|
+
StrategyJob,
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
@@ -17,5 +18,5 @@ __all__ = [
|
|
|
17
18
|
"Strategy",
|
|
18
19
|
"StatusDict",
|
|
19
20
|
"StatusTuple",
|
|
20
|
-
"
|
|
21
|
+
"StrategyJob",
|
|
21
22
|
]
|