LBank Trade Connector
Features
crypto-lbankConnector KeyNotes
Documentation
https://www.lbank.com/docs/index.html
Connectivity
The Exchange offers three REST URLs and three WebSocket URLs to compare latency and select the most suitable one.
| REST URL | WebSocket URL |
|---|---|
| https://www.lbkex.net | wss://www.lbkex.net/ws/V2/ |
| https://api.lbkex.com | wss://api.lbkex.com/ws/V2/ |
| https://api.lbank.info | wss://api.lbank.info/ws/V2/ |
Market Orders
MARKET BUY orders are not supported.
Synchronization
The connector synchronizes trades for the last two calendar days only (today and yesterday in UTC+8).
Price and Quantity Precision
It is strongly recommended to submit orders with a price and a quantity precision accordingly to the Exchange symbols' specification. The Exchange accepts orders with a price or a quantity precision higher than defined in symbols' description, but silently truncates less significant part of the price or the quantity.
Post Only Orders
The Exchange supports PostOnly orders. It will cancel a PostOnly order if it is to be immediately executed as an aggressive order.
Commission
WebSocket events do not include commission information. This data is only available in trade history responses.
WebSocket Heartbeats
The exchange supports WebSocket heartbeats at the API level.
Each ping message must be answered with a pong message containing the payload from the corresponding ping.
The connector terminates the WebSocket connection after 3 consecutive unanswered ping messages.
Window
From the Exchange documentation:
When receiving a request, the server will determine the timestamp in the request. If the request is sent earlier than 5000 ms, the request will be considered invalid. This time window value can be customized by sending the optional parameter window. In addition, if the server calculates that the client timestamp is more than one second in the 'future' of the server's time, the request will also be rejected.
The Exchange rejects orders that do not fall within the specified time window. The reason for rejection has code 10039 and the message “Order timeout cancellation”.
Setting the window connector's setting to 0 will remove it from the order submission requests. In such case default value of 5 seconds will be applied by the Exchange.
Symbology
Available trading pairs: https://www.lbkex.net/v2/currencyPairs.do
Basic information of all trading pairs: https://www.lbkex.net/v2/accuracy.do
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| subscribeKeyTTL | 60 minutes | Validity period of a subscribe key. A subscribe key will expire after this period if not refreshed. Actual period is controlled by the Exchange. |
| subscribeKeyRefreshInterval | 20 mimutes | A time period for a subscribe key validity extension requests. After successful request the subscribe key will be valid subscribeKeyTTL period. |
| websocketHeartbeatInterval | 10 seconds | Websocket ping interval. |
| staleWebsocketTimeout | 5 seconds | Timeout for reconnection when no websockets messages received after any order message sent to Exchange. |
| window | 5 seconds | Period of time after which matching engine should reject new order request. See Window section for additional details. |
| lbankSyncSettings.ordersResponseSizeLimit | 100 | Limitation for the number of orders in the open and closed orders status response. Maximum value is 200. |
| lbankSyncSettings.tradesResponseSizeLimit | 100 | Limitation for the number of trades in the trades history response. Minimum value is 2, maximum value is 100. |
Supported order attributes
| Key | Description |
|---|---|
| 18 | 6 value used for post only orders submission. |
Config sample
connectors {
LBANK: ${template.connector.crypto.lbank} {
settings {
restUrl = "https://www.lbkex.net"
websocketUrl = "wss://www.lbkex.net/ws/V2/"
apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}