@@ -111,24 +111,31 @@ The `CryptoCompareClient` (`src/api/cryptocompare.py`) implements:
111111│ ┌──────────────────────────────────────────────────────────┐ │
112112│ │ GET /data/top/mktcapfull?limit=100&page=0..11 │ │
113113│ │ Requests: TOP_N_BY_MARKETCAP_TO_FETCH = 1200 coins │ │
114- │ │ Returns: symbol, name, market_cap, price, volume │ │
114+ │ │ │ │
115+ │ │ Two sources of coins: │ │
116+ │ │ • WITH USD data: ~886 coins (have market cap, price) │ │
117+ │ │ • WITHOUT USD data: ~490 coins (no market cap from API) │ │
118+ │ │ │ │
115119│ │ Output: data/processed/coins_to_download.json │ │
120+ │ │ data/processed/no_usd_data.csv │ │
116121│ │ data/processed/fetch_metadata.json │ │
117122│ └──────────────────────────────────────────────────────────┘ │
118123│ │ │
119124│ ▼ │
120- │ Step 2: Filter Coins (Local) │
125+ │ Step 2: Filter Coins (Local) - applies to BOTH sources │
121126│ ┌──────────────────────────────────────────────────────────┐ │
122127│ │ Remove: wrapped, staked, bridged, stablecoins │ │
123128│ │ Keep: BTC (for BTC/USD chart) │ │
129+ │ │ Mark coins: has_usd_data=true/false │ │
124130│ │ Output: data/processed/download_skipped.csv │ │
125131│ └──────────────────────────────────────────────────────────┘ │
126132│ │ │
127133│ ▼ │
128134│ Step 3: Fetch Historical Prices (CryptoCompare) │
129135│ ┌──────────────────────────────────────────────────────────┐ │
130- │ │ Altcoins: GET /data/v2/histoday?fsym=ETH&tsym=BTC │ │
131- │ │ BTC: GET /data/v2/histoday?fsym=BTC&tsym=USD │ │
136+ │ │ Altcoins (USD coins): GET ...?fsym=ETH&tsym=BTC │ │
137+ │ │ Altcoins (no-USD): GET ...?fsym=RYO&tsym=BTC │ │
138+ │ │ BTC: GET ...?fsym=BTC&tsym=USD │ │
132139│ │ Pagination: Multiple requests for 4000+ days │ │
133140│ │ Output: data/raw/prices/{coin}-{quote}.parquet │ │
134141│ │ data/processed/download_failed.csv (if any) │ │
@@ -155,19 +162,23 @@ The pipeline generates a `data_status.html` page (at `site/data_status.html`) th
155162
156163| Card | Description |
157164| ------| -------------|
158- | ** Coins Requested** | Number requested from API (` TOP_N_BY_MARKETCAP_TO_FETCH = 1200 ` ), with sublabel showing actual returned count |
159- | ** Coins with Price Data** | Coins that have downloaded price data in cache |
165+ | ** Coins Requested** | Number requested from API (1200), with sublabel showing breakdown: "886 USD + 490 no-USD" |
166+ | ** Coins Accepted** | Total coins accepted for download, with sublabel showing how many from no-USD source |
167+ | ** Coins Downloaded** | Coins that have downloaded price data in cache |
160168| ** Skipped / Failed** | Filtered coins (stablecoins, wrapped) + failed downloads (no BTC pair) |
161- | ** Total Pairs Downloaded ** | Sum of all quote pairs (BTC + USD) across all coins |
169+ | ** Total Pairs** | Sum of all quote pairs (BTC + USD) across all coins |
162170
163171### Downloaded Coins Table
164172
165173Lists all coins with price data, including:
166174- Symbol and name (linked to CryptoCompare)
175+ - ** Source** column: "USD" for coins with market cap data, "BTC-only" for coins discovered without USD data
167176- ** Quote(s)** column: Shows available pairs (BTC, USD, or both)
168- - Market cap
177+ - Market cap (shows "N/A" for BTC-only coins)
169178- Date range and days of data
170179
180+ Coins are sorted: USD coins first (by market cap descending), then BTC-only coins.
181+
171182### Skipped / Failed Table
172183
173184Lists all excluded coins with reasons:
@@ -183,10 +194,11 @@ Lists all excluded coins with reasons:
183194
184195| File | Description |
185196| ------| -------------|
186- | ` coins_to_download.json ` | Coins accepted for price fetching |
187- | ` download_skipped.csv ` | Coins filtered out (stablecoins, wrapped, etc.) |
197+ | ` coins_to_download.json ` | Coins accepted for price fetching. Each coin has ` has_usd_data ` field (true/false) |
198+ | ` download_skipped.csv ` | Coins filtered out (stablecoins, wrapped, etc.) from USD coins |
188199| ` download_failed.csv ` | Coins that failed to download (no BTC pair on CryptoCompare) |
189- | ` fetch_metadata.json ` | Metadata: coins_requested, coins_returned, timestamp |
200+ | ` no_usd_data.csv ` | Coins returned by API without USD price data (before filtering) |
201+ | ` fetch_metadata.json ` | Metadata: coins_requested, coins_fetched, coins_no_usd_data, coins_accepted, etc. |
190202| ` total2_index.parquet ` | Calculated TOTAL2 index |
191203
192204### Price Data Files
@@ -351,6 +363,7 @@ USE_YESTERDAY_AS_END_DATE = True
351363COINS_TO_DOWNLOAD_JSON = PROCESSED_DIR / " coins_to_download.json"
352364DOWNLOAD_SKIPPED_CSV = PROCESSED_DIR / " download_skipped.csv"
353365DOWNLOAD_FAILED_CSV = PROCESSED_DIR / " download_failed.csv"
366+ NO_USD_DATA_CSV = PROCESSED_DIR / " no_usd_data.csv"
354367FETCH_METADATA_JSON = PROCESSED_DIR / " fetch_metadata.json"
355368```
356369
@@ -379,9 +392,31 @@ This error occurs when a coin doesn't have a direct trading pair on CryptoCompar
379392
380393### Discrepancy between requested and returned coins
381394
382- - ` TOP_N_BY_MARKETCAP_TO_FETCH ` (default: 1200) is the number requested
383- - The API may return fewer coins if some don't have USD price data
384- - The ` fetch_metadata.json ` file records both values for transparency
395+ The CryptoCompare market cap API returns coins in two categories:
396+
397+ 1 . ** Coins WITH USD data** (~ 886 of 1200): Have market cap, price, and volume data
398+ 2 . ** Coins WITHOUT USD data** (~ 490 of 1200): Returned by API but missing USD price data
399+
400+ Lower-ranked coins (smaller market cap) are more likely to lack USD data on CryptoCompare. These coins often still have BTC trading pairs available via the ` histoday ` endpoint.
401+
402+ ** Halvix now processes both categories:**
403+ - Filters both (removes stablecoins, wrapped, etc.)
404+ - Marks each coin with ` has_usd_data: true/false ` in ` coins_to_download.json `
405+ - Downloads BTC pairs for all altcoins (no change in behavior)
406+ - Shows "BTC-only" source in the data status page for coins without USD data
407+
408+ The ` fetch_metadata.json ` file records the full breakdown:
409+ ``` json
410+ {
411+ "coins_requested" : 1200 ,
412+ "coins_fetched" : 886 ,
413+ "coins_no_usd_data" : 490 ,
414+ "coins_no_usd_filtered" : 7 ,
415+ "coins_no_usd_accepted" : 483 ,
416+ "coins_filtered" : 31 ,
417+ "coins_accepted" : 1338
418+ }
419+ ```
385420
386421---
387422
0 commit comments