arbret/backend/shared_constants.py
counterweight 549fbf4975
Step 8: Cleanup old constants
- Remove EUR_TRADE_MIN, EUR_TRADE_MAX, PREMIUM_PERCENTAGE from shared_constants.py
- Remove eurTradeMin, eurTradeMax, premiumPercentage from shared/constants.json
- Update validate_constants.py to not require removed fields
- Update seed.py and seed_e2e.py to use defaults if fields don't exist
- Update tests to handle missing constants gracefully
2025-12-26 20:27:03 +01:00

16 lines
744 B
Python

"""Load shared constants from shared/constants.json."""
import json
from pathlib import Path
_constants_path = Path(__file__).parent.parent / "shared" / "constants.json"
_constants = json.loads(_constants_path.read_text())
# Exchange constants
SLOT_DURATION_MINUTES: int = _constants["exchange"]["slotDurationMinutes"]
MIN_ADVANCE_DAYS: int = _constants["exchange"]["minAdvanceDays"]
MAX_ADVANCE_DAYS: int = _constants["exchange"]["maxAdvanceDays"]
EUR_TRADE_INCREMENT: int = _constants["exchange"]["eurTradeIncrement"]
PRICE_REFRESH_SECONDS: int = _constants["exchange"]["priceRefreshSeconds"]
PRICE_STALENESS_SECONDS: int = _constants["exchange"]["priceStalenessSeconds"]
LIGHTNING_MAX_EUR: int = _constants["exchange"]["lightningMaxEur"]