refactor(hyperliquid): align column names with fills + add token discovery + Copilot fixes#295
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #294. Two commits:
Schema rename + token split
Aligns column names with the substreams
fillstable and splits out base/quote token symbols so Token API can support discovery filters like?base_token=HYPEon/markets.spot_coin→coinso JOINs againstfills/state_ohlcv_fillscan useUSING (coin).pair_name→market_nameto match the API surface (Hyperliquid Marketstag,/markets/*endpoints) — the column applies uniformly across spot, perps, and builder dexes.base_tokenandquote_tokencolumns split from the resolved name, populating discovery filters.The canonical
PURR/USDCpair is still included in the table; itscoinvalue matchesmarket_namebecause HL uses the human pair name as the on-chain identifier for that one pre-HIP-1 pair, butbase_token/quote_tokenstill resolve toPURR/USDCso it shows up under?base_token=PURR.Copilot review fixes (from #294)
HYPERLIQUID_FETCH_TIMEOUT_MS: fall back to 30 s default when the env value is missing, non-numeric, or non-positive (previouslyparseInt('garbage')yieldedNaN, causing the timeout to fire immediately).refresh_timefromDateTime('UTC')toDateTime64(3, 'UTC')with millisecond precision so closely-spaced polls produce distinct version values for ReplacingMergeTree merges.HYPERLIQUID_INFO_URLinsiderun()instead of at module-load time, so tests no longer need cache-busting?nocache=...imports.🤖 Generated with Claude Code