Files
hyper/clp_hedger_auto/AGENTS.md

1.4 KiB

AGENTS.md - CLP Hedger Project Guide

Development Commands

Installation

pip install -r requirements.txt

Running the Application

# Main hedger bot
python clp_hedger.py

# Development with debug logging
python -c "from logging_utils import setup_logging; setup_logging('debug', 'CLP_HEDGER'); import clp_hedger"

Testing

No formal test framework. Manual testing:

# Check configuration
python -c "import clp_hedger; print(clp_hedger.get_manual_position_config())"

Code Style Guidelines

Imports

  • Order: standard library → third-party → local modules
  • Add project root to sys.path for local imports
  • Use absolute imports from project root

Environment & Logging

  • Use .env files with python-dotenv
  • Use setup_logging("normal"/"debug", "MODULE_NAME") convention
  • Include emojis: 🚀, , , 🔄

Architecture

  • PascalCase classes (HyperliquidStrategy, CLPHedger)
  • Private methods start with underscore (_init_strategy)
  • Module-level constants: UPPER_SNAKE_CASE
  • Functions/variables: snake_case

Error Handling

  • Wrap API calls in try/except blocks
  • Log errors with context
  • Return None/0.0 for non-critical failures
  • Use sys.exit(1) for critical failures

Mathematical Operations

  • Use math.sqrt() for square roots
  • Implement proper rounding for API requirements
  • Handle floating-point precision appropriately