Crypto Markets
Real-time cryptocurrency market data with perpetual futures funding rate analysis.
Overview
The Crypto Markets module provides a live dashboard tracking the top 20 cryptocurrencies by market capitalization alongside perpetual futures funding rates from Binance. It is designed for risk professionals monitoring digital asset exposure, basis trades, and market sentiment.
The module consists of two sections:
- Market Overview — spot prices, market caps, volumes, 24h ranges, 7-day sparklines, and ATH distance
- Perpetual Funding Rates — current funding rates, mark/index basis, and annualized carry for the top 20 perp contracts
Access the live dashboard at /crypto.
Data Sources
Spot Market Data
| Property | Value |
|---|---|
| Provider | CoinGecko (free tier) |
| API route | /api/crypto/market |
| Client refresh | 60 seconds |
| Server cache | 60s TTL, stale-while-revalidate 120s |
| Rate limit | 30 requests/minute (CoinGecko free tier) |
| Authentication | None required |
| Timeout | 8 seconds |
Funding Rate Data
| Property | Value |
|---|---|
| Provider | Binance Futures (public API) |
| API route | /api/crypto/funding |
| Client refresh | 120 seconds |
| Server cache | 120s TTL, stale-while-revalidate 300s |
| Endpoint | fapi/v1/premiumIndex |
| Authentication | None required |
| Timeout | 8 seconds |
Both endpoints use in-memory server-side caching with configurable TTLs to stay within free-tier rate limits. No API keys are required. Errors return 502 status with empty arrays and an error message.
Tracked Assets
The following 20 assets are tracked across both spot and perpetual markets:
| # | Coin | CoinGecko ID | Binance Perp |
|---|---|---|---|
| 1 | Bitcoin | bitcoin | BTCUSDT |
| 2 | Ethereum | ethereum | ETHUSDT |
| 3 | Solana | solana | SOLUSDT |
| 4 | XRP | ripple | XRPUSDT |
| 5 | Cardano | cardano | ADAUSDT |
| 6 | Dogecoin | dogecoin | DOGEUSDT |
| 7 | Avalanche | avalanche-2 | AVAXUSDT |
| 8 | Chainlink | chainlink | LINKUSDT |
| 9 | Polkadot | polkadot | DOTUSDT |
| 10 | Polygon | polygon-pos | MATICUSDT |
| 11 | Litecoin | litecoin | LTCUSDT |
| 12 | Uniswap | uniswap | UNIUSDT |
| 13 | Stellar | stellar | XLMUSDT |
| 14 | Cosmos | cosmos | ATOMUSDT |
| 15 | NEAR | near | NEARUSDT |
| 16 | Aptos | aptos | APTUSDT |
| 17 | Arbitrum | arbitrum | ARBUSDT |
| 18 | Optimism | optimism | OPUSDT |
| 19 | Sui | sui | SUIUSDT |
| 20 | Pepe | pepe | PEPEUSDT |
Market Overview
Metrics Displayed
| Column | Description |
|---|---|
| Rank | CoinGecko market cap rank |
| Coin | Name, symbol, and CoinGecko link |
| Price | Current spot price (USD), adaptive decimal places |
| 1h / 24h / 7d | Percentage change over each period |
| Volume | 24-hour trading volume |
| Mkt Cap | Current market capitalization |
| 24h Range | Low-high gradient bar with current price indicator |
| 7d | 7-day price sparkline (downsampled to ~40 points) |
Summary Bar
The top-level summary shows:
- Total Market Cap — sum across all 20 tracked coins
- 24h Volume — aggregate trading volume
- BTC Dominance — Bitcoin's share of the tracked market cap
- Gainers / Losers — count of coins up vs. down over 24 hours
- Last Updated — timestamp of the most recent data fetch
ATH Distance
A grid of cards showing each coin's distance from its all-time high, color-coded:
| Distance from ATH | Color |
|---|---|
| Within 10% | Green |
| 10%; 30% | Amber |
| 30%; 60% | Orange |
| Greater than 60% | Red |
Price Flash
When prices update, rows briefly flash green (price up) or red (price down) for 1.2 seconds to highlight real-time changes.
Perpetual Funding Rates
What Are Funding Rates?
Perpetual futures contracts have no expiry date. To keep the perpetual price anchored to the spot index price, exchanges use a funding rate mechanism:
- Positive funding — longs pay shorts (perp trading above spot; bullish sentiment)
- Negative funding — shorts pay longs (perp trading below spot; bearish sentiment)
Funding is exchanged every 8 hours on Binance (00:00, 08:00, 16:00 UTC).
Metrics Displayed
| Column | Description |
|---|---|
| Symbol | Trading pair (e.g., BTC/USDT) |
| Mark Price | Current mark price (used for liquidations) |
| Index Price | Spot index price (weighted average across exchanges) |
| Basis | Mark-to-index premium/discount as a percentage |
| Funding Rate | Current 8-hour funding rate (%) |
| Annualized | Funding rate annualized |
| Next Funding | Time of next funding payment |
Annualization Formula
Annualized Rate = lastFundingRate * 3 * 365 * 100
- 3 — funding periods per day (every 8 hours)
- 365 — days per year
- 100 — convert to percentage
Summary Statistics
The funding rates section displays aggregate statistics:
- Average Funding Rate — mean across all 20 symbols
- Highest Annualized — most bullish signal (longs paying most)
- Lowest Annualized — most bearish signal (shorts paying most)
Interpreting Funding Rates
| Annualized Rate | Interpretation |
|---|---|
| > +30% | Extremely bullish; high cost to hold longs |
| +10% to +30% | Moderately bullish |
| -5% to +10% | Neutral / balanced positioning |
| -5% to -30% | Moderately bearish |
| < -30% | Extremely bearish; high cost to hold shorts |
Basis Trade Relevance
Funding rates are critical for cash-and-carry basis trades — buy spot, short perp, collect positive funding. The annualized rate column helps identify carry opportunities and crowded positioning.
Architecture
API Routes
/api/crypto/market → CoinGecko spot data (GET)
/api/crypto/funding → Binance perp funding rates (GET)
Components
| Component | File | Description |
|---|---|---|
| CryptoMonitor | components/crypto/CryptoMonitor.tsx | Spot market table with sorting, sparklines, ATH cards, price flash |
| FundingRates | components/crypto/FundingRates.tsx | Funding rate table with sorting, basis display, summary stats |
Page Routes
| Route | Description |
|---|---|
/crypto | Public crypto dashboard (market overview + funding rates) |
/market-risk/crypto | Admin-only crypto monitor (market overview only) |
Caching Strategy
| Endpoint | Cache TTL | Stale-While-Revalidate | Client Poll |
|---|---|---|---|
/api/crypto/market | 60s | 120s | 60s |
/api/crypto/funding | 120s | 300s | 120s |
Sorting
Both tables support click-to-sort on column headers. Clicking the active sort column toggles between ascending and descending order. The active column is highlighted in emerald with a directional arrow. Funding rates default to sorting by annualized rate (descending).