Skip to main content

Module bybit

Module bybit 

Source
Expand description

Bybit connectors and the Bybit wire client.

Re-exports§

pub use brokapi_bybit_protocol as protocol;

Modules§

cid
The client order id codec: Bybit keeps a client order id (orderLinkId) of up to 36 characters on every order, and a full hyphenated UUID is exactly 36.
config
Configuration of the two connectors: the Bybit client settings plus the choices of the connector itself (source label, reconnect pauses, buffer size).
core
The sans-io cores of the Bybit connectors.
error
Mapping of the errors of the protocol layer to the broker-independent [Error].
limits
Loads limits.toml (section [bybit]) through BrokerLimits::from_toml_section.
map
Mapping of the wire models of the exchange to the broker-independent types.
md
The market data connector: order books, trades, quotes, candles and the directory of instruments.
pump
The task that feeds frames of the stream to a core and the events of the core to the emitter.
raw
Direct access to any Bybit API method (the “back door”): same key pair, same endpoint, same [BrokerLimiter] as the connector it came from.
subs
The subscription records a connector keeps, and the generators of subscription ids and request ids.
ud
The user data connector: orders, stop orders, fills and the portfolio of one Bybit account.
util
Small helpers: instrument ids, intervals, times.

Structs§

BybitCidCodec
The cid is written into the orderLinkId of the order as a hyphenated UUID (lossless, 128-bit, 36 characters of digits, letters and dashes, which the exchange allows). The exchange returns it in the order list, in the order stream and in the fills, which is how a cid comes back. The exchange refuses a second order with the same id while the first one is working, which is what makes a repeated place visible.
BybitRaw
A handle to the whole API with the quota of the connector it came from.
MarketDataConfig
Settings of MarketDataConnector.
MarketDataConnector
The market data connector of Bybit: implements [OrderBookSource], [MarketDataSource] and [InstrumentSource].
MdCore
The sans-io core of the market data connector.
UdCore
The sans-io core of the user data connector.
UserDataConfig
Settings of UserDataConnector.
UserDataConnector
The user data connector of Bybit for one account: implements [OrderExecutor], [StopOrderExecutor], [ExecutionSource] and [PortfolioSource].