barter_data/exchange/bybit/spot/
mod.rs

1use super::{Bybit, ExchangeServer};
2use barter_instrument::exchange::ExchangeId;
3use std::fmt::Display;
4
5/// [`BybitSpot`] WebSocket server base url.
6///
7/// See docs: <https://bybit-exchange.github.io/docs/v5/ws/connect>
8pub const WEBSOCKET_BASE_URL_BYBIT_SPOT: &str = "wss://stream.bybit.com/v5/public/spot";
9
10/// [`Bybit`] spot exchange.
11pub type BybitSpot = Bybit<BybitServerSpot>;
12
13/// [`Bybit`] spot [`ExchangeServer`].
14#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
15pub struct BybitServerSpot;
16
17impl ExchangeServer for BybitServerSpot {
18    const ID: ExchangeId = ExchangeId::BybitSpot;
19
20    fn websocket_url() -> &'static str {
21        WEBSOCKET_BASE_URL_BYBIT_SPOT
22    }
23}
24
25impl Display for BybitSpot {
26    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27        write!(f, "BybitSpot")
28    }
29}