fix(crypto): restrict funding harness to crypto-native perps (match validated universe)
Live Binance fapi now lists tokenized-stock perps (MSTR/CRCL/INTC/AMD/SOXL, underlyingType= EQUITY) which dominated the high-funding qualifiers (12 of 19) but were NEVER in the validated crypto_pit backtest. Filter to exchangeInfo underlyingType==COIN (crypto-native) to keep the paper-forward test measuring the edge we actually proved. Post-filter: 7 of 212 liquid qualify (thin = current deleverage regime, filter sitting mostly in cash as designed). Tokenized-stock funding may be a separate unvalidated carry; not contaminating the Phase-1 gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,11 +43,19 @@ def get(url, tries=4):
|
||||
time.sleep(2 * (a + 1))
|
||||
|
||||
|
||||
def crypto_native():
|
||||
"""Symbols whose underlying is a crypto COIN (excludes EQUITY/KR_EQUITY/COMMODITY/INDEX/
|
||||
PREMARKET tokenized-stock perps) — matches the universe the edge was validated on."""
|
||||
info = get(f"{FAPI}/fapi/v1/exchangeInfo")
|
||||
return {s["symbol"] for s in info["symbols"] if s.get("underlyingType") == "COIN"}
|
||||
|
||||
|
||||
def universe():
|
||||
"""Liquid USDT perps: symbol -> 24h quote volume (USD)."""
|
||||
"""Liquid CRYPTO-NATIVE USDT perps: symbol -> 24h quote volume (USD)."""
|
||||
native = crypto_native()
|
||||
t = get(f"{FAPI}/fapi/v1/ticker/24hr")
|
||||
return {x["symbol"]: float(x["quoteVolume"]) for x in t
|
||||
if x["symbol"].endswith("USDT") and float(x["quoteVolume"]) > LIQ_USD}
|
||||
if x["symbol"].endswith("USDT") and x["symbol"] in native and float(x["quoteVolume"]) > LIQ_USD}
|
||||
|
||||
|
||||
def funding_hist(sym, limit=90):
|
||||
|
||||
Reference in New Issue
Block a user