1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Per-exchange implementations.
//!
//! Each venue is a module here, implementing the same surface behind its own
//! authentication, WebSocket state machine and symbol/filter mapping. Every
//! client is generic over the injected [`HttpTransport`](crate::HttpTransport),
//! so its request-build → parse → normalise logic is tested offline against the
//! mock transport.
use crate;
use crateMarketType;
/// The markets a venue client with both a spot and a linear-futures path routes.
pub const SPOT_AND_LINEAR: & = &;
/// The markets a spot-only venue client routes.
pub const SPOT_ONLY: & = &;
/// Refuse a market this client does not route, before anything is sent.
///
/// [`MarketType`] names four markets and no client here routes all four. The
/// ones that were not routed did not fail -- they resolved to whichever market
/// the client's URL builder happened to produce, and answered:
///
/// * Binance served `api/v3/ticker/24hr?symbol=BTCUSD` for a **coin-margined**
/// request. `BTCUSD` is a real Binance *spot* pair, so that is real spot data
/// returned for a futures question, with no error and nothing to notice. An
/// order would have bought spot BTC with USD instead of opening an inverse
/// position.
/// * Kraken asked for `PF_XBTUSD`, its *linear* multi-collateral perpetual,
/// where the coin-margined product is `PI_XBTUSD`. Both exist and both
/// answer.
/// * Every client routed `Margin` to its plain spot path, where a margin order
/// becomes an ordinary spot order: the borrow the caller asked for simply
/// does not happen.
/// * Bitget, Gate, HTX, KuCoin and Upbit at least failed loudly -- an empty
/// list, `CONTRACT_NOT_FOUND`, `invalid-parameter`, a 404 -- but failed
/// because of a URL the caller could not see, and could not act on.
///
/// Bybit and OKX are the two that *would* have routed coin-margined data
/// correctly (`category=inverse`, `BTC-USD-SWAP`, both verified against the
/// live venues). They are refused with the rest anyway, because an inverse
/// order's size is denominated differently -- Bybit's inverse `qty` is in USD,
/// not in the base coin -- so `quantity` would silently mean something else on
/// those two clients than on every other. Half a market is the defect this
/// refusal exists to prevent, not a smaller version of the feature.
pub
pub use Binance;
pub use Bitget;
pub use Bybit;
pub use Coinbase;
pub use Gate;
pub use Htx;
pub use Kraken;
pub use KuCoin;
pub use Okx;
pub use PaperExchange;
pub use ReplayExchange;
pub use Upbit;