Package com.bybit.api.client.websocket
Interface WebsocketClient
-
- All Known Implementing Classes:
WebsocketClientImpl
public interface WebsocketClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconnect()voidgetPrivateChannelStream(List<String> argNames, String path)voidgetPublicChannelStream(List<String> argNames, String path)Orderbook Subscribe to the orderbook stream.voidonClose(int code, String reason)voidonError(Throwable t)voidonMessage(String msg)voidonOpen(okhttp3.WebSocket ws)
-
-
-
Method Detail
-
onMessage
void onMessage(String msg)
-
onError
void onError(Throwable t)
-
onClose
void onClose(int code, String reason)
-
onOpen
void onOpen(okhttp3.WebSocket ws)
-
connect
void connect()
-
getPublicChannelStream
void getPublicChannelStream(List<String> argNames, String path)
Orderbook Subscribe to the orderbook stream. Supports different depths. TIP Once you have subscribed successfully, you will receive a snapshot. The WebSocket will keep pushing delta messages every time the orderbook changes. If you receive a new snapshot message, you will have to reset your local orderbook. If there is a problem on Bybit's end, a snapshot will be re-sent, which is guaranteed to contain the latest data. INFO Linear and inverse level 1 data: if 3 seconds have elapsed without a change in the orderbook, a snapshot message will be pushed again. Linear and inverse: Level 1 data, push frequency: 10ms Level 50 data, push frequency: 20ms Level 200 data, push frequency: 100ms Level 500 data, push frequency: 100ms Spot: Level 1 data, push frequency: 10ms Level 50 data, push frequency: 20ms Level 200 data, push frequency: 200ms Option: Level 25 data, push frequency: 20ms Level 100 data, push frequency: 100ms Topic: orderbook.{depth}.{symbol} e.g., orderbook.1.BTCUSDT https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook
-
-