wayfinder-paths 0.1.8__tar.gz → 0.1.9__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.8 → wayfinder_paths-0.1.9}/PKG-INFO +5 -15
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/README.md +4 -14
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/pyproject.toml +1 -1
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/CONFIG_GUIDE.md +5 -14
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/README.md +1 -1
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/adapter.py +0 -51
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperlend_adapter/adapter.py +0 -7
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/adapter.py +0 -54
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/test_adapter_live.py +1 -1
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/README.md +1 -1
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/pool_adapter/README.md +1 -77
- wayfinder_paths-0.1.9/wayfinder_paths/adapters/pool_adapter/adapter.py +88 -0
- wayfinder_paths-0.1.9/wayfinder_paths/adapters/pool_adapter/examples.json +43 -0
- wayfinder_paths-0.1.9/wayfinder_paths/adapters/pool_adapter/test_adapter.py +86 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/README.md +1 -1
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/AuthClient.py +0 -3
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/ClientManager.py +1 -22
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/WalletClient.py +0 -8
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/WayfinderClient.py +9 -14
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/__init__.py +0 -8
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/protocols.py +0 -60
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/config.py +5 -45
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/engine/StrategyJob.py +0 -3
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/services/base.py +0 -49
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/services/local_evm_txn.py +3 -82
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/services/local_token_txn.py +61 -70
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/services/web3_service.py +0 -2
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/settings.py +8 -8
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/strategies/Strategy.py +1 -5
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/utils/evm_helpers.py +7 -12
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/wallets/README.md +3 -6
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/run_strategy.py +29 -32
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/scripts/make_wallets.py +1 -25
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/scripts/run_strategy.py +0 -2
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/snapshot_mixin.py +1 -3
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/strategy.py +86 -137
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/test_strategy.py +96 -58
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/README.md +2 -2
- wayfinder_paths-0.1.9/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/examples.json +11 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py +106 -28
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/test_strategy.py +53 -14
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/stablecoin_yield_strategy/strategy.py +1 -6
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/stablecoin_yield_strategy/test_strategy.py +0 -4
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/strategy/test_strategy.py +0 -4
- wayfinder_paths-0.1.8/wayfinder_paths/adapters/pool_adapter/adapter.py +0 -210
- wayfinder_paths-0.1.8/wayfinder_paths/adapters/pool_adapter/examples.json +0 -100
- wayfinder_paths-0.1.8/wayfinder_paths/adapters/pool_adapter/test_adapter.py +0 -172
- wayfinder_paths-0.1.8/wayfinder_paths/core/clients/SimulationClient.py +0 -192
- wayfinder_paths-0.1.8/wayfinder_paths/core/clients/TransactionClient.py +0 -63
- wayfinder_paths-0.1.8/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/examples.json +0 -8
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/LICENSE +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/abis/generic/erc20.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/balance_adapter/README.md +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/balance_adapter/adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/balance_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/balance_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/balance_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperlend_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperlend_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperlend_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/executor.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/paired_filler.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/test_utils.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/hyperliquid_adapter/utils.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/pool_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/pool_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/token_adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/config.example.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/conftest.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/adapters/BaseAdapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/adapters/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/adapters/base.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/adapters/models.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/analytics/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/analytics/bootstrap.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/analytics/stats.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/analytics/test_analytics.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/BRAPClient.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/HyperlendClient.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/LedgerClient.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/PoolClient.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/TokenClient.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/clients/sdk_example.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/constants/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/constants/base.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/constants/erc20_abi.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/constants/hyperlend_abi.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/engine/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/engine/manifest.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/services/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/strategies/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/strategies/base.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/strategies/descriptors.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/utils/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/utils/wallets.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/wallets/WalletManager.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/core/wallets/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/enso.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/erc20.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/evm.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/hyper_evm.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/hyperlend.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/hyperliquid.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/moonwell.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/prjx.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/policies/util.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/scripts/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/scripts/create_strategy.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/scripts/validate_manifests.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/README.md +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/constants.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/basis_trading_strategy/types.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/config.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/hyperlend_stable_yield_strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/stablecoin_yield_strategy/README.md +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/stablecoin_yield_strategy/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/strategies/stablecoin_yield_strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/adapter/README.md +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/adapter/adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/adapter/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/adapter/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/adapter/test_adapter.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/strategy/README.md +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/strategy/examples.json +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/strategy/manifest.yaml +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/templates/strategy/strategy.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/tests/__init__.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/tests/test_smoke_manifest.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/tests/test_test_coverage.py +0 -0
- {wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/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.9
|
|
4
4
|
Summary: Wayfinder Path: strategies and adapters
|
|
5
5
|
Author: Wayfinder
|
|
6
6
|
Author-email: dev@wayfinder.ai
|
|
@@ -54,9 +54,6 @@ cp wayfinder_paths/config.example.json config.json
|
|
|
54
54
|
# Run a strategy locally (one-shot status check)
|
|
55
55
|
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --action status --config config.json
|
|
56
56
|
|
|
57
|
-
export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
58
|
-
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --config config.json
|
|
59
|
-
|
|
60
57
|
# Run continuously (production mode)
|
|
61
58
|
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --config config.json
|
|
62
59
|
```
|
|
@@ -213,7 +210,7 @@ The platform uses a unified client system for all API interactions. Clients are
|
|
|
213
210
|
|
|
214
211
|
### Clients vs Adapters
|
|
215
212
|
|
|
216
|
-
- **Clients**: Low-level, reusable service wrappers that talk to networks and external APIs. They handle auth, headers, retries, and response parsing, and expose generic capabilities (e.g., token info, tx building). Examples: `TokenClient`, `
|
|
213
|
+
- **Clients**: Low-level, reusable service wrappers that talk to networks and external APIs. They handle auth, headers, retries, and response parsing, and expose generic capabilities (e.g., token info, tx building). Examples: `TokenClient`, `WalletClient`.
|
|
217
214
|
- **Adapters**: Strategy-facing integrations for a specific exchange/protocol. They compose one or more clients to implement a manifest of capabilities (e.g., `supply`, `borrow`, `place_order`). Adapters encapsulate protocol-specific semantics and raise `NotImplementedError` for unsupported ops.
|
|
218
215
|
|
|
219
216
|
Recommended usage:
|
|
@@ -415,14 +412,7 @@ strategy = StablecoinYieldStrategy(
|
|
|
415
412
|
)
|
|
416
413
|
```
|
|
417
414
|
|
|
418
|
-
**Option B:
|
|
419
|
-
|
|
420
|
-
```bash
|
|
421
|
-
export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
422
|
-
# All clients will automatically discover and use this
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
**Option C: Add to config.json**
|
|
415
|
+
**Option B: Add to config.json**
|
|
426
416
|
|
|
427
417
|
```json
|
|
428
418
|
{
|
|
@@ -435,7 +425,7 @@ export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
|
435
425
|
}
|
|
436
426
|
```
|
|
437
427
|
|
|
438
|
-
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
428
|
+
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
439
429
|
|
|
440
430
|
**Note:** API keys in `config.json` are loaded directly by `WayfinderClient` via `_load_config_credentials()`, not through the `UserConfig` or `SystemConfig` dataclasses. This allows flexible credential loading.
|
|
441
431
|
|
|
@@ -516,7 +506,7 @@ class MyStrategy(Strategy):
|
|
|
516
506
|
super().__init__(api_key=api_key) # Pass to base class for auto-discovery
|
|
517
507
|
self.config = config or {}
|
|
518
508
|
web3_service = DefaultWeb3Service(self.config)
|
|
519
|
-
# Adapters automatically discover API key from
|
|
509
|
+
# Adapters automatically discover API key from constructor or config.json
|
|
520
510
|
balance_adapter = BalanceAdapter(self.config, web3_service=web3_service)
|
|
521
511
|
self.register_adapters([balance_adapter])
|
|
522
512
|
self.balance_adapter = balance_adapter
|
|
@@ -31,9 +31,6 @@ cp wayfinder_paths/config.example.json config.json
|
|
|
31
31
|
# Run a strategy locally (one-shot status check)
|
|
32
32
|
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --action status --config config.json
|
|
33
33
|
|
|
34
|
-
export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
35
|
-
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --config config.json
|
|
36
|
-
|
|
37
34
|
# Run continuously (production mode)
|
|
38
35
|
poetry run python wayfinder_paths/run_strategy.py stablecoin_yield_strategy --config config.json
|
|
39
36
|
```
|
|
@@ -190,7 +187,7 @@ The platform uses a unified client system for all API interactions. Clients are
|
|
|
190
187
|
|
|
191
188
|
### Clients vs Adapters
|
|
192
189
|
|
|
193
|
-
- **Clients**: Low-level, reusable service wrappers that talk to networks and external APIs. They handle auth, headers, retries, and response parsing, and expose generic capabilities (e.g., token info, tx building). Examples: `TokenClient`, `
|
|
190
|
+
- **Clients**: Low-level, reusable service wrappers that talk to networks and external APIs. They handle auth, headers, retries, and response parsing, and expose generic capabilities (e.g., token info, tx building). Examples: `TokenClient`, `WalletClient`.
|
|
194
191
|
- **Adapters**: Strategy-facing integrations for a specific exchange/protocol. They compose one or more clients to implement a manifest of capabilities (e.g., `supply`, `borrow`, `place_order`). Adapters encapsulate protocol-specific semantics and raise `NotImplementedError` for unsupported ops.
|
|
195
192
|
|
|
196
193
|
Recommended usage:
|
|
@@ -392,14 +389,7 @@ strategy = StablecoinYieldStrategy(
|
|
|
392
389
|
)
|
|
393
390
|
```
|
|
394
391
|
|
|
395
|
-
**Option B:
|
|
396
|
-
|
|
397
|
-
```bash
|
|
398
|
-
export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
399
|
-
# All clients will automatically discover and use this
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
**Option C: Add to config.json**
|
|
392
|
+
**Option B: Add to config.json**
|
|
403
393
|
|
|
404
394
|
```json
|
|
405
395
|
{
|
|
@@ -412,7 +402,7 @@ export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
|
412
402
|
}
|
|
413
403
|
```
|
|
414
404
|
|
|
415
|
-
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
405
|
+
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
416
406
|
|
|
417
407
|
**Note:** API keys in `config.json` are loaded directly by `WayfinderClient` via `_load_config_credentials()`, not through the `UserConfig` or `SystemConfig` dataclasses. This allows flexible credential loading.
|
|
418
408
|
|
|
@@ -493,7 +483,7 @@ class MyStrategy(Strategy):
|
|
|
493
483
|
super().__init__(api_key=api_key) # Pass to base class for auto-discovery
|
|
494
484
|
self.config = config or {}
|
|
495
485
|
web3_service = DefaultWeb3Service(self.config)
|
|
496
|
-
# Adapters automatically discover API key from
|
|
486
|
+
# Adapters automatically discover API key from constructor or config.json
|
|
497
487
|
balance_adapter = BalanceAdapter(self.config, web3_service=web3_service)
|
|
498
488
|
self.register_adapters([balance_adapter])
|
|
499
489
|
self.balance_adapter = balance_adapter
|
|
@@ -52,7 +52,6 @@ cp wayfinder_paths/config.example.json config.json
|
|
|
52
52
|
**Option 1: Service Account (API Key) - Recommended for Production**
|
|
53
53
|
- `user.api_key` - Your Wayfinder API key for service account authentication (loaded directly by clients from config.json)
|
|
54
54
|
- OR `system.api_key` - System-level API key (alternative location, loaded directly by clients)
|
|
55
|
-
- OR set `WAYFINDER_API_KEY` environment variable
|
|
56
55
|
- OR pass `api_key` parameter to strategy constructor
|
|
57
56
|
|
|
58
57
|
**Note:** API keys in `config.json` are loaded directly by `WayfinderClient` via `_load_config_credentials()`, not through the `UserConfig` or `SystemConfig` dataclasses. This is intentional to allow flexible credential loading.
|
|
@@ -229,7 +228,6 @@ The strategy system supports multiple wallet types through a wallet abstraction
|
|
|
229
228
|
|
|
230
229
|
By default, adapters use `LocalWalletProvider` which resolves private keys from:
|
|
231
230
|
- `wallets.json` (matched by address)
|
|
232
|
-
- Environment variables (`PRIVATE_KEY`, `PRIVATE_KEY_STRATEGY`)
|
|
233
231
|
- Wallet config in `config.json`
|
|
234
232
|
|
|
235
233
|
No code changes are required - existing strategies continue to work.
|
|
@@ -270,7 +268,7 @@ Wayfinder Paths supports **dual authentication** for different use cases:
|
|
|
270
268
|
|
|
271
269
|
**Best for:** Backend services, automated systems, and production deployments with higher rate limits.
|
|
272
270
|
|
|
273
|
-
API keys provide service account authentication and are automatically discovered by all clients. You can provide an API key in
|
|
271
|
+
API keys provide service account authentication and are automatically discovered by all clients. You can provide an API key in two ways:
|
|
274
272
|
|
|
275
273
|
#### Option A: Strategy Constructor (Programmatic)
|
|
276
274
|
```python
|
|
@@ -278,16 +276,11 @@ from wayfinder_paths.strategies.stablecoin_yield_strategy.strategy import Stable
|
|
|
278
276
|
|
|
279
277
|
strategy = StablecoinYieldStrategy(
|
|
280
278
|
config={...},
|
|
281
|
-
api_key="sk_live_abc123..." #
|
|
279
|
+
api_key="sk_live_abc123..." # API key is auto-discovered by all clients
|
|
282
280
|
)
|
|
283
281
|
```
|
|
284
282
|
|
|
285
|
-
#### Option B:
|
|
286
|
-
```bash
|
|
287
|
-
export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
#### Option C: config.json
|
|
283
|
+
#### Option B: config.json
|
|
291
284
|
```json
|
|
292
285
|
{
|
|
293
286
|
"user": {
|
|
@@ -299,14 +292,12 @@ export WAYFINDER_API_KEY="sk_live_abc123..."
|
|
|
299
292
|
}
|
|
300
293
|
```
|
|
301
294
|
|
|
302
|
-
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
295
|
+
**Priority Order:** Constructor parameter > `config.json` (user.api_key or system.api_key)
|
|
303
296
|
|
|
304
297
|
**How It Works:**
|
|
305
|
-
- When a strategy receives an `api_key`, it sets `os.environ["WAYFINDER_API_KEY"]`
|
|
306
298
|
- All clients created by adapters automatically discover the API key from:
|
|
307
299
|
- Constructor parameter (if passed)
|
|
308
300
|
- `config.json` (via `WayfinderClient._load_config_credentials()` which reads `user.api_key` or `system.api_key`)
|
|
309
|
-
- `WAYFINDER_API_KEY` environment variable
|
|
310
301
|
- API keys are included in **all** API requests (including public endpoints) for rate limiting
|
|
311
302
|
- No need to pass API keys explicitly to adapters or clients—they auto-discover it
|
|
312
303
|
- **Note:** API keys in `config.json` are loaded directly by clients, not stored in the `UserConfig` or `SystemConfig` dataclasses
|
|
@@ -379,7 +370,7 @@ To use custom RPC endpoints, update the `strategy.rpc_urls` section in `config.j
|
|
|
379
370
|
**Issue:** "Authentication failed"
|
|
380
371
|
- **If using API key:**
|
|
381
372
|
- Verify API key is correct and not expired
|
|
382
|
-
- Check that API key is set in one of: constructor parameter
|
|
373
|
+
- Check that API key is set in one of: constructor parameter or `config.json` (user.api_key or system.api_key)
|
|
383
374
|
- Ensure API key has proper permissions for the operations you're performing
|
|
384
375
|
- **If using OAuth:**
|
|
385
376
|
- Check that `username` and `password` are correct in `config.json`
|
{wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/README.md
RENAMED
|
@@ -17,7 +17,7 @@ The adapter uses the BRAPClient which automatically handles authentication and A
|
|
|
17
17
|
|
|
18
18
|
The BRAPClient will automatically:
|
|
19
19
|
- Use the WAYFINDER_API_URL from settings
|
|
20
|
-
- Handle authentication via
|
|
20
|
+
- Handle authentication via config.json
|
|
21
21
|
- Manage token refresh and retry logic
|
|
22
22
|
|
|
23
23
|
## Usage
|
{wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/brap_adapter/adapter.py
RENAMED
|
@@ -10,10 +10,6 @@ from wayfinder_paths.core.adapters.BaseAdapter import BaseAdapter
|
|
|
10
10
|
from wayfinder_paths.core.adapters.models import SWAP
|
|
11
11
|
from wayfinder_paths.core.clients.BRAPClient import BRAPClient, BRAPQuote
|
|
12
12
|
from wayfinder_paths.core.clients.LedgerClient import TransactionRecord
|
|
13
|
-
from wayfinder_paths.core.clients.SimulationClient import (
|
|
14
|
-
SimulationClient,
|
|
15
|
-
SimulationResult,
|
|
16
|
-
)
|
|
17
13
|
from wayfinder_paths.core.clients.TokenClient import TokenClient
|
|
18
14
|
from wayfinder_paths.core.constants import DEFAULT_SLIPPAGE
|
|
19
15
|
from wayfinder_paths.core.constants.base import DEFAULT_TRANSACTION_TIMEOUT
|
|
@@ -45,7 +41,6 @@ class BRAPAdapter(BaseAdapter):
|
|
|
45
41
|
config: dict[str, Any] | None = None,
|
|
46
42
|
*,
|
|
47
43
|
web3_service: Web3Service,
|
|
48
|
-
simulation: bool = False,
|
|
49
44
|
):
|
|
50
45
|
super().__init__("brap_adapter", config)
|
|
51
46
|
self.brap_client = BRAPClient()
|
|
@@ -55,8 +50,6 @@ class BRAPAdapter(BaseAdapter):
|
|
|
55
50
|
self.web3_service = web3_service
|
|
56
51
|
self.wallet_provider = web3_service.evm_transactions
|
|
57
52
|
self.token_transactions = web3_service.token_transactions
|
|
58
|
-
self.simulation = simulation
|
|
59
|
-
self.simulation_client = SimulationClient() if simulation else None
|
|
60
53
|
|
|
61
54
|
async def get_swap_quote(
|
|
62
55
|
self,
|
|
@@ -367,12 +360,6 @@ class BRAPAdapter(BaseAdapter):
|
|
|
367
360
|
if not approve_success:
|
|
368
361
|
return (False, approve_response)
|
|
369
362
|
|
|
370
|
-
if self.simulation:
|
|
371
|
-
simulation = await self._simulate_swap(
|
|
372
|
-
from_token, to_token, from_address, chain_id, quote
|
|
373
|
-
)
|
|
374
|
-
return (True, {"quote": quote, "simulation": simulation})
|
|
375
|
-
|
|
376
363
|
broadcast_success, broadcast_response = await self._broadcast_transaction(
|
|
377
364
|
transaction
|
|
378
365
|
)
|
|
@@ -677,44 +664,6 @@ class BRAPAdapter(BaseAdapter):
|
|
|
677
664
|
/ 10 ** int(decimals)
|
|
678
665
|
)
|
|
679
666
|
|
|
680
|
-
async def _simulate_swap(
|
|
681
|
-
self,
|
|
682
|
-
from_token: dict[str, Any],
|
|
683
|
-
to_token: dict[str, Any],
|
|
684
|
-
from_address: str,
|
|
685
|
-
chain_id: int,
|
|
686
|
-
quote: dict[str, Any],
|
|
687
|
-
) -> SimulationResult:
|
|
688
|
-
client = await self._get_simulation_client()
|
|
689
|
-
initial_balances = {"native": "5000000000000000000"}
|
|
690
|
-
if from_token.get("address"):
|
|
691
|
-
initial_balances[from_token.get("address")] = "1000000000000000000000000"
|
|
692
|
-
|
|
693
|
-
slippage = quote.get("slippage") or quote.get("slippage_percent")
|
|
694
|
-
if isinstance(slippage, str):
|
|
695
|
-
try:
|
|
696
|
-
slippage = float(slippage)
|
|
697
|
-
except ValueError:
|
|
698
|
-
slippage = DEFAULT_SLIPPAGE
|
|
699
|
-
slippage = slippage or DEFAULT_SLIPPAGE
|
|
700
|
-
|
|
701
|
-
amount = quote.get("input_amount") or quote.get("inputAmount") or "0"
|
|
702
|
-
return await client.simulate_swap(
|
|
703
|
-
from_token_address=from_token.get("address"),
|
|
704
|
-
to_token_address=to_token.get("address"),
|
|
705
|
-
from_chain_id=chain_id,
|
|
706
|
-
to_chain_id=chain_id,
|
|
707
|
-
amount=str(amount),
|
|
708
|
-
from_address=from_address,
|
|
709
|
-
slippage=float(slippage),
|
|
710
|
-
initial_balances=initial_balances,
|
|
711
|
-
)
|
|
712
|
-
|
|
713
|
-
async def _get_simulation_client(self) -> SimulationClient:
|
|
714
|
-
if not self.simulation_client:
|
|
715
|
-
self.simulation_client = SimulationClient()
|
|
716
|
-
return self.simulation_client
|
|
717
|
-
|
|
718
667
|
def _chain_id(self, chain: Any) -> int:
|
|
719
668
|
if isinstance(chain, dict):
|
|
720
669
|
chain_id = chain.get("id") or chain.get("chain_id")
|
|
@@ -12,7 +12,6 @@ from wayfinder_paths.core.clients.HyperlendClient import (
|
|
|
12
12
|
MarketEntry,
|
|
13
13
|
StableMarket,
|
|
14
14
|
)
|
|
15
|
-
from wayfinder_paths.core.clients.SimulationClient import SimulationClient
|
|
16
15
|
from wayfinder_paths.core.constants.base import DEFAULT_TRANSACTION_TIMEOUT
|
|
17
16
|
from wayfinder_paths.core.constants.hyperlend_abi import (
|
|
18
17
|
POOL_ABI,
|
|
@@ -37,16 +36,12 @@ class HyperlendAdapter(BaseAdapter):
|
|
|
37
36
|
self,
|
|
38
37
|
config: dict[str, Any],
|
|
39
38
|
web3_service: Web3Service,
|
|
40
|
-
simulation: bool = False,
|
|
41
39
|
) -> None:
|
|
42
40
|
super().__init__("hyperlend_adapter", config)
|
|
43
41
|
cfg = config or {}
|
|
44
42
|
adapter_cfg = cfg.get("hyperlend_adapter") or {}
|
|
45
43
|
|
|
46
44
|
self.hyperlend_client = HyperlendClient()
|
|
47
|
-
self.simulation = simulation
|
|
48
|
-
self.simulation_client = SimulationClient() if simulation else None
|
|
49
|
-
|
|
50
45
|
self.web3 = web3_service
|
|
51
46
|
self.token_txn_service = web3_service.token_transactions
|
|
52
47
|
|
|
@@ -237,8 +232,6 @@ class HyperlendAdapter(BaseAdapter):
|
|
|
237
232
|
return await self._broadcast_transaction(approve_tx)
|
|
238
233
|
|
|
239
234
|
async def _execute(self, tx: dict[str, Any]) -> tuple[bool, Any]:
|
|
240
|
-
if self.simulation:
|
|
241
|
-
return True, {"simulation": tx}
|
|
242
235
|
return await self.web3.broadcast_transaction(
|
|
243
236
|
tx, wait_for_receipt=True, timeout=DEFAULT_TRANSACTION_TIMEOUT
|
|
244
237
|
)
|
|
@@ -74,7 +74,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
74
74
|
self,
|
|
75
75
|
config: dict[str, Any] | None = None,
|
|
76
76
|
*,
|
|
77
|
-
simulation: bool = False,
|
|
78
77
|
executor: HyperliquidExecutor | None = None,
|
|
79
78
|
) -> None:
|
|
80
79
|
super().__init__("hyperliquid_adapter", config)
|
|
@@ -85,7 +84,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
85
84
|
"Install with: poetry add hyperliquid"
|
|
86
85
|
)
|
|
87
86
|
|
|
88
|
-
self.simulation = simulation
|
|
89
87
|
self._cache = SimpleCache()
|
|
90
88
|
self._executor = executor
|
|
91
89
|
|
|
@@ -481,13 +479,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
481
479
|
Returns:
|
|
482
480
|
(success, response_data or error_message)
|
|
483
481
|
"""
|
|
484
|
-
if self.simulation:
|
|
485
|
-
self.logger.info(
|
|
486
|
-
f"[SIMULATION] place_market_order: asset={asset_id}, "
|
|
487
|
-
f"is_buy={is_buy}, size={size}, address={address}"
|
|
488
|
-
)
|
|
489
|
-
return True, {"simulation": True, "status": "ok"}
|
|
490
|
-
|
|
491
482
|
if not self._executor:
|
|
492
483
|
raise NotImplementedError(
|
|
493
484
|
"No Hyperliquid executor configured. "
|
|
@@ -525,12 +516,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
525
516
|
Returns:
|
|
526
517
|
(success, response_data or error_message)
|
|
527
518
|
"""
|
|
528
|
-
if self.simulation:
|
|
529
|
-
self.logger.info(
|
|
530
|
-
f"[SIMULATION] cancel_order: asset={asset_id}, oid={order_id}"
|
|
531
|
-
)
|
|
532
|
-
return True, {"simulation": True, "status": "ok"}
|
|
533
|
-
|
|
534
519
|
if not self._executor:
|
|
535
520
|
raise NotImplementedError(
|
|
536
521
|
"No Hyperliquid executor configured. "
|
|
@@ -565,12 +550,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
565
550
|
Returns:
|
|
566
551
|
(success, response_data or error_message)
|
|
567
552
|
"""
|
|
568
|
-
if self.simulation:
|
|
569
|
-
self.logger.info(
|
|
570
|
-
f"[SIMULATION] update_leverage: asset={asset_id}, leverage={leverage}"
|
|
571
|
-
)
|
|
572
|
-
return True, {"simulation": True, "status": "ok"}
|
|
573
|
-
|
|
574
553
|
if not self._executor:
|
|
575
554
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
576
555
|
|
|
@@ -590,10 +569,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
590
569
|
address: str,
|
|
591
570
|
) -> tuple[bool, dict[str, Any]]:
|
|
592
571
|
"""Transfer USDC from spot to perp balance."""
|
|
593
|
-
if self.simulation:
|
|
594
|
-
self.logger.info(f"[SIMULATION] transfer_spot_to_perp: {amount} USDC")
|
|
595
|
-
return True, {"simulation": True, "status": "ok"}
|
|
596
|
-
|
|
597
572
|
if not self._executor:
|
|
598
573
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
599
574
|
|
|
@@ -611,10 +586,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
611
586
|
address: str,
|
|
612
587
|
) -> tuple[bool, dict[str, Any]]:
|
|
613
588
|
"""Transfer USDC from perp to spot balance."""
|
|
614
|
-
if self.simulation:
|
|
615
|
-
self.logger.info(f"[SIMULATION] transfer_perp_to_spot: {amount} USDC")
|
|
616
|
-
return True, {"simulation": True, "status": "ok"}
|
|
617
|
-
|
|
618
589
|
if not self._executor:
|
|
619
590
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
620
591
|
|
|
@@ -647,13 +618,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
647
618
|
Returns:
|
|
648
619
|
(success, response_data or error_message)
|
|
649
620
|
"""
|
|
650
|
-
if self.simulation:
|
|
651
|
-
self.logger.info(
|
|
652
|
-
f"[SIMULATION] place_stop_loss: asset={asset_id}, "
|
|
653
|
-
f"trigger={trigger_price}, size={size}"
|
|
654
|
-
)
|
|
655
|
-
return True, {"simulation": True, "status": "ok"}
|
|
656
|
-
|
|
657
621
|
if not self._executor:
|
|
658
622
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
659
623
|
|
|
@@ -758,10 +722,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
758
722
|
|
|
759
723
|
Note: This is an L1 withdrawal handled by the Hyperliquid executor (signing required).
|
|
760
724
|
"""
|
|
761
|
-
if self.simulation:
|
|
762
|
-
self.logger.info(f"[SIMULATION] withdraw: {amount} USDC")
|
|
763
|
-
return True, {"simulation": True, "status": "ok"}
|
|
764
|
-
|
|
765
725
|
if not self._executor:
|
|
766
726
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
767
727
|
|
|
@@ -856,13 +816,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
856
816
|
Returns:
|
|
857
817
|
(success, response_data or error_message)
|
|
858
818
|
"""
|
|
859
|
-
if self.simulation:
|
|
860
|
-
self.logger.info(
|
|
861
|
-
f"[SIMULATION] approve_builder_fee: builder={builder}, "
|
|
862
|
-
f"rate={max_fee_rate}, address={address}"
|
|
863
|
-
)
|
|
864
|
-
return True, {"simulation": True, "status": "ok"}
|
|
865
|
-
|
|
866
819
|
if not self._executor:
|
|
867
820
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
868
821
|
|
|
@@ -903,13 +856,6 @@ class HyperliquidAdapter(BaseAdapter):
|
|
|
903
856
|
Returns:
|
|
904
857
|
(success, response_data or error_message)
|
|
905
858
|
"""
|
|
906
|
-
if self.simulation:
|
|
907
|
-
self.logger.info(
|
|
908
|
-
f"[SIMULATION] place_limit_order: asset={asset_id}, "
|
|
909
|
-
f"is_buy={is_buy}, price={price}, size={size}"
|
|
910
|
-
)
|
|
911
|
-
return True, {"simulation": True, "status": "ok"}
|
|
912
|
-
|
|
913
859
|
if not self._executor:
|
|
914
860
|
raise NotImplementedError("No Hyperliquid executor configured.")
|
|
915
861
|
|
|
@@ -17,7 +17,7 @@ from wayfinder_paths.adapters.hyperliquid_adapter.adapter import HyperliquidAdap
|
|
|
17
17
|
@pytest.fixture
|
|
18
18
|
def live_adapter():
|
|
19
19
|
"""Create adapter connected to real Hyperliquid API."""
|
|
20
|
-
return HyperliquidAdapter(config={}
|
|
20
|
+
return HyperliquidAdapter(config={})
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class TestSpotAssetIDs:
|
{wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/ledger_adapter/README.md
RENAMED
|
@@ -17,7 +17,7 @@ The adapter uses the LedgerClient which automatically handles authentication and
|
|
|
17
17
|
|
|
18
18
|
The LedgerClient will automatically:
|
|
19
19
|
- Use the WAYFINDER_API_URL from settings
|
|
20
|
-
- Handle authentication via
|
|
20
|
+
- Handle authentication via config.json
|
|
21
21
|
- Manage token refresh and retry logic
|
|
22
22
|
|
|
23
23
|
## Usage
|
{wayfinder_paths-0.1.8 → wayfinder_paths-0.1.9}/wayfinder_paths/adapters/pool_adapter/README.md
RENAMED
|
@@ -17,7 +17,7 @@ The adapter uses the PoolClient which automatically handles authentication and A
|
|
|
17
17
|
The PoolClient will automatically:
|
|
18
18
|
|
|
19
19
|
- Use the WAYFINDER_API_URL from settings
|
|
20
|
-
- Handle authentication via
|
|
20
|
+
- Handle authentication via config.json
|
|
21
21
|
- Manage token refresh and retry logic
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
@@ -45,41 +45,6 @@ else:
|
|
|
45
45
|
print(f"Error: {data}")
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
### Find High Yield Pools
|
|
49
|
-
|
|
50
|
-
```python
|
|
51
|
-
success, data = await adapter.find_high_yield_pools(
|
|
52
|
-
min_apy=0.03, # 3% minimum APY
|
|
53
|
-
min_tvl=500000, # $500k minimum TVL
|
|
54
|
-
stablecoin_only=True,
|
|
55
|
-
network_codes=["base", "ethereum"]
|
|
56
|
-
)
|
|
57
|
-
if success:
|
|
58
|
-
pools = data.get("pools", [])
|
|
59
|
-
print(f"Found {len(pools)} high-yield pools")
|
|
60
|
-
for pool in pools:
|
|
61
|
-
print(f"Pool: {pool.get('id')} - APY: {pool.get('llama_apy_pct')}%")
|
|
62
|
-
else:
|
|
63
|
-
print(f"Error: {data}")
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Get Pool Analytics
|
|
67
|
-
|
|
68
|
-
```python
|
|
69
|
-
success, data = await adapter.get_pool_analytics(
|
|
70
|
-
pool_ids=["pool-123", "pool-456"]
|
|
71
|
-
)
|
|
72
|
-
if success:
|
|
73
|
-
analytics = data.get("analytics", [])
|
|
74
|
-
for pool_analytics in analytics:
|
|
75
|
-
pool = pool_analytics.get("pool", {})
|
|
76
|
-
combined_apy = pool_analytics.get("combined_apy", 0)
|
|
77
|
-
tvl_usd = pool_analytics.get("tvl_usd", 0)
|
|
78
|
-
print(f"Pool: {pool.get('name')} - APY: {combined_apy:.2%} - TVL: ${tvl_usd:,.0f}")
|
|
79
|
-
else:
|
|
80
|
-
print(f"Error: {data}")
|
|
81
|
-
```
|
|
82
|
-
|
|
83
48
|
### Get Llama Matches
|
|
84
49
|
|
|
85
50
|
```python
|
|
@@ -110,47 +75,6 @@ else:
|
|
|
110
75
|
|
|
111
76
|
## Advanced Usage
|
|
112
77
|
|
|
113
|
-
### Filtering High Yield Pools
|
|
114
|
-
|
|
115
|
-
The `find_high_yield_pools` method provides powerful filtering capabilities:
|
|
116
|
-
|
|
117
|
-
```python
|
|
118
|
-
# Find stablecoin pools with high yield on specific networks
|
|
119
|
-
success, data = await adapter.find_high_yield_pools(
|
|
120
|
-
min_apy=0.05, # 5% minimum APY
|
|
121
|
-
min_tvl=1000000, # $1M minimum TVL
|
|
122
|
-
stablecoin_only=True, # Only stablecoin pools
|
|
123
|
-
network_codes=["base", "arbitrum"] # Specific networks
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
if success:
|
|
127
|
-
pools = data.get("pools", [])
|
|
128
|
-
# Pools are automatically sorted by APY (highest first)
|
|
129
|
-
best_pool = pools[0] if pools else None
|
|
130
|
-
if best_pool:
|
|
131
|
-
print(f"Best pool: {best_pool.get('id')} - APY: {best_pool.get('llama_apy_pct')}%")
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Comprehensive Pool Analysis
|
|
135
|
-
|
|
136
|
-
```python
|
|
137
|
-
# Get detailed analytics for specific pools
|
|
138
|
-
success, data = await adapter.get_pool_analytics(["pool-123"])
|
|
139
|
-
|
|
140
|
-
if success:
|
|
141
|
-
analytics = data.get("analytics", [])
|
|
142
|
-
for pool_analytics in analytics:
|
|
143
|
-
pool = pool_analytics.get("pool", {})
|
|
144
|
-
llama_data = pool_analytics.get("llama_data", {})
|
|
145
|
-
|
|
146
|
-
print(f"Pool: {pool.get('name')}")
|
|
147
|
-
print(f" Combined APY: {pool_analytics.get('combined_apy', 0):.2%}")
|
|
148
|
-
print(f" TVL: ${pool_analytics.get('tvl_usd', 0):,.0f}")
|
|
149
|
-
print(f" Llama APY: {llama_data.get('llama_apy_pct', 0)}%")
|
|
150
|
-
print(f" Stablecoin: {llama_data.get('llama_stablecoin', False)}")
|
|
151
|
-
print(f" IL Risk: {llama_data.get('llama_il_risk', 'unknown')}")
|
|
152
|
-
```
|
|
153
|
-
|
|
154
78
|
## API Endpoints
|
|
155
79
|
|
|
156
80
|
The adapter uses the following Wayfinder API endpoints:
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from wayfinder_paths.core.adapters.BaseAdapter import BaseAdapter
|
|
4
|
+
from wayfinder_paths.core.clients.PoolClient import (
|
|
5
|
+
LlamaMatch,
|
|
6
|
+
LlamaReport,
|
|
7
|
+
PoolClient,
|
|
8
|
+
PoolList,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PoolAdapter(BaseAdapter):
|
|
13
|
+
"""
|
|
14
|
+
Pool adapter for DeFi pool data and analytics operations.
|
|
15
|
+
|
|
16
|
+
Provides high-level operations for:
|
|
17
|
+
- Fetching pool information and metadata
|
|
18
|
+
- Getting pool analytics and reports
|
|
19
|
+
- Accessing Llama protocol data
|
|
20
|
+
- Pool discovery and filtering
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
adapter_type: str = "POOL"
|
|
24
|
+
|
|
25
|
+
def __init__(
|
|
26
|
+
self,
|
|
27
|
+
config: dict[str, Any] | None = None,
|
|
28
|
+
pool_client: PoolClient | None = None,
|
|
29
|
+
):
|
|
30
|
+
super().__init__("pool_adapter", config)
|
|
31
|
+
self.pool_client = pool_client or PoolClient()
|
|
32
|
+
|
|
33
|
+
async def get_pools_by_ids(
|
|
34
|
+
self, pool_ids: list[str], merge_external: bool | None = None
|
|
35
|
+
) -> tuple[bool, PoolList | str]:
|
|
36
|
+
"""
|
|
37
|
+
Get pool information by pool IDs.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
pool_ids: List of pool identifiers
|
|
41
|
+
merge_external: Whether to merge external data
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Tuple of (success, data) where data is pool information or error message
|
|
45
|
+
"""
|
|
46
|
+
try:
|
|
47
|
+
pool_ids_str = ",".join(pool_ids)
|
|
48
|
+
data = await self.pool_client.get_pools_by_ids(
|
|
49
|
+
pool_ids=pool_ids_str, merge_external=merge_external
|
|
50
|
+
)
|
|
51
|
+
return (True, data)
|
|
52
|
+
except Exception as e:
|
|
53
|
+
self.logger.error(f"Error fetching pools by IDs: {e}")
|
|
54
|
+
return (False, str(e))
|
|
55
|
+
|
|
56
|
+
async def get_llama_matches(self) -> tuple[bool, dict[str, LlamaMatch] | str]:
|
|
57
|
+
"""
|
|
58
|
+
Get Llama protocol matches for pools.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Tuple of (success, data) where data is Llama matches or error message
|
|
62
|
+
"""
|
|
63
|
+
try:
|
|
64
|
+
data = await self.pool_client.get_llama_matches()
|
|
65
|
+
return (True, data)
|
|
66
|
+
except Exception as e:
|
|
67
|
+
self.logger.error(f"Error fetching Llama matches: {e}")
|
|
68
|
+
return (False, str(e))
|
|
69
|
+
|
|
70
|
+
async def get_llama_reports(
|
|
71
|
+
self, identifiers: list[str]
|
|
72
|
+
) -> tuple[bool, dict[str, LlamaReport] | str]:
|
|
73
|
+
"""
|
|
74
|
+
Get Llama reports for specific identifiers.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
identifiers: List of identifiers (token IDs, addresses, pool IDs)
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Tuple of (success, data) where data is Llama reports or error message
|
|
81
|
+
"""
|
|
82
|
+
try:
|
|
83
|
+
identifiers_str = ",".join(identifiers)
|
|
84
|
+
data = await self.pool_client.get_llama_reports(identifiers=identifiers_str)
|
|
85
|
+
return (True, data)
|
|
86
|
+
except Exception as e:
|
|
87
|
+
self.logger.error(f"Error fetching Llama reports: {e}")
|
|
88
|
+
return (False, str(e))
|