Skip to content

refactor(hyperliquid): align column names with fills + add token discovery + Copilot fixes#295

Merged
0237h merged 2 commits into
mainfrom
feat/hyperliquid-market-name
May 5, 2026
Merged

refactor(hyperliquid): align column names with fills + add token discovery + Copilot fixes#295
0237h merged 2 commits into
mainfrom
feat/hyperliquid-market-name

Conversation

@0237h
Copy link
Copy Markdown
Contributor

@0237h 0237h commented May 5, 2026

Follow-up to #294. Two commits:

Schema rename + token split

Aligns column names with the substreams fills table and splits out base/quote token symbols so Token API can support discovery filters like ?base_token=HYPE on /markets.

  • Rename spot_coincoin so JOINs against fills/state_ohlcv_fills can use USING (coin).
  • Rename pair_namemarket_name to match the API surface (Hyperliquid Markets tag, /markets/* endpoints) — the column applies uniformly across spot, perps, and builder dexes.
  • Add base_token and quote_token columns split from the resolved name, populating discovery filters.

The canonical PURR/USDC pair is still included in the table; its coin value matches market_name because HL uses the human pair name as the on-chain identifier for that one pre-HIP-1 pair, but base_token/quote_token still resolve to PURR/USDC so it shows up under ?base_token=PURR.

Copilot review fixes (from #294)

  • Validate HYPERLIQUID_FETCH_TIMEOUT_MS: fall back to 30 s default when the env value is missing, non-numeric, or non-positive (previously parseInt('garbage') yielded NaN, causing the timeout to fire immediately).
  • Switch refresh_time from DateTime('UTC') to DateTime64(3, 'UTC') with millisecond precision so closely-spaced polls produce distinct version values for ReplacingMergeTree merges.
  • Read HYPERLIQUID_INFO_URL inside run() instead of at module-load time, so tests no longer need cache-busting ?nocache=... imports.

🤖 Generated with Claude Code

0237h and others added 2 commits May 5, 2026 13:33
…mbols

- Rename `spot_coin` to `coin` so Token API can JOIN with `USING (coin)`
  against the matching column on `fills` and `state_ohlcv_fills`.
- Rename `pair_name` to `market_name` to match the API surface
  (`Hyperliquid Markets` tag, `/markets/*` endpoints) — applies uniformly
  across spot, perps, and builder dexes.
- Add `base_token` and `quote_token` columns split from the resolved name.
  Powers discovery filters like `?base_token=HYPE` on `/markets`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Validate `HYPERLIQUID_FETCH_TIMEOUT_MS`: fall back to 30s default when
  env is missing, non-numeric, or non-positive (was: parseInt('garbage')
  yielded NaN, causing setTimeout to abort immediately).
- Switch `refresh_time` from `DateTime('UTC')` to `DateTime64(3, 'UTC')`
  with millisecond-precision timestamps so closely-spaced polls produce
  distinct version values for ReplacingMergeTree merges.
- Read `HYPERLIQUID_INFO_URL` inside `run()` instead of at module-load
  time, so tests no longer need cache-busting `?nocache=...` imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@0237h 0237h merged commit 93406b9 into main May 5, 2026
1 check passed
@0237h 0237h deleted the feat/hyperliquid-market-name branch May 5, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant