HKUDS/Vibe-Trading · error · ValueError

btc-usdt is single-asset; cross-sectional IC needs >=2 instr

Error message

btc-usdt is single-asset; cross-sectional IC needs >=2 instruments. Use a multi-symbol crypto basket (e.g. multiple OKX pairs) for meaningful results.

What it means

The btc-usdt loader yields a single instrument, but cross-sectional IC requires at least two. The tool short-circuits with this clean ValueError (surfacing as API 400 / CLI error) rather than computing a meaningless single-name IC.

Source

Thrown at agent/src/tools/alpha_bench_tool.py:155

    elif universe == "sp500":
        panel = _load_sp500_panel(start, end)
    elif universe == "btc-usdt":
        panel = _load_btc_panel(start, end)
    else:  # pragma: no cover — guarded above
        raise ValueError(f"unhandled universe {universe!r}")

    if not panel or "close" not in panel or panel["close"].empty:
        raise RuntimeError(
            f"universe {universe!r} produced empty panel for {start}..{end}; "
            "check network / token / date range"
        )

    # btc-usdt loader returns a single-column close (one instrument). Cross-
    # sectional IC needs >= 2 instruments — short-circuit with a clean error
    # that propagates to API (400) and CLI.
    close_df = panel["close"]
    if universe == "btc-usdt" and close_df.shape[1] < 2:
        raise ValueError(
            "btc-usdt is single-asset; cross-sectional IC needs >=2 instruments. "
            "Use a multi-symbol crypto basket (e.g. multiple OKX pairs) for "
            "meaningful results."
        )

    if use_cache:
        _write_pickle_cache(cache_dir, cache_path, panel)

    return panel


def _sha256_path(cache_path: Path) -> Path:
    return cache_path.with_suffix(cache_path.suffix + ".sha256")


def _cache_hmac_key(cache_dir: Path) -> bytes:
    """Return the secret backing the cache sidecar HMAC.

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Use a multi-symbol basket universe instead of the single-asset btc-usdt
  2. Register or request a multi-pair crypto universe (e.g. several OKX pairs)
  3. If single-asset analysis is the goal, use a time-series metric tool rather than the cross-sectional bench

Example fix

// before
run_alpha_bench(universe='btc-usdt', period='2023')
// after
run_alpha_bench(universe='<multi-symbol-basket>', period='2023')
Defensive patterns

Strategy: validation

Validate before calling

if universe == 'btc-usdt':
    raise SystemExit('btc-usdt is single-asset; choose a multi-symbol universe')

Type guard

def supports_cross_sectional(u: str) -> bool:
    return u != 'btc-usdt'

Prevention

When it happens

Trigger: Calling run_alpha_bench / run_bench with universe='btc-usdt' (whose close frame has exactly 1 column).

Common situations: Users testing the bench with the simplest crypto symbol available; assuming a single asset can produce rank-IC statistics.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/f286959e2641f462. Report an issue: GitHub.