wayfinder-paths 0.1.14__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wayfinder_paths/adapters/balance_adapter/README.md +19 -20
- wayfinder_paths/adapters/balance_adapter/adapter.py +91 -22
- wayfinder_paths/adapters/balance_adapter/test_adapter.py +5 -11
- wayfinder_paths/adapters/brap_adapter/README.md +22 -19
- wayfinder_paths/adapters/brap_adapter/adapter.py +95 -45
- wayfinder_paths/adapters/brap_adapter/test_adapter.py +8 -24
- wayfinder_paths/adapters/hyperlend_adapter/adapter.py +40 -42
- wayfinder_paths/adapters/hyperlend_adapter/test_adapter.py +8 -15
- wayfinder_paths/adapters/hyperliquid_adapter/test_adapter.py +6 -6
- wayfinder_paths/adapters/hyperliquid_adapter/test_adapter_live.py +12 -12
- wayfinder_paths/adapters/ledger_adapter/test_adapter.py +6 -6
- wayfinder_paths/adapters/moonwell_adapter/README.md +29 -31
- wayfinder_paths/adapters/moonwell_adapter/adapter.py +326 -364
- wayfinder_paths/adapters/moonwell_adapter/test_adapter.py +285 -189
- wayfinder_paths/adapters/pool_adapter/test_adapter.py +2 -2
- wayfinder_paths/adapters/token_adapter/test_adapter.py +4 -4
- wayfinder_paths/core/config.py +8 -47
- wayfinder_paths/core/constants/base.py +0 -1
- wayfinder_paths/core/constants/erc20_abi.py +13 -24
- wayfinder_paths/core/engine/StrategyJob.py +3 -1
- wayfinder_paths/core/services/test_local_evm_txn.py +145 -0
- wayfinder_paths/core/strategies/Strategy.py +22 -4
- wayfinder_paths/core/utils/erc20_service.py +100 -0
- wayfinder_paths/core/utils/evm_helpers.py +1 -8
- wayfinder_paths/core/utils/transaction.py +191 -0
- wayfinder_paths/core/utils/web3.py +66 -0
- wayfinder_paths/policies/erc20.py +1 -1
- wayfinder_paths/run_strategy.py +42 -6
- wayfinder_paths/strategies/basis_trading_strategy/strategy.py +263 -220
- wayfinder_paths/strategies/basis_trading_strategy/test_strategy.py +132 -155
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/README.md +0 -1
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py +123 -80
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/test_strategy.py +0 -12
- wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/README.md +6 -6
- wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/strategy.py +2270 -1328
- wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/test_strategy.py +282 -121
- wayfinder_paths/strategies/stablecoin_yield_strategy/README.md +0 -1
- wayfinder_paths/strategies/stablecoin_yield_strategy/strategy.py +107 -85
- wayfinder_paths/strategies/stablecoin_yield_strategy/test_strategy.py +0 -8
- wayfinder_paths/templates/adapter/README.md +1 -1
- wayfinder_paths/templates/strategy/README.md +1 -5
- {wayfinder_paths-0.1.14.dist-info → wayfinder_paths-0.1.16.dist-info}/METADATA +3 -41
- {wayfinder_paths-0.1.14.dist-info → wayfinder_paths-0.1.16.dist-info}/RECORD +45 -54
- {wayfinder_paths-0.1.14.dist-info → wayfinder_paths-0.1.16.dist-info}/WHEEL +1 -1
- wayfinder_paths/abis/generic/erc20.json +0 -383
- wayfinder_paths/core/clients/sdk_example.py +0 -125
- wayfinder_paths/core/engine/__init__.py +0 -5
- wayfinder_paths/core/services/__init__.py +0 -0
- wayfinder_paths/core/services/base.py +0 -130
- wayfinder_paths/core/services/local_evm_txn.py +0 -334
- wayfinder_paths/core/services/local_token_txn.py +0 -242
- wayfinder_paths/core/services/web3_service.py +0 -43
- wayfinder_paths/core/wallets/README.md +0 -88
- wayfinder_paths/core/wallets/WalletManager.py +0 -56
- wayfinder_paths/core/wallets/__init__.py +0 -7
- wayfinder_paths/scripts/run_strategy.py +0 -152
- wayfinder_paths/strategies/config.py +0 -85
- {wayfinder_paths-0.1.14.dist-info → wayfinder_paths-0.1.16.dist-info}/LICENSE +0 -0
|
@@ -121,14 +121,6 @@ def strategy():
|
|
|
121
121
|
"decimals": 6,
|
|
122
122
|
}
|
|
123
123
|
)
|
|
124
|
-
s.balance_adapter.token_transactions = AsyncMock()
|
|
125
|
-
s.balance_adapter.token_transactions.build_send = AsyncMock(
|
|
126
|
-
return_value=(True, {"transaction": "0xMOCK"})
|
|
127
|
-
)
|
|
128
|
-
s.balance_adapter.wallet_provider = AsyncMock()
|
|
129
|
-
s.balance_adapter.wallet_provider.broadcast_transaction = AsyncMock(
|
|
130
|
-
return_value=(True, {"transaction_hash": "0xCAFEBABE"})
|
|
131
|
-
)
|
|
132
124
|
# token_adapter might already be set, so check before overriding
|
|
133
125
|
if (
|
|
134
126
|
not hasattr(s.balance_adapter, "token_adapter")
|
|
@@ -205,10 +197,6 @@ def strategy():
|
|
|
205
197
|
and hasattr(s.brap_adapter, "swap_from_quote")
|
|
206
198
|
):
|
|
207
199
|
s.brap_adapter.swap_from_quote = AsyncMock(return_value=None)
|
|
208
|
-
if hasattr(s, "brap_adapter") and hasattr(s.brap_adapter, "wallet_provider"):
|
|
209
|
-
s.brap_adapter.wallet_provider.broadcast_transaction = AsyncMock(
|
|
210
|
-
return_value=(True, {"transaction_hash": "0xF00D"})
|
|
211
|
-
)
|
|
212
200
|
|
|
213
201
|
if hasattr(s, "hyperlend_adapter") and s.hyperlend_adapter:
|
|
214
202
|
s.hyperlend_adapter.get_assets_view = AsyncMock(
|
|
@@ -31,9 +31,10 @@ The position is **delta-neutral**: WETH debt offsets wstETH collateral, so PnL i
|
|
|
31
31
|
## Safety features
|
|
32
32
|
|
|
33
33
|
- **Depeg guard**: `_max_safe_F()` calculates leverage ceiling based on wstETH collateral factor and max depeg tolerance.
|
|
34
|
-
- **Delta-neutrality**: `
|
|
34
|
+
- **Delta-neutrality**: `_post_run_guard()` enforces wstETH collateral ≥ WETH debt (within tolerance) via `_reconcile_wallet_into_position()` and `_settle_weth_debt_to_target_usd()`.
|
|
35
35
|
- **Swap retries**: `_swap_with_retries()` uses progressive slippage (0.5% → 1% → 1.5%) with exponential backoff.
|
|
36
36
|
- **Health monitoring**: Automatic deleveraging when health factor drops below `MIN_HEALTH_FACTOR`.
|
|
37
|
+
- **Deterministic Base reads**: waits 2 blocks after receipts by default and pins ETH/ERC20 balance reads to the confirmed block to avoid stale RPC reads on Base.
|
|
37
38
|
- **Rollback protection**: Checks actual balances before rollback swaps to prevent failed transactions.
|
|
38
39
|
|
|
39
40
|
## Adapters used
|
|
@@ -43,7 +44,6 @@ The position is **delta-neutral**: WETH debt offsets wstETH collateral, so PnL i
|
|
|
43
44
|
- `LedgerAdapter` for net deposit tracking.
|
|
44
45
|
- `BRAPAdapter` for swap quotes and execution via Aerodrome/routing.
|
|
45
46
|
- `MoonwellAdapter` for lending, borrowing, collateral management, and position queries.
|
|
46
|
-
- `LocalTokenTxnService` via `DefaultWeb3Service` for low-level sends/approvals.
|
|
47
47
|
|
|
48
48
|
## Actions
|
|
49
49
|
|
|
@@ -58,9 +58,9 @@ The position is **delta-neutral**: WETH debt offsets wstETH collateral, so PnL i
|
|
|
58
58
|
### Update
|
|
59
59
|
|
|
60
60
|
- Checks gas balance meets maintenance threshold.
|
|
61
|
-
-
|
|
62
|
-
- Computes
|
|
63
|
-
- If HF < MIN: triggers deleveraging via `
|
|
61
|
+
- Reconciles wallet leftovers into the intended position (`_reconcile_wallet_into_position()`).
|
|
62
|
+
- Computes HF/LTV/delta from a single accounting snapshot.
|
|
63
|
+
- If HF < MIN: triggers deleveraging via `_settle_weth_debt_to_target_usd()`.
|
|
64
64
|
- If HF > MAX: executes additional leverage loops to optimize yield.
|
|
65
65
|
- Claims WELL rewards if above minimum threshold.
|
|
66
66
|
|
|
@@ -75,7 +75,7 @@ The position is **delta-neutral**: WETH debt offsets wstETH collateral, so PnL i
|
|
|
75
75
|
### Withdraw
|
|
76
76
|
|
|
77
77
|
- Sweeps miscellaneous token balances to WETH.
|
|
78
|
-
- Repays all WETH debt via `
|
|
78
|
+
- Repays all WETH debt via `_settle_weth_debt_to_target_usd(target_debt_usd=0.0, mode="exit")`.
|
|
79
79
|
- Unlends wstETH, swaps to USDC.
|
|
80
80
|
- Unlends USDC collateral.
|
|
81
81
|
- Returns USDC and remaining ETH to main wallet.
|