https://github.com/ccxt-net/ccxt.collector
CCXT.COLLECT β CryptoCurrency eXchange Trading Collector
https://github.com/ccxt-net/ccxt.collector
api bitcoin ccxt exchange trading
Last synced: 10 months ago
JSON representation
CCXT.COLLECT β CryptoCurrency eXchange Trading Collector
- Host: GitHub
- URL: https://github.com/ccxt-net/ccxt.collector
- Owner: ccxt-net
- License: mit
- Created: 2019-08-13T13:47:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-08-08T19:46:57.000Z (10 months ago)
- Last Synced: 2025-08-08T20:29:41.538Z (10 months ago)
- Topics: api, bitcoin, ccxt, exchange, trading
- Language: C#
- Homepage:
- Size: 815 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE.txt
- Roadmap: docs/ROADMAP.md
Awesome Lists containing this project
README
# CCXT.Collector
[](https://www.nuget.org/packages/CCXT.Collector)
[](https://dotnet.microsoft.com/)
[](https://github.com/ccxt-net/ccxt.collector/blob/master/LICENSE.txt)
A powerful .NET library for real-time cryptocurrency exchange data collection with unified WebSocket streaming and technical indicator analysis.
---
## π Overview
CCXT.Collector is a comprehensive library that connects to cryptocurrency exchanges worldwide via WebSocket to receive real-time market data and calculate technical indicators. It provides a unified interface for handling data from multiple exchanges, making it easy to build trading bots, market analysis tools, and data collection systems.
### β¨ Key Features
- π **Real-time WebSocket Streaming** - Low-latency market data streaming with exponential backoff reconnection
- π **Unified Data Classes** - Consistent data format across all exchanges (STicker, SOrderBook, STrade, SCandle)
- π **25+ Technical Indicators** - Real-time calculation per exchange/market with optimized algorithms
- π **Callback Architecture** - Asynchronous event-driven data handling with typed callbacks
- π **Automatic Reconnection** - Resilient WebSocket connection management with subscription restoration
- β‘ **High Performance** - System.Text.Json for 20-30% faster parsing, 15-25% less memory usage
- π **Channel Management** - Advanced subscription tracking with batch mode and statistics
- π‘οΈ **Security Ready** - Authentication framework for private channels (implementation in progress)
### π’ Supported Exchanges (130 Active)
#### Exchange Status Management
The library now includes automatic exchange status tracking to prevent connections to closed or unavailable exchanges. When attempting to connect to a closed exchange, you'll receive a clear error message with suggested alternatives.
#### Major Exchanges by Region
| Region | Exchanges | Count |
|--------|-----------|-------|
| πΊπΈ United States | Coinbase, Kraken, Gemini, ~~Bittrex~~*, Poloniex, Phemex, Crypto.com, and 18 more | 25 |
| π¨π³ China | Binance*, OKX, Huobi, Bybit, KuCoin, Gate.io, MEXC, Bitget, and 16 more | 24 |
| π°π· South Korea | Upbit, Bithumb, Coinone, Korbit, Gopax, Probit, OKCoinKR | 7 |
| π―π΅ Japan | bitFlyer, Coincheck, Bitbank, Zaif, and 4 more | 8 |
| πͺπΊ Europe | Bitstamp, Bitfinex, Bitvavo, EXMO, WhiteBIT, and 8 more | 13 |
| π¬π§ United Kingdom | Bitfinex, Bitstamp, CEX.IO, Luno, and 3 more | 7 |
| πΈπ¬ Singapore | BitMEX*, Bitrue, Coins.ph, and 5 more | 8 |
| π Other Regions | Deribit (UAE), BTC Markets (AU), Bitso (MX), NDAX (CA), and more | 39 |
*Note: Exchange locations indicate registration/headquarters, not service availability
#### Implementation Status (v2.1.7 - 2025-08-13)
| Feature | Implemented | In Progress | Planned |
|---------|------------|-------------|----------|
| WebSocket Clients | 132 | - | - |
| Korean Exchange WebSockets | 6 (Upbit, Bithumb, Coinone, Korbit, Gopax, OKCoinKR) | 1 (Probit) | - |
| Major Exchange Implementations | **15 (100% Complete)** | - | - |
| Full WebSocket Implementation | **15** | - | 117 |
| Batch Subscription System | **11** | 4 | - |
| Auto-Resubscription on Reconnect | **15** | - | 117 |
| Authentication/Private Channels | - | 15 | - |
| Technical Indicators | 25+ | - | 25+ more |
| Test Coverage | 15 exchanges (100% major) | - | 117 exchanges |
#### β
All 15 Major Exchanges (100% Complete)
Binance, Bitget, Bithumb, Bittrex, Bybit, Coinbase, Coinone, Crypto.com, Gate.io, Huobi, Korbit, Kucoin, OKX, Upbit - **All functional with standardized WebSocket streaming and batch subscription support**
#### π Security & Testing Status
- **Critical**: Authentication implementation needed for private channels
- **Testing**: All 15 major exchanges have unified WebSocket test suite
- **Channel Management**: Advanced ChannelManager with batch subscription support
- **Security**: API key management system under development
## π¦ Installation
### NuGet Package Manager
```bash
Install-Package CCXT.Collector -Version 2.1.7
```
### .NET CLI
```bash
dotnet add package CCXT.Collector --version 2.1.7
```
### Package Reference
```xml
```
### β οΈ Breaking Changes in v2.1.7
- **Bitget WebSocket**: Fixed subscription format with correct instType ("sp" instead of "SPOT") and ping/pong protocol
- **Crypto.com WebSocket**: Corrected message parsing and subscription handling
- **Coinone WebSocket**: Fixed response_type handling and channel processing
- **Coinbase WebSocket**: Changed to level2_batch channel for public access
- **Sample Project**: Enhanced with comprehensive testing utilities and multi-exchange support
- See [CHANGELOG](docs/CHANGELOG.md#217---2025-08-13) for full details
### β οΈ Breaking Changes in v2.1.6
- **KuCoin WebSocket**: Complete rewrite with dynamic endpoint resolution and proper protocol handling
- **Korbit WebSocket**: Migration to v2 API with array-based message format
- See [CHANGELOG](docs/CHANGELOG.md#216---2025-08-13) for full details
### β οΈ Breaking Changes in v2.1.5
- **IMPORTANT**: Complete migration from Newtonsoft.Json to System.Text.Json
- All JSON processing now uses System.Text.Json for better performance and reduced dependencies
- Added JsonExtensions utility class with safe property access methods
- Unified subscription handling with `MarkSubscriptionActive` across all exchanges
- See [CHANGELOG](docs/CHANGELOG.md#215---2025-08-12) for migration details
### β οΈ Breaking Changes in v2.1.2
- `SCandlestick.result` changed from single item to `List`
- `OnOrderUpdate` event now uses `SOrders` container instead of single `SOrder`
- `OnPositionUpdate` event now uses `SPositions` container instead of single `SPosition`
- See [Migration Guide](docs/GUIDE.md#breaking-changes-v212) for details
## π Quick Start
### Basic WebSocket Connection
```csharp
using CCXT.Collector.Binance;
using CCXT.Collector.Service;
using System;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Create WebSocket client
var client = new BinanceWebSocketClient();
// Register callbacks for real-time data
client.OnOrderbookReceived += (orderbook) =>
{
Console.WriteLine($"Orderbook update: {orderbook.symbol}");
Console.WriteLine($"Best bid: {orderbook.result.bids[0].price} @ {orderbook.result.bids[0].quantity}");
Console.WriteLine($"Best ask: {orderbook.result.asks[0].price} @ {orderbook.result.asks[0].quantity}");
};
client.OnConnected += () => Console.WriteLine("β
Connected to Binance");
client.OnError += (error) => Console.WriteLine($"β Error: {error}");
// Connect and subscribe to markets
await client.ConnectAsync();
// Using the new Market-based subscription (more efficient)
var market = new Market("BTC", "USDT");
await client.SubscribeOrderbookAsync(market);
await client.SubscribeTradesAsync(market);
// Or using traditional string format (backward compatible)
await client.SubscribeTickerAsync("BTC/USDT");
// Keep the connection alive
Console.WriteLine("Press any key to stop...");
Console.ReadKey();
// Cleanup
await client.DisconnectAsync();
}
}
```
### Multi-Exchange Data Collection
```csharp
using CCXT.Collector.Binance;
using CCXT.Collector.Upbit;
using CCXT.Collector.Service;
// Initialize multiple exchanges
var binanceClient = new BinanceWebSocketClient();
var upbitClient = new UpbitWebSocketClient();
// Set up unified callbacks - all exchanges use same data format
Action processTicker = (ticker) =>
{
Console.WriteLine($"[{ticker.exchange}] {ticker.symbol}: " +
$"Price={ticker.result.closePrice:F2}, " +
$"Volume={ticker.result.volume:F2}");
};
binanceClient.OnTickerReceived += processTicker;
upbitClient.OnTickerReceived += processTicker;
// Connect and subscribe
await Task.WhenAll(
binanceClient.ConnectAsync(),
upbitClient.ConnectAsync()
);
// Use Market struct for cleaner code
var btcUsdt = new Market("BTC", "USDT");
var btcKrw = new Market("BTC", "KRW");
await binanceClient.SubscribeTickerAsync(btcUsdt);
await upbitClient.SubscribeTickerAsync(btcKrw);
```
## π Technical Indicators
The library includes 25+ technical indicators. See the [Developer Guide](docs/GUIDE.md#technical-indicators) for the complete list and usage examples.
## βοΈ Configuration
```json
{
"appsettings": {
"websocket.retry.waiting.milliseconds": "600",
"use.auto.start": "true",
"auto.start.exchange.name": "binance",
"auto.start.symbol.names": "BTC/USDT,ETH/USDT"
}
}
```
## ποΈ Architecture
For detailed architecture and system design, see the [Developer Guide](docs/GUIDE.md#system-overview).
### Project Structure
```
CCXT.Collector/
βββ src/
β βββ Core/ # Core framework components
β βββ Models/ # Data models and structures
β βββ Indicators/ # Technical indicators (25+ indicators)
β βββ Utilities/ # Utility classes
β βββ exchanges/ # Exchange implementations (132 exchanges)
β βββ kr/ # South Korea (7 exchanges)
β βββ us/ # United States (26 exchanges)
β βββ cn/ # China (24 exchanges)
β βββ ... # 18 more country/region folders
βββ tests/ # Test suites
βββ samples/ # Example implementations
βββ docs/ # Documentation
```
## π Documentation
- [Developer Guide](docs/GUIDE.md) - Complete architecture, API reference, and contributing guide
- [Deployment Guide](docs/DEPLOYMENT.md) - Production deployment instructions
- [Roadmap & Tasks](docs/ROADMAP.md) - Development roadmap and current tasks
- [Changelog](docs/CHANGELOG.md) - Version history and release notes
## π€ Contributing
We welcome contributions! Please see our [Contributing Guide](docs/GUIDE.md#contributing) for details.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## π License
This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
## π Links
- [NuGet Package](https://www.nuget.org/packages/CCXT.Collector)
- [GitHub Repository](https://github.com/ccxt-net/ccxt.collector)
- [Documentation Wiki](https://github.com/ccxt-net/ccxt.collector/wiki)
- [Bug Reports](https://github.com/ccxt-net/ccxt.collector/issues)
## π₯ Related Projects
- [CCXT.NET](https://github.com/ccxt-net/ccxt.net) - The base CCXT library for .NET
- [CCXT.Simple](https://github.com/ccxt-net/ccxt.simple) - Simplified exchange interface
## π¬ Support
- **Issues**: [GitHub Issues](https://github.com/ccxt-net/ccxt.collector/issues)
- **Email**: support@ccxt.net
- **Discord**: [Join our Discord](https://discord.gg/ccxt)
## π₯ Team
### **Core Development Team**
- **SEONGAHN** - Lead Developer & Project Architect ([lisa@odinsoft.co.kr](mailto:lisa@odinsoft.co.kr))
- **YUJIN** - Senior Developer & Exchange Integration Specialist ([yoojin@odinsoft.co.kr](mailto:yoojin@odinsoft.co.kr))
- **SEJIN** - Software Developer & API Implementation ([saejin@odinsoft.co.kr](mailto:saejin@odinsoft.co.kr))
---
**Built with β€οΈ by the ODINSOFT Team**