other
- Location
scripts/hl_signals.py:31- Finding
Synthetic Financial Data Is Presented as Current Market Signals
- Content
View full analysis
dict: """ Production: POST {type: "metaAndAssetCtxs"} to HL_API_URL and parse. Mock: deterministic synthesis keyed on coin + minute bucket. """ bucket = int(time.time() // 60) rng = random.Random(sum(ord(c) for c in coin) + bucket) base_prices = { "BTC": 65_000, "ETH": 3_400, "SOL": 150, "ARB": 1.10, "OP": 2.30, "AVAX": 35, "DOGE": 0.16, "WIF": 2.10, "INJ": 28, "SUI": 1.05, "APT": 8.5, "TIA": 6.8, "LINK": 14, "MATIC": 0.72, "ATOM": 8.4, "TON": 6.5, "PEPE": 0.000009, "TRX": 0.13, "LTC": 85, "BCH": 410, } px = base_prices.get(coin, 10.0) drift = rng.uniform(-0.03, 0.03) mark = round(px * (1 + drift), 6 if px < 0.001 else 4) funding_1h = round(rng.gauss(0.0001, 0.0004), 6) oi_usd = rng.uniform(10_000_000, 800_000_000) oi_chg = rng.gauss(0, 5) return { "coin": coin, "mark_price": mark, "oracle_price": round(px, 6 if px < 0.001 else 4), "funding_rate_1h": funding_1h, "open_interest_usd": round(oi_usd, 0), "oi_change_24h_pct": round(oi_chg, 2), "next_funding_eta_seconds": rng.randint(60, 3600), } def fetch_mock_binance_funding(coin: str) -> dict: bucket = int(time.time() // 60) rng = random.Random(sum(ord(c) for c in coin) * 7 + bucket) funding_8h = round(rng.gauss(0.0001, 0.0003), 6) return {"coin": c ...[truncated 3797 chars]- Remediation
View remediation
