# Cryptofeed

Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges.

- Repository: https://github.com/2025Emma/vibe-coding-cn (23122 stars)
- Category: Data and ML
- License: MIT
- Last updated: 2025-12-17
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add 2025Emma/vibe-coding-cn --skill cryptofeed -g -a claude-code -y`
Codex: `npx skills add 2025Emma/vibe-coding-cn --skill cryptofeed -g -a codex -y`
Cursor: `npx skills add 2025Emma/vibe-coding-cn --skill cryptofeed -g -a cursor -y`
Gemini CLI: `npx skills add 2025Emma/vibe-coding-cn --skill cryptofeed -g -a gemini-cli -y`

## Description

Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges. WebSocket streaming, normalized data, order books, trades, tickers. Python library for algorithmic trading and market data analysis.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Cryptofeed Skill

Comprehensive assistance with Cryptofeed development - a Python library for handling cryptocurrency exchange data feeds with normalized and standardized results.

## When to Use This Skill

This skill should be triggered when:
- Working with real-time cryptocurrency market data
- Implementing WebSocket streaming from crypto exchanges
- Building algorithmic trading systems
- Processing order book updates, trades, or ticker data
- Connecting to 40+ cryptocurrency exchanges
- Using normalized exchange APIs
- Implementing market data backends (Redis, MongoDB, Kafka, etc.)

## Quick Reference

### Installation

```python
# Basic installation
pip install cryptofeed

# With all optional backends
pip install cryptofeed[all]
```

### Basic Usage Pattern

```python
from cryptofeed import FeedHandler
from cryptofeed.exchanges import Coinbase, Bitfinex
from cryptofeed.defines import TICKER, TRADES, L2_BOOK

# Define callbacks
def ticker_callback(data):
    print(f"Ticker: {data}")

def trade_callback(data):
    print(f"Trade: {data}")

# Create feed handler
fh = FeedHandler()

# Add exchange feeds
fh.add_feed(Coinbase(
    symbols=['BTC-USD'],
    channels=[TICKER],
    callbacks={TICKER: ticker_callback}
))

fh.add_feed(Bitfinex(
    symbols=['BTC-USD'],
    channels=[TRADES],
    callbacks={TRADES: trade_callback}
))

# Start receiving data
fh.run()
```

### National Best Bid/Offer (NBBO)

```python
from cryptofeed import FeedHandler
from cryptofeed.exchanges import Coinbase, Gemini, Kraken

def nbbo_update(symbol, bid, bid_size, ask, ask_size, bid_feed, ask_feed):
    print(f'Pair: {symbol} Bid: {bid:.2f} ({bid_size:.6f}) from {bid_feed}')
    print(f'Ask: {ask:.2f} ({ask_size:.6f}) from {ask_feed}')

f = FeedHandler()
f.add_nbbo([Coinbase, Kraken, Gemini], ['BTC-USD'], nbbo_update)
f.run()
```

## Supported Exchanges (40+)

The rest: https://github.com/2025Emma/vibe-coding-cn/blob/HEAD/i18n/zh/skills/cryptofeed/SKILL.md
