Skip to main content

LBank Trade Connector

Features

crypto-lbankConnector Key
Instruments
FX
Request Types
SUBMITCANCEL
Order Types
LIMITMARKET
Time In Force
GTCIOCFOK
Order ID Mapper
COMPOSITE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

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 URLWebSocket URL
https://www.lbkex.netwss://www.lbkex.net/ws/V2/
https://api.lbkex.comwss://api.lbkex.com/ws/V2/
https://api.lbank.infowss://api.lbank.info/ws/V2/

Market Orders

note

MARKET BUY orders are not supported.

Synchronization

note

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

ParameterDefault ValueDescription
subscribeKeyTTL60 minutesValidity period of a subscribe key. A subscribe key will expire after this period if not refreshed. Actual period is controlled by the Exchange.
subscribeKeyRefreshInterval20 mimutesA time period for a subscribe key validity extension requests. After successful request the subscribe key will be valid subscribeKeyTTL period.
websocketHeartbeatInterval10 secondsWebsocket ping interval.
staleWebsocketTimeout5 secondsTimeout for reconnection when no websockets messages received after any order message sent to Exchange.
window5 secondsPeriod of time after which matching engine should reject new order request. See Window section for additional details.
lbankSyncSettings.ordersResponseSizeLimit100Limitation for the number of orders in the open and closed orders status response. Maximum value is 200.
lbankSyncSettings.tradesResponseSizeLimit100Limitation for the number of trades in the trades history response. Minimum value is 2, maximum value is 100.

Supported order attributes

KeyDescription
186 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>"
}
]
}
}
}