Skill: tangweigang-jpg/cryptofeed-ws-feeds (version 0.3.3)

--- name: cryptofeed-ws-feeds description: |- 实时获取多个加密货币交易所的市场数据流，支持异步回调处理并将交易、行情、订单簿等数据持久化到ArcticDB时序数据库。 license: Proprietary. See LICENSE.txt in project root. compatibility: Designed for Doramagic-host ecosystem (Claude Code / openclaw / Cursor). Requires Python 3.12+ with uv package manager. metadata: version: "v6.1" blueprint_id: "finance-bp-110" compiled_at: "2026-04-22T13:00:52.892309+00:00" capability_markets: "crypto" capability_activities: "crypto-trading" sop_version: "crystal-compilation-v6.1" --- # 加密货币实时行情 (cryptofeed-ws-feeds) > 实时获取多个加密货币交易所的市场数据流，支持异步回调处理并将交易、行情、订单簿等数据持久化到ArcticDB时序数据库。 ## Pipeline `data_collection -> data_storage -> factor_computation -> target_selection -> trading_execution -> visualization` ## Top Use Cases (40 total) ### General Callback Handler Demo (`UC-101`) Demonstrates how to define and use async callback handlers for receiving real-time market data updates from cryptocurrency exchanges **Triggers**: callback handler, ticker callback, async handler ### ArcticDB Data Storage (`UC-102`) Stores cryptocurrency trade, funding, and ticker data to ArcticDB (Arctic) time-series database for persistence and later analysis **Triggers**: ArcticDB, arctic storage, time series database ### Bequant/HitBTC Exchange Features (`UC-103`) Demonstrates each supported features (ticker, trades, order book, candles) for Bequant and HitBTC exchanges which share the same API **Triggers**: Bequant, HitBTC, Bitcoin.com exchange For all **40** use cases, see [references/USE_CASES.md](references/USE_CASES.md). **Execute trigger**: `When user intent matches intent_router.uc_entries[].positive_terms AND user uses action verb (run/execute/跑/执行/backtest/fetch/collect)` ## What I'll Ask You - Target market: A-share (default), HK, or crypto? (US stocks in ZVT are half-baked — stockus_nasdaq_AAPL exists but coverage is thin) - Data source / provider: eastmoney (free, no account), joinquant (account+paid), baostock (free, good history), akshare, or qmt (broker)? - Strategy type: MACD golden-cross, MA crossover, volume breakout, fundamental screen, or custom factor? - Time range: start_timestamp and end_timestamp for backtest period - Target entity IDs: specific stocks (stock_sh_600000) or index components (SZ1000)? ## Semantic Locks (Fatal) | ID | Rule | On Violation | |---|---|---| | `SL-01` | Execute sell orders before buy orders in every trading cycle | halt | | `SL-02` | Trading signals MUST use next-bar execution (no look-ahead) | halt | | `SL-03` | Entity IDs MUST follow format entity_type_exchange_code | halt | | `SL-04` | DataFrame index MUST be MultiIndex (entity_id, timestamp) | halt | | `SL-05` | TradingSignal MUST have EXACTLY ONE of: position_pct, order_money, order_amount | halt | | `SL-06` | filter_result column semantics: True=BUY, False=SELL, None/NaN=NO ACTION | halt | | `SL-07` | Transformer MUST run BEFORE Accumulator in factor pipeline | halt | | `SL-08` | MACD parameters locked: fast=12, slow=26, signal=9 | halt | Full lock definitions: [references/LOCKS.md](references/LOCKS.md) ## Top Anti-Patterns (13 total) - **`AP-CRYPTO-TRADING-001`**: Float Arithmetic for Monetary Values - **`AP-CRYPTO-TRADING-002`**: Missing Market Initialization Before Access - **`AP-CRYPTO-TRADING-003`**: Bypassing API Facade Layer All 13 anti-patterns: [references/ANTI_PATTERNS.md](references/ANTI_PATTERNS.md) ## Evidence Quality Notice > [QUALITY NOTICE] This crystal was compiled from blueprint finance-bp-110. Evidence verify ratio = 53.1% and audit fail total = 18. Generated results may have uncaptured requirement gaps. Verify critical decisions against source files (LATEST.yaml / LATEST.jsonl). ## Reference Files | File | Contents | When to Load | |---|---|---| | [references/seed.yaml](references/seed.yaml) | V6+ 全量权威 (source-of-truth) | 有行为/决策争议时必读 | | [references/ANTI_PATTERNS.md](references/ANTI_PATTERNS.md) | 13 条跨项目反模式 | 开始实现前 | | [references/WISDOM.md](references/WISDOM.md) | 跨项目精华借鉴 | 架构决策时 | | [references/CONSTRAINTS.md](references/CONSTRAINTS.md) | domain + fatal 约束 | 规则冲突时 | | [references/USE_CASES.md](references/USE_CASES.md) | 全量 KUC-* 业务场景 | 需要完整示例时 | | [references/LOCKS.md](references/LOCKS.md) | SL-* + preconditions + hints | 生成回测/交易代码前 | | [references/COMPONENTS.md](references/COMPONENTS.md) | AST 组件地图（按 module 拆分）| 查 API 时 | --- *Compiled by Doramagic crystal-compilation-v6.1 from `finance-bp-110` blueprint at 2026-04-22T13:00:52.892309+00:00.* *See [human_summary.md](human_summary.md) for non-technical overview.*

path: human_summary.md
content: # Human Summary

> I help you build quant strategies on A-share with ZVT — from data fetch to backtest, one flow. Just tell me what you want; I'll write the code, you don't have to dig docs. (Heads up: ZVT natively supports A-share, HK, and crypto. US stocks — stockus_nasdaq_AAPL — are half-baked; don't bother for serious work.)

## What I Can Do

- **tagline**: I help you build quant strategies on A-share with ZVT — from data fetch to backtest, one flow. Just tell me what you want; I'll write the code, you don't have to dig docs. (Heads up: ZVT natively supports A-share, HK, and crypto. US stocks — stockus_nasdaq_AAPL — are half-baked; don't bother for serious work.)
- **use_cases**: ['Bequant/HitBTC Exchange Features', 'ArcticDB Data Storage', 'General Callback Handler Demo', 'A-share MACD daily golden-cross backtest with hfq price adjustment from eastmoney', 'End-to-end ZVT pipeline: FinanceRecorder + GoodCompanyFactor + StockTrader', 'Multi-factor strategy with TargetSelector (AND mode) combining MACD + volume breakout', 'Index composition data collection (SZ1000, SZ2000) with EM recorder']

## What I Ask You

- Target market: A-share (default), HK, or crypto? (US stocks in ZVT are half-baked — stockus_nasdaq_AAPL exists but coverage is thin)
- Data source / provider: eastmoney (free, no account), joinquant (account+paid), baostock (free, good history), akshare, or qmt (broker)?
- Strategy type: MACD golden-cross, MA crossover, volume breakout, fundamental screen, or custom factor?
- Time range: start_timestamp and end_timestamp for backtest period
- Target entity IDs: specific stocks (stock_sh_600000) or index components (SZ1000)?


path: references/ANTI_PATTERNS.md
content: # Anti-Patterns (Cross-Project)

Total: **13**

## ccxt (1)

### `AP-CRYPTO-TRADING-002` — Missing Market Initialization Before Access <sub>(high)</sub>

Attempting to access market data via symbol lookups before load_markets() is called leaves self.markets empty, causing KeyError or BadSymbol exceptions on all trading operations and data retrieval. This breaks the entire trading workflow at the first market interaction.

## cryptofeed (3)

### `AP-CRYPTO-TRADING-009` — Applying Order Book Deltas Before Snapshot <sub>(high)</sub>

Processing order book delta messages before receiving a snapshot for the symbol applies updates to an uninitialized or stale book state. Price levels are incorrectly added/removed, corrupting the local book representation with no way to recover without full reset.

### `AP-CRYPTO-TRADING-010` — Silent HTTP Error Handling <sub>(medium)</sub>

Ignoring non-200 HTTP response status codes without raising exceptions causes silent failures for data requests. Market data is missing or corrupted, failed requests are not retried, and downstream consumers receive incomplete data with no indication of failure.

### `AP-CRYPTO-TRADING-011` — Missing Sequence Number Validation <sub>(medium)</sub>

Not validating that order book sequence numbers increment by exactly 1 allows out-of-order or missing messages to corrupt local book state. Stale or incorrect price levels persist in the book, leading to wrong trading signals and corrupted market depth data.

## hummingbot (5)

### `AP-CRYPTO-TRADING-005` — Unvalidated Collateral for Order Execution <sub>(high)</sub>

Submitting orders without checking collateral requirements including order cost, percent fees, and fixed fees against available balance causes orders to exceed margin. This triggers immediate liquidation or forced position closure at unfavorable prices with partial or total loss of collateral.

### `AP-CRYPTO-TRADING-006` — Close Order Placed Before Open Order Fills <sub>(high)</sub>

Placing a close order before verifying the open order is fully filled causes mismatched position sizes. The executor attempts to close a larger or smaller position than actually exists, leading to unintended directional exposure and potential losses exceeding the configured risk parameters.

### `AP-CRYPTO-TRADING-007` — Arbitrage Across Non-Interchangeable Tokens <sub>(high)</sub>

Executing arbitrage trades between tokens that appear similar but are not interchangeable causes permanent loss of funds. The received tokens cannot be used to close the opposing position, stranding capital and creating one-sided exposure with no recovery path.

### `AP-CRYPTO-TRADING-008` — Skipping Triple Barrier Evaluations <sub>(high)</sub>

Omitting control_stop_loss, control_take_profit, or control_time_limit calls in the control_barriers cycle leaves positions unprotected. Losses exceed configured thresholds as barrier checks never trigger, positions remain open beyond risk tolerance, resulting in amplified losses.

### `AP-CRYPTO-TRADING-012` — Wrong Position Key for Perpetual Modes <sub>(medium)</sub>

Using trading_pair only as the position key in HEDGE mode causes different position sides to collide and overwrite each other. Position tracking becomes incorrect, leading to wrong order matching and potential financial loss when the system misidentifies position direction.

## rotki (3)

### `AP-CRYPTO-TRADING-003` — Bypassing API Facade Layer <sub>(high)</sub>

Directly accessing internal service methods without routing through the RestAPI facade bypasses authentication, task tracking, and error handling mechanisms. Anonymous requests can execute privileged operations, creating critical security vulnerabilities where unauthorized users access sensitive financial data or execute trades.

### `AP-CRYPTO-TRADING-004` — Non-Checksummed EVM Addresses <sub>(high)</sub>

Passing lowercase or mixed-case Ethereum addresses to RPC nodes causes InvalidAddress exceptions since nodes enforce EIP-55 checksum format. This results in RemoteError failures that halt all blockchain data collection for the affected chain, with no graceful degradation or fallback.

### `AP-CRYPTO-TRADING-013` — Overwriting User-Customized Event Classifications <sub>(medium)</sub>

Re-decoding operations silently replace user-modified events marked as CUSTOMIZED without explicit user action. User edits to event classifications are permanently lost, causing incorrect accounting treatment and potential tax reporting errors that may not be detected until audit.

## rotki, hummingbot, cryptofeed, ccxt (1)

### `AP-CRYPTO-TRADING-001` — Float Arithmetic for Monetary Values <sub>(high)</sub>

Using Python float type instead of Decimal for price, amount, balance, PnL, and other financial calculations causes precision errors due to binary floating-point representation. Rounding errors compound across multiple calculations, leading to incorrect order sizing, wrong profit/loss reporting, and potentially incorrect trading decisions or tax calculations.


path: references/COMPONENTS.md
content: # Component Capability Map

**Project**: finance-bp-110--cryptofeed
**Scan date**: 2026-04-22
**Stats**: {'total_files': 8, 'total_classes': 30, 'total_functions': 0, 'total_stages': 8}

## Modules (8)

- [feed_handler_orchestration](components/feed_handler_orchestration.md): 4 classes
- [connection_management](components/connection_management.md): 4 classes
- [exchange_interface_layer](components/exchange_interface_layer.md): 5 classes
- [data_normalization](components/data_normalization.md): 4 classes
- [order_book_processing](components/order_book_processing.md): 3 classes
- [nbbo_aggregation](components/nbbo_aggregation.md): 2 classes
- [callback_dispatch](components/callback_dispatch.md): 3 classes
- [backend_storage](components/backend_storage.md): 5 classes


path: references/CONSTRAINTS.md
content: # Constraints

## preservation_manifest

```yaml
required_objects:
  business_decisions_count: 103
  fatal_constraints_count: 33
  non_fatal_constraints_count: 196
  use_cases_count: 40
  semantic_locks_count: 12
  preconditions_count: 4
  evidence_quality_rules_count: 2
  traceback_scenarios_count: 5

```


path: references/LOCKS.md
content: # Semantic Locks + Preconditions

## Semantic Locks (12)

### `SL-01` <sub>(on_violation: fatal)</sub>
Execute sell orders before buy orders in every trading cycle

### `SL-02` <sub>(on_violation: fatal)</sub>
Trading signals MUST use next-bar execution (no look-ahead)

### `SL-03` <sub>(on_violation: fatal)</sub>
Entity IDs MUST follow format entity_type_exchange_code

### `SL-04` <sub>(on_violation: fatal)</sub>
DataFrame index MUST be MultiIndex (entity_id, timestamp)

### `SL-05` <sub>(on_violation: fatal)</sub>
TradingSignal MUST have EXACTLY ONE of: position_pct, order_money, order_amount

### `SL-06` <sub>(on_violation: fatal)</sub>
filter_result column semantics: True=BUY, False=SELL, None/NaN=NO ACTION

### `SL-07` <sub>(on_violation: fatal)</sub>
Transformer MUST run BEFORE Accumulator in factor pipeline

### `SL-08` <sub>(on_violation: fatal)</sub>
MACD parameters locked: fast=12, slow=26, signal=9

### `SL-09` <sub>(on_violation: warning)</sub>
Default transaction costs: buy_cost=0.001, sell_cost=0.001, slippage=0.001

### `SL-10` <sub>(on_violation: fatal)</sub>
A-share equity trading is T+1 (no same-day close of buy positions)

### `SL-11` <sub>(on_violation: fatal)</sub>
Recorder subclass MUST define provider AND data_schema class attributes

### `SL-12` <sub>(on_violation: fatal)</sub>
Factor result_df MUST contain either 'filter_result' OR 'score_result' column

## Preconditions (4)

- **`PC-01`**: `python3 -c 'import zvt; print(zvt.__version__)'` → on_fail: Run: python3 -m pip install zvt then re-run: python3 -m zvt.init_dirs to initialize data directories
- **`PC-02`**: `python3 -c "from zvt.api.kdata import get_kdata; df = get_kdata(entity_ids=['stock_sh_600000'], limit=1); assert df is not None and len(df) > 0, 'No kdata found'"` → on_fail: Run recorder first: python3 -m zvt.recorders.em.em_stock_kdata_recorder --entity_ids stock_sh_600000 (replace with your target entity IDs)
- **`PC-03`**: `python3 -c "import os; from pathlib import Path; zvt_home = Path(os.environ.get('ZVT_HOME', Path.home() / '.zvt')); assert zvt_home.exists(), f'ZVT home not found: {zvt_home}'"` → on_fail: Run: python3 -m zvt.init_dirs
- **`PC-04`**: `python3 -c "import os, tempfile; from pathlib import Path; zvt_home = Path(os.environ.get('ZVT_HOME', Path.home() / '.zvt')); test_f = zvt_home / '.write_test'; test_f.touch(); test_f.unlink()"` → on_fail: Check directory permissions: chmod u+w ~/.zvt or set ZVT_HOME environment variable to a writable location


path: references/USE_CASES.md
content: # Known Use Cases (KUC)

Total: **40**

## `KUC-101`
**Source**: `examples/demo.py`

Demonstrates how to define and use async callback handlers for receiving real-time market data updates from cryptocurrency exchanges.

## `KUC-102`
**Source**: `examples/demo_arctic.py`

Stores cryptocurrency trade, funding, and ticker data to ArcticDB (Arctic) time-series database for persistence and later analysis.

## `KUC-103`
**Source**: `examples/demo_bequant_bitcoincom_hitbtc.py`

Demonstrates each supported features (ticker, trades, order book, candles) for Bequant and HitBTC exchanges which share the same API.

## `KUC-104`
**Source**: `examples/demo_binance_authenticated.py`

Demonstrates authenticated access to Binance, Binance Delivery, and Binance Futures for receiving account balances, positions, and order updates in real-time.

## `KUC-105`
**Source**: `examples/demo_binance_delivery.py`

Shows data subscription for Binance Delivery perpetual futures including order book, ticker, and trade data.

## `KUC-106`
**Source**: `examples/demo_binancetr.py`

Demonstrates data subscription for Binance TR exchange including ticker, trades, order book with delta updates, and candle data.

## `KUC-107`
**Source**: `examples/demo_bitfinex_authenticated.py`

Demonstrates synchronous authenticated Bitfinex trading operations including balance queries, order management, and trade execution.

## `KUC-108`
**Source**: `examples/demo_bybit_authenticated.py`

Demonstrates Bybit authenticated feeds for receiving order updates and trade fills in real-time for account monitoring.

## `KUC-109`
**Source**: `examples/demo_check_trade_timestamps.py`

Monitors and compares trade timestamps across multiple exchanges to verify timestamp consistency and identify potential synchronization issues.

## `KUC-110`
**Source**: `examples/demo_concurrent_proxy.py`

Demonstrates using HTTP proxy to bypass exchange rate limits when subscribing to many symbols, enabling concurrent order book and open interest data collection.

## `KUC-111`
**Source**: `examples/demo_custom_agg.py`

Demonstrates custom aggregation of trade data over time windows, tracking min/max prices for each symbol within the aggregation period.

## `KUC-112`
**Source**: `examples/demo_deribit_authenticated.py`

Demonstrates Deribit authenticated feeds for order info, trade fills, and balance updates for comprehensive account monitoring.

## `KUC-113`
**Source**: `examples/demo_elastic.py`

Stores order book, funding, and trade data to Elasticsearch for search and analytics capabilities.

## `KUC-114`
**Source**: `examples/demo_existing_loop.py`

Demonstrates integrating cryptofeed with an existing asyncio event loop, allowing concurrent execution with other async tasks.

## `KUC-115`
**Source**: `examples/demo_gateiofutures.py`

Demonstrates subscription to Gate.io futures exchange for ticker, trades, order book, funding, and candle data.

## `KUC-116`
**Source**: `examples/demo_gcppubsub.py`

Publishes trade data to Google Cloud Platform Pub/Sub for event-driven architectures and cloud-based processing.

## `KUC-117`
**Source**: `examples/demo_influxdb.py`

Stores funding, order book, trades, ticker, and candles to InfluxDB time-series database for monitoring and analysis.

## `KUC-118`
**Source**: `examples/demo_kafka.py`

Streams order book and trade data to Apache Kafka with custom topic and partition routing for scalable event processing.

## `KUC-119`
**Source**: `examples/demo_liquidations.py`

Monitors and displays liquidations across each exchanges that support this channel, useful for identifying market stress and volatility.

## `KUC-120`
**Source**: `examples/demo_loop.py`

Demonstrates dynamic addition of feeds to a running event loop and scheduled callbacks for adding/removing feeds over time.

## `KUC-121`
**Source**: `examples/demo_mongo.py`

Stores order book, trades, and ticker data to MongoDB document database with flexible schema for JSON storage.

## `KUC-122`
**Source**: `examples/demo_multicb.py`

Demonstrates registering multiple callback handlers for a single data channel, enabling parallel processing of the same data.

## `KUC-123`
**Source**: `examples/demo_nbbo.py`

Calculates National Best Bid and Offer (NBBO) by aggregating best bid/ask prices across Coinbase, Gemini, and Kraken for a given symbol.

## `KUC-124`
**Source**: `examples/demo_ohlcv.py`

Aggregates trade data into OHLCV (Open, High, Low, Close, Volume) candles over configurable time windows for charting.

## `KUC-125`
**Source**: `examples/demo_okx_authenticated.py`

Demonstrates authenticated OKX exchange for receiving real-time order updates for account monitoring.

## `KUC-126`
**Source**: `examples/demo_playback.py`

Plays back historical market data from captured PCAP files through the callback system for backtesting and analysis.

## `KUC-127`
**Source**: `examples/demo_postgres.py`

Stores comprehensive market data (candles, index, ticker, trades, open interest, liquidations, funding, order books) to PostgreSQL with custom column mapping.

## `KUC-128`
**Source**: `examples/demo_quasardb.py`

Stores ticker, trades, candles, open interest, index, and liquidation data to QuasarDB for high-performance time-series analytics.

## `KUC-129`
**Source**: `examples/demo_questdb.py`

Stores order book, candles, funding, ticker, and trade data to QuestDB for high-performance time-series database operations.

## `KUC-130`
**Source**: `examples/demo_rabbitmq_exchange.py`

Publishes order book data to RabbitMQ using topic exchange routing for flexible message filtering and distribution.

## `KUC-131`
**Source**: `examples/demo_rabbitmq_queue.py`

Publishes order book data to RabbitMQ using queue-based delivery for point-to-point message distribution.

## `KUC-132`
**Source**: `examples/demo_raw_data.py`

Collects raw WebSocket data to files for offline analysis, debugging, or historical data preservation.

## `KUC-133`
**Source**: `examples/demo_redis.py`

Stores trades, funding, candles, order books, open interest, and ticker data to Redis with both pub/sub and persistent storage backends.

## `KUC-134`
**Source**: `examples/demo_renko.py`

Transforms trade data into Renko chart bricks based on fixed price movements for trend visualization independent of time.

## `KUC-135`
**Source**: `examples/demo_tcp.py`

Streams trade data over TCP sockets for network-based data distribution to remote systems or applications.

## `KUC-136`
**Source**: `examples/demo_throttle.py`

Limits the rate of order book callbacks to a specified number per time window, useful for managing downstream system load.

## `KUC-137`
**Source**: `examples/demo_udp.py`

Streams order book and trade data over UDP datagrams for low-latency network distribution to remote systems.

## `KUC-138`
**Source**: `examples/demo_uds.py`

Streams ticker and trade data over Unix domain sockets for high-performance inter-process communication on the same host.

## `KUC-139`
**Source**: `examples/demo_victoriametrics.py`

Stores trade, ticker, order book, and candle data to VictoriaMetrics for Prometheus-compatible time-series monitoring and analytics.

## `KUC-140`
**Source**: `examples/demo_zmq.py`

Publishes order book and ticker data over ZeroMQ pub/sub for lightweight message distribution to multiple subscribers.


path: references/WISDOM.md
content: # Cross-Project Wisdom

Total: **8**

## `CW-CRYPTO-TRADING-001` — Decimal Type for All Monetary Values
**From**: rotki, hummingbot, cryptofeed, ccxt · **Applicable to**: crypto-trading

All four projects mandate Decimal type for price, amount, balance, quantity, and PnL fields. Float arithmetic causes rounding errors that compound across financial calculations, leading to incorrect order sizing and reporting. Always use Decimal for any value representing money in crypto trading systems.

## `CW-CRYPTO-TRADING-002` — Initialize Data Structures Before Access
**From**: ccxt, cryptofeed, rotki · **Applicable to**: crypto-trading

Projects consistently require explicit initialization before data access: load_markets() before symbol lookups, check symbol population before mapping access, establish RPC connections before queries. Skipping initialization causes KeyError, AttributeError, or silent data corruption that breaks downstream operations.

## `CW-CRYPTO-TRADING-003` — Precise String Arithmetic for Financial Calculations
**From**: ccxt · **Applicable to**: crypto-trading

CCXT mandates Precise.string_* static methods (string_mul, string_div, string_add, string_sub) for monetary calculations to avoid floating-point precision errors. This is especially critical for high-precision exchange data where rounding errors cause incorrect order costs, fees, and balances that may result in financial loss.

## `CW-CRYPTO-TRADING-004` — Respect Exchange Rate Limits
**From**: ccxt · **Applicable to**: crypto-trading

Disabling rate limiting via enableRateLimit=False causes HTTP 429 responses and potential temporary or permanent API key suspension by exchanges. CCXT enforces rate limits per IP/API key pair, and bypassing throttle() gates results in compliance violations that disrupt all trading activity until exchanges lift bans.

## `CW-CRYPTO-TRADING-005` — Inverse Contract Price Adjustment
**From**: ccxt, hummingbot · **Applicable to**: crypto-trading

Perpetual swap cost calculations require applying inverse price adjustment (1/price) before multiplying by contractSize for inverse contracts. Incorrect cost calculation causes wrong position sizing, leading to unexpected liquidation or insufficient margin for perpetual trading positions.

## `CW-CRYPTO-TRADING-006` — Strict Connection Lifecycle Ordering
**From**: cryptofeed, ccxt · **Applicable to**: crypto-trading

Both projects enforce strict execution order for connection operations: cryptofeed requires authenticate -> subscribe -> message handler sequence, while ccxt mandates connect -> on_connected_callback -> subscriptions -> on_close_callback. Out-of-order operations cause subscription failures and no data flow through connections.

## `CW-CRYPTO-TRADING-007` — Validate Input Data Structure Before Processing
**From**: rotki, cryptofeed · **Applicable to**: crypto-trading

Rotki validates EVM address checksum format before RPC calls; cryptofeed checks Symbols.populated() before symbol mapping access. Validating data structure before processing prevents downstream crashes (KeyError, InvalidAddress) and data corruption that is harder to debug when symptoms appear in unrelated code paths.

## `CW-CRYPTO-TRADING-008` — Validate Order Sizes Against Exchange Minimums
**From**: hummingbot · **Applicable to**: crypto-trading

DCAExecutor amounts must be validated against min_notional_size and amounts_quote/prices against min_order_size before execution. Orders below exchange minimums are rejected, breaking strategy execution and potentially leaving positions partially unfilled at unfavorable prices.


path: references/components/backend_storage.md
content: # backend_storage (5 classes)

## `Backend.write`
`backend_storage/backend-write.py:0`

## `Backend.start`
`backend_storage/backend-start.py:0`

## `BackendQueue.start`
`backend_storage/backendqueue-start.py:0`

## `storage_backend`
`backend_storage/storage-backend.py:0`

## `ipc_mechanism`
`backend_storage/ipc-mechanism.py:0`


path: references/components/callback_dispatch.md
content: # callback_dispatch (3 classes)

## `Callback.__call__`
`callback_dispatch/callback-call.py:0`

## `AggregateCallback.__init__`
`callback_dispatch/aggregatecallback-init.py:0`

## `callback_type`
`callback_dispatch/callback-type.py:0`


path: references/components/connection_management.md
content: # connection_management (4 classes)

## `WebsocketEndpoint.connect`
`connection_management/websocketendpoint-connect.py:0`

## `WebsocketEndpoint.read`
`connection_management/websocketendpoint-read.py:0`

## `WebsocketEndpoint.write`
`connection_management/websocketendpoint-write.py:0`

## `websocket_library`
`connection_management/websocket-library.py:0`


path: references/components/data_normalization.md
content: # data_normalization (4 classes)

## `Trade.__init__`
`data_normalization/trade-init.py:0`

## `Book.__init__`
`data_normalization/book-init.py:0`

## `Callback.__call__`
`data_normalization/callback-call.py:0`

## `type_validation`
`data_normalization/type-validation.py:0`


path: references/components/exchange_interface_layer.md
content: # exchange_interface_layer (5 classes)

## `Binance.subscribe`
`exchange_interface_layer/binance-subscribe.py:0`

## `Coinbase._connect`
`exchange_interface_layer/coinbase-connect.py:0`

## `Exchange.standardize_symbol`
`exchange_interface_layer/exchange-standardize-symbol.py:0`

## `symbol_mapping_backend`
`exchange_interface_layer/symbol-mapping-backend.py:0`

## `rest_rate_limit_handling`
`exchange_interface_layer/rest-rate-limit-handling.py:0`


path: references/components/feed_handler_orchestration.md
content: # feed_handler_orchestration (4 classes)

## `FeedHandler.add_feed`
`feed_handler_orchestration/feedhandler-add-feed.py:0`

## `FeedHandler.add_nbbo`
`feed_handler_orchestration/feedhandler-add-nbbo.py:0`

## `FeedHandler.run`
`feed_handler_orchestration/feedhandler-run.py:0`

## `async_event_loop`
`feed_handler_orchestration/async-event-loop.py:0`


path: references/components/nbbo_aggregation.md
content: # nbbo_aggregation (2 classes)

## `NBBO._update`
`nbbo_aggregation/nbbo-update.py:0`

## `nbbo_source`
`nbbo_aggregation/nbbo-source.py:0`


path: references/components/order_book_processing.md
content: # order_book_processing (3 classes)

## `Book.callback`
`order_book_processing/book-callback.py:0`

## `Book.update`
`order_book_processing/book-update.py:0`

## `book_depth`
`order_book_processing/book-depth.py:0`


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)