From 9be02b47f98c5efce3fac90b3004e5156c0b071d Mon Sep 17 00:00:00 2001 From: ramseshk Date: Wed, 5 Aug 2026 03:02:50 +0000 Subject: [PATCH] Clean architecture: Paper=Mainnet, Live=Testnet, Historical=Mainnet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Live node: testnet-only API for prices/orderbook/instruments (removed mainnet fallback, added resilience wrappers) - Paper trader: mainnet-only API — simulates with real Hyperliquid data $120K paper capital, 12 strategies, mainnet mark prices - Historical backtests: mainnet candle API (unchanged, already correct) - All three tiers: strategy_equity tracking, dynamic perp lookup, win_rate fix (pnl_net/pnl_gross), CSS contrast improvement --- live/node.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/live/node.py b/live/node.py index 689eed4..3ec41e7 100644 --- a/live/node.py +++ b/live/node.py @@ -26,7 +26,6 @@ log = logging.getLogger("ftdt-quant") METRICS_FILE = "/tmp/ftdt-metrics.json" TESTNET_API = "https://api.hyperliquid-testnet.xyz/info" -MAINNET_INFO = "https://api.hyperliquid.xyz/info" TOTAL_EQUITY = 898.0 RESERVE = 398.0 MAKER_FEE = 0.0002 @@ -99,7 +98,7 @@ def write_metrics(addr): "total_equity":TOTAL_EQUITY+total_pnl,"base_equity":TOTAL_EQUITY, "total_pnl":total_pnl,"total_pnl_pct":total_pnl_pct, "reserve":RESERVE,"equity_history":equity_history[-600:], - "strategies":STRATEGIES,"trades":trades_log[-200:],"status":"running", + "strategies":STRATEGIES,"trades":trades_log[-200:],"status":"running","testnet_up":True, "strategy_equity":{k: v[-600:] for k,v in strategy_equity.items()}, "open_positions":[],"open_orders":[] } @@ -180,7 +179,6 @@ async def main(): for inst in perps.values(): client.cache_instrument(inst) except Exception as e: log.warning(f"SDK instrument load failed: {e}") - # Fallback: load from raw API (mainnet) if SDK failed or returned empty if not perps: log.info("Loading perps from mainnet API directly...") try: