Skip to main content

Crate digdigdig3

Crate digdigdig3 

Source
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 трейты

ТрейтОписание
MarketDataprice, orderbook, klines, ticker, ping
Tradingmarket_order, limit_order, cancel, get_order, open_orders
Accountbalance, account_info
Positionspositions, funding_rate, set_leverage
ExchangeAuthsign_request (каждая биржа реализует свою логику)

§Утилиты

  • utils::crypto - hmac_sha256, hmac_sha512
  • utils::encoding - encode_base64, encode_hex
  • utils::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§

AccountCapabilities
Describes which account management operations a connector supports.
AggTrade
Aggregated trade event.
AuctionEvent
Auction event snapshot.
Balance
Баланс
BalanceUpdateEvent
Событие обновления баланса
Basis
Futures basis snapshot.
BlockTrade
Block trade event.
CompositeIndex
Composite index snapshot.
DecayingLimitConfig
Decaying-counter REST limit config (Kraken Spot, Deribit credits).
EndpointWeight
REST endpoint weight descriptor.
FundingSettlement
Funding settlement event.
HistoricalVolatility
Historical volatility snapshot.
IndexPrice
Index price snapshot.
InsuranceFund
Insurance fund balance snapshot.
MarketDataCapabilities
Describes which market data endpoints a connector supports.
MarketWarning
Market warning event.
OptionGreeks
Option Greeks snapshot from exchange feed.
Order
Ордер
OrderUpdateEvent
Событие обновления ордера
OrderbookL3Event
Level-3 orderbook event — individual order-level mutation.
Position
Позиция
PositionUpdateEvent
Событие обновления позиции (Futures)
PredictedFunding
Predicted funding rate snapshot.
RateLimitCapabilities
Full rate limit capability descriptor for one exchange.
RestLimitPool
REST rate limit pool descriptor.
RiskLimit
Risk limit tier snapshot.
SettlementEvent
Contract settlement event.
SubscriptionRequest
Запрос на подписку
Symbol
Торговая пара
SymbolInfo
Информация о символе.
TradingCapabilities
Describes which order types and trading operations a connector supports.
ValidationStamp
Empirical validation stamp for one connector, emitted by the e2e_smoke harness.
VolatilityIndex
Volatility index snapshot (e.g., DVOL, BVOL).
WsLimits
WebSocket structural limits (not budget-based).

Enums§

AccountType
Тип аккаунта/рынка
ConnectionStatus
Статус WebSocket соединения
ExchangeCredentials
Unified credential enum covering all 24-exchange authentication schemes.
ExchangeError
Ошибки Exchange операций
ExchangeId
Идентификатор биржи
ExchangeType
Тип биржи
FieldValidation
Empirical validation result for a single REST method or WS stream.
L3Action
Action applied to an individual L3 order.
LimitModel
Which runtime limiter model this exchange uses.
OrderBookSide
Side of an L3 orderbook entry.
OrderSide
Направление ордера
OrderStatus
Статус ордера
OrderType
Unified order type enum — covers all order variants across 24 exchanges.
OwnedSymbolInput
Owned counterpart to SymbolInput — used where the input must outlive a borrow (e.g. inside StreamSpec which is stored in the subscription registry).
PositionSide
Сторона позиции
StreamEvent
События от WebSocket потока
StreamType
Тип потока данных
SymbolInput
Input to any per-symbol method on a connector.

Type Aliases§

Asset
Актив (USDT, BTC, etc.)
ExchangeResult
Результат Exchange операции
Price
Цена
Quantity
Количество
Timestamp
Timestamp в миллисекундах