4.5 KiB
4.5 KiB
Changelog
All notable changes to this project will be documented in this file.
[2025-12-21]
Optimization
- Low Volatility Optimization:
- Introduced
BASE_REBALANCE_THRESHOLD_PCTconfiguration flag inclp_hedger.py. - Increased base rebalance threshold from 0.05 (5%) to 0.08 (8%) to reduce "churn" (excessive trading) during low volatility/sideways markets.
- This change aims to improve net profitability by ensuring that rebalancing fees are only paid when the delta imbalance is statistically significant.
- Introduced
- Logging Improvements:
- Updated
[IDLE]log format to show estimated BUY (B) and SELL (S) trigger price levels instead of raw delta difference. This provides better visual feedback on how far the price is from the next rebalance.
- Updated
- Fishing Order Logic:
- Implemented a "Fishing Order" mechanism that keeps a Maker order (10% of hedge size) resting at the
entry_pricewhile in the safe zone. - Logic Update: Configured to always place a Limit BUY at the entry price (when Px > Entry) to reduce the hedge size at break-even.
- Fix: Updated position tracking to use the actual Hedge Entry Price from Hyperliquid instead of the LP Strategy entry price.
- Integrated fishing order tracking to distinguish it from standard rebalance orders.
- Implemented a "Fishing Order" mechanism that keeps a Maker order (10% of hedge size) resting at the
[2025-12-20]
Added
- Dynamic Rebalance Threshold: Implemented volatility-based threshold adjustment in
clp_hedger.py.- Volatility Metric: Added
calculate_volatility()using rolling Standard Deviation (5-minute window). - Adaptive Logic: Rebalance threshold now scales (1.0x - 3.0x) based on market volatility to reduce fee costs during "chop" (noise) while maintaining precision during trends.
- Safety Cap: Threshold is capped at 20% of the range width to prevent dangerous unhedged exposure in tight ranges.
- Log Explanation:
(Vol: 0.029% x1.0 | Thresh: 7.4%)- Vol: Standard Deviation of last 300 prices relative to mean.
- x1.0 (Multiplier): Scales based on reference volatility (0.05%). Multiplier =
max(1.0, Vol / 0.05%). - Thresh: The % of max delta deviation required to trigger a trade. Calculated as
Base (Range Dependent) * Multiplier.
- Volatility Metric: Added
- Execution Analysis Logs: Added Bid/Ask book state to the
[TRIG]log inclp_hedger.py. This data enables "Shadow Logging" to compare current Taker execution costs against theoretical Maker savings (Spread capture + Rebates). - Shadow Order Simulator: Implemented a simulation engine in
clp_hedger.pyto verify if Maker orders would have filled.- Trigger: Created automatically alongside every Taker trade.
- Logic: Tracks if the market price crosses the passive Maker price within a timeframe.
- Extended Timeout: Fixed at 600s (10 min) to capture the full distribution of fill times. This data will help determine the optimal "Time to Live" for future Maker strategies.
- Goal: Gather empirical data to determine if switching to Maker orders is profitable.
Documentation
- Analysis: Completed optimization analysis in
todo/optymalization rebalance_threshol.mdwith technical justification for using StdDev over ATR.
[2025-12-19]
Added
- Dynamic Edge Proximity: Implemented
get_dynamic_edge_proximityinclp_hedger.pyandclp_scalper_hedger.py. This scales the edge protection buffer based on position size (Base 4% + 4% per $10k, capped at 15%) to better protect larger positions. - Large Hedge Override: Added logic to bypass trade cooldowns in
clp_hedger.pywhen a rebalance requirement significantly exceeds the threshold (LARGE_HEDGE_MULTIPLIER).
Fixed
- Double Logging: Resolved duplicate log entries in the terminal by setting
logger.propagate = Falsein bothclp_hedger.pyandclp_scalper_hedger.pyand cleaning up root logger handlers. - Bug Fixes: Fixed a
NameError(undefineddynamic_buffer) and anIndentationErrorinclp_hedger.py.
Removed
- clp_scalper_hedger.py: Removed the scalper-hedger script as the main
clp_hedger.pynow includes all necessary edge protection and dynamic proximity features.
Configuration Changes
- Weekend Strategy Update:
- Updated
uniswap_manager.py: Increased capital to $2,000 (TARGET_INVESTMENT_VALUE_USDC) and set a tighter range of +/- 1% (RANGE_WIDTH_PCT = 0.01). - Updated
clp_hedger.py: LoweredMIN_THRESHOLD_ETHto 0.008 for finer control and reducedDYNAMIC_THRESHOLD_MULTIPLIERto 1.2 for lower volatility environment.
- Updated