Skip to content

Use CoinGecko for KuCoin futures top movers#1012

Open
carkod wants to merge 1 commit into
masterfrom
codex/integrate-coingecko-for-top-gainers-ranking
Open

Use CoinGecko for KuCoin futures top movers#1012
carkod wants to merge 1 commit into
masterfrom
codex/integrate-coingecko-for-top-gainers-ranking

Conversation

@carkod
Copy link
Copy Markdown
Owner

@carkod carkod commented May 15, 2026

Motivation

  • KuCoin futures per-contract 24h percentage change is not available from the existing KuCoin/spot endpoints used for charts, so a reliable discovery/ranking source is needed for top-gainers/top-losers.

Description

  • Added CoinGecko.get_kucoin_futures_tickers() which calls GET /derivatives/exchanges/kumex?include_tickers=unexpired and returns per-contract tickers.
  • Wired a CoinGecko client into MarketDominationController and replaced the previous Binance/spot-based ranking with filtering for USDT perpetual KuCoin futures and sorting by h24_percentage_change.
  • Updated chart endpoints tests in api/tests/test_charts.py to monkeypatch CoinGecko.get_kucoin_futures_tickers and assert the top-gainers/top-losers payloads, and added a controller-level test in test_market_domination_controller.py to exercise filtering and ordering logic.
  • Added request timeouts (10s) to CoinGecko client calls for better network resilience.

Testing

  • Ran code formatting with make format and fixes were applied with no issues.
  • Ran the test suite with env ... make test (test environment variables provided) and the full test run completed successfully with all tests passing (120 passed).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant