Skip to content

feat: KuCoin provider — crypto OHLCV, no key, 1500 bars, all intervals#5

Merged
FaustoS88 merged 1 commit intomainfrom
feat/kucoin-provider
Mar 14, 2026
Merged

feat: KuCoin provider — crypto OHLCV, no key, 1500 bars, all intervals#5
FaustoS88 merged 1 commit intomainfrom
feat/kucoin-provider

Conversation

@FaustoS88
Copy link
Copy Markdown
Owner

Adds KuCoinProvider as a fourth free crypto data source.

What's added:

  • src/ohlcv_hub/providers/kucoin.py — implements OHLCVProvider ABC
  • Symbol normalisation: BTCUSDTBTC-USDT (KuCoin's BASE-QUOTE format)
  • Handles KuCoin's reverse-chronological response (newest-first → reversed to oldest-first)
  • Candle field mapping: KuCoin row is [ts, open, close, high, low, volume, turnover] — close at index 2, high at 3
  • All standard intervals: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w
  • No API key required
  • Wired into crypto fallback chain: Binance → CoinGecko → Kraken → KuCoin → yfinance

Tests (tests/test_kucoin.py):

  • 9 normalisation cases
  • 9 supports() cases (crypto True, stock/forex/intl False)
  • fetch() happy path: candle values, reversal, limit, all intervals, symbol format
  • fetch() error cases: unsupported interval, HTTP error, API error code, empty data, network error, malformed rows

30 tests. 212 total passing. ruff clean.

…equired

- BASE-QUOTE symbol normalisation (BTCUSDT → BTC-USDT)
- reverse-chronological response handling
- all standard intervals 1m through 1w, up to 1500 bars
- wired into crypto fallback chain after Kraken
- 30 tests: normalisation, supports, fetch happy path, error cases
- README and CHANGELOG updated
@FaustoS88 FaustoS88 merged commit 9978169 into main Mar 14, 2026
4 checks passed
@FaustoS88 FaustoS88 deleted the feat/kucoin-provider branch March 14, 2026 09:40
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