Pair discovery and equity backtests can read nichedb - #34
Merged
Merged
Conversation
Every five minutes the arb daemon asked CoinGecko and four exchanges which pairs exist, how much they traded and what they are worth; a backtest asked Yahoo for a year of bars. nichedb.dev keeps both now. With NICHEDB_CRYPTO=1 discovery reads the dollar-quoted pairs and the assets by market cap from nichedb, about ten requests, and applies the same rules: two venues or more, fifty thousand dollars a day on each, ten million of market cap, a null volume passing the way the Gemini sentinel did. With NICHEDB_MARKETS=1 a backtest reads the symbol's history item and falls back to Yahoo when the window is longer than the item, the item is stale, or the symbol is too new. Either switch off means no request; any failure means the old path. The client is its own package, since the web route and the CLI need it and must not pull the exchange feeds in to read a bar. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP
ThreatCrush Security Scan14 finding(s) HIGH/CRITICAL: 5 | MEDIUM: 8 | LOW: 1
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Every five minutes the arb daemon asked CoinGecko and four exchanges which pairs exist, how much they traded and what they are worth; a backtest asked Yahoo for a year of bars. nichedb.dev keeps both now (0.8.0:
cryptocollection,marketskindhistory), so this adds the other path behind switches and leaves the old one in place.NICHEDB_CRYPTO=1:discoverPairs()reads the dollar-quoted pairs and the assets by market cap from nichedb (about ten requests per five-minute refresh) and applies the same rules: USD books only, two venues or more, $50k a day on each (a null volume passes, the way the Gemini sentinel did), $10M of market cap when known. Any failure or an empty answer → the CoinGecko + venue path, logged once. The existing five-minute cache covers both.NICHEDB_MARKETS=1: the web backtest route and the CLI read the symbol'shistoryitem (one request) before Alpaca/Yahoo, and fall back when the window is longer than 400 days, the item is missing or stale, or does not reach back to the requested start.The client is its own workspace package,
@b1dz/source-nichedb, since the web route and the CLI need it and must not pull the exchange feeds in to read a bar. Switches off ⇒ zero nichedb requests (tested in all three consumers). Real-time feeds, private APIs, DEX, Pump.fun and DealDash are untouched.Tests: source-nichedb 30, crypto-arb 64 (5 new), web 100 (4 new), cli 31 (3 new);
tsc --noEmitclean. Repo lint is broken on main by typescript-eslint vs TS 7 (pre-existing, unrelated).Noticed, not fixed:
normalizeKrakenBase('XXBTZUSD')yieldsBT, so the live discovery path maps Kraken's BTC book toBT-USD; the nichedb path usesdata.baseand is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP