Files
uniswap_auto_clp/AGENTS.md
DiTus b22fdcf741 refactor: Standardize CLP Manager and Hedger modules & cleanup
- **clp_manager.py**: Renamed from 'uniswap_manager.py'. Standardized logic for Uniswap V3 liquidity provision.
- **clp_hedger.py**: Renamed from 'unified_hedger.py'. Consolidated hedging logic including Delta Calculation fixes, EAC (Edge Avoidance), and Fishing order implementation.
- **Cleanup**: Removed legacy 'aerodrome' folder and tools.
- **Monitoring**: Added Telegram monitoring scripts.
- **Config**: Updated gitignore to exclude market data CSVs.
2025-12-31 11:09:33 +01:00

1.8 KiB

AGENTS.md - Repository Guidelines for Agentic Coding

Project Overview

This is a Python blockchain trading system for Uniswap CLP (Concentrated Liquidity Pool) management and hedging on Hyperliquid. The system consists of CLP hedgers, Uniswap managers, and KPI tracking tools.

Build/Lint/Test Commands

# Install dependencies
pip install -r requirements.txt

# Run Python with type checking (recommended workflow)
python -m mypy clp_hedger.py
python -m mypy uniswap_manager.py

# Lint with flake8 (optional)
flake8 --max-line-length=100 *.py

# Run specific modules
python clp_hedger.py
python uniswap_manager.py

Code Style Guidelines

Imports

  • Standard library imports first, then third-party, then local imports
  • Use from typing import Optional, Dict, Any, List, Union
  • Import logging_utils with try/except fallback pattern

Types & Precision

  • Use Decimal for all financial calculations with getcontext().prec = 60
  • Function signatures: def func_name(param: Type) -> ReturnType:
  • Convert to float only for SDK compatibility at the last moment

Naming Conventions

  • Constants: UPPER_SNAKE_CASE
  • Functions/variables: lower_snake_case
  • Classes: PascalCase (rarely used)
  • Loggers: logger = logging.getLogger("MODULE_NAME")

Error Handling

  • Use try/except blocks for external dependencies (web3, hyperliquid, logging_utils)
  • Log warnings for missing optional dependencies
  • Return Decimal("0") for failed conversions, not None

Logging

  • Use structured logging with UnixMsLogFilter for timestamp consistency
  • Log to files in logs/ directory (auto-created)
  • Logger names should be uppercase: "HEDGER", "UNISWAP_MANAGER", "KPI_TRACKER"

Environment

  • Load .env files from current directory with fallback
  • Use absolute paths for cross-directory imports
  • Append project root to sys.path for local modules