Expand description
§V5 Exchange Connectors - Traits + Utils Architecture
§Архитектура
┌─────────────────────────────────────────────────────────────────────────────┐
│ v5/core │
├─────────────────────────────────────────────────────────────────────────────┤
│ traits/ - Core трейты (MarketData, Trading, Account, ExchangeAuth) │
│ utils/ - Утилиты (crypto, encoding, time) │
│ http/ - HTTP клиент │
│ websocket/ - WebSocket │
│ types/ - Общие типы │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ v5/exchanges │
├─────────────────────────────────────────────────────────────────────────────┤
│ kucoin/ - KuCoinConnector (impl MarketData, Trading, ExchangeAuth) │
│ binance/ - BinanceConnector │
│ ... │
└─────────────────────────────────────────────────────────────────────────────┘§Core трейты
| Трейт | Описание |
|---|---|
MarketData | price, orderbook, klines, ticker, ping |
Trading | market_order, limit_order, cancel, get_order, open_orders |
Account | balance, account_info |
Positions | positions, funding_rate, set_leverage |
ExchangeAuth | sign_request (каждая биржа реализует свою логику) |
§Утилиты
utils::crypto- hmac_sha256, hmac_sha512utils::encoding- encode_base64, encode_hexutils::time- timestamp_millis, timestamp_iso8601
Re-exports§
pub use core::ExchangeIdentity;pub use core::MarketData;pub use core::Trading;pub use core::Positions;pub use core::Account;pub use core::CoreConnector;pub use core::WebSocketConnector;pub use core::WebSocketExt;pub use core::Authenticated;pub use core::CredentialKind;pub use core::Credentials;pub use core::AuthRequest;pub use core::SignatureLocation;pub use core::ExchangeAuth;pub use core::CancelAll;pub use core::AmendOrder;pub use core::BatchOrders;pub use core::AccountTransfers;pub use core::CustodialFunds;pub use core::SubAccounts;pub use core::hmac_sha256;pub use core::hmac_sha512;pub use core::sha256;pub use core::sha512;pub use core::encode_base64;pub use core::encode_hex;pub use core::encode_hex_lower;pub use core::timestamp_millis;pub use core::timestamp_seconds;pub use core::timestamp_iso8601;pub use core::safe_price;pub use core::safe_qty;pub use core::format_price;pub use core::format_qty;pub use core::PrecisionCache;pub use core::PrecisionInfo;pub use core::HttpClient;pub use core::Canonicalize;pub use core::CanonicalEvent;pub use core::CanonicalTrade;pub use core::CanonicalTicker;pub use core::CanonicalOrderbook;pub use core::CanonicalOrderbookDelta;pub use core::CanonicalKline;pub use core::CanonicalLevel;pub use core::normalize_ts_to_ms;
Modules§
- connector_
manager - Connector Manager
- core
- V5 Core - минимальная архитектура коннекторов
- l1
- L1 — Price / OHLCV data feeds only
- l2
- L2 — L1 + orderbook data (no execution)
- l3
- L3 — Full Stack Connectors (L1 + L2 + Execution)
- testing
- Testing — Generic test harness for all connectors
Macros§
- sym
- Short syntax for constructing a
SymbolInput.
Structs§
- Account
Capabilities - Describes which account management operations a connector supports.
- AggTrade
- Aggregated trade event.
- Auction
Event - Auction event snapshot.
- Balance
- Баланс
- Balance
Update Event - Событие обновления баланса
- Basis
- Futures basis snapshot.
- Block
Trade - Block trade event.
- Composite
Index - Composite index snapshot.
- Decaying
Limit Config - Decaying-counter REST limit config (Kraken Spot, Deribit credits).
- Endpoint
Weight - REST endpoint weight descriptor.
- Funding
Settlement - Funding settlement event.
- Historical
Volatility - Historical volatility snapshot.
- Index
Price - Index price snapshot.
- Insurance
Fund - Insurance fund balance snapshot.
- Market
Data Capabilities - Describes which market data endpoints a connector supports.
- Market
Warning - Market warning event.
- Option
Greeks - Option Greeks snapshot from exchange feed.
- Order
- Ордер
- Order
Update Event - Событие обновления ордера
- Orderbook
L3Event - Level-3 orderbook event — individual order-level mutation.
- Position
- Позиция
- Position
Update Event - Событие обновления позиции (Futures)
- Predicted
Funding - Predicted funding rate snapshot.
- Rate
Limit Capabilities - Full rate limit capability descriptor for one exchange.
- Rest
Limit Pool - REST rate limit pool descriptor.
- Risk
Limit - Risk limit tier snapshot.
- Settlement
Event - Contract settlement event.
- Subscription
Request - Запрос на подписку
- Symbol
- Торговая пара
- Symbol
Info - Информация о символе.
- Trading
Capabilities - Describes which order types and trading operations a connector supports.
- Validation
Stamp - Empirical validation stamp for one connector, emitted by the
e2e_smokeharness. - Volatility
Index - Volatility index snapshot (e.g., DVOL, BVOL).
- WsLimits
- WebSocket structural limits (not budget-based).
Enums§
- Account
Type - Тип аккаунта/рынка
- Connection
Status - Статус WebSocket соединения
- Exchange
Credentials - Unified credential enum covering all 24-exchange authentication schemes.
- Exchange
Error - Ошибки Exchange операций
- Exchange
Id - Идентификатор биржи
- Exchange
Type - Тип биржи
- Field
Validation - Empirical validation result for a single REST method or WS stream.
- L3Action
- Action applied to an individual L3 order.
- Limit
Model - Which runtime limiter model this exchange uses.
- Order
Book Side - Side of an L3 orderbook entry.
- Order
Side - Направление ордера
- Order
Status - Статус ордера
- Order
Type - Unified order type enum — covers all order variants across 24 exchanges.
- Owned
Symbol Input - Owned counterpart to
SymbolInput— used where the input must outlive a borrow (e.g. insideStreamSpecwhich is stored in the subscription registry). - Position
Side - Сторона позиции
- Stream
Event - События от WebSocket потока
- Stream
Type - Тип потока данных
- Symbol
Input - Input to any per-symbol method on a connector.
Type Aliases§
- Asset
- Актив (USDT, BTC, etc.)
- Exchange
Result - Результат Exchange операции
- Price
- Цена
- Quantity
- Количество
- Timestamp
- Timestamp в миллисекундах