Skip to main content

LMEX Futures Trade Connector

Features

crypto-lmexfutConnector Key
Instruments
FUTURE
Request Types
SUBMITCANCELREPLACE
Order Types
LIMIT
Time In Force
GTCIOCFOK
Order ID Mapper
COMPOSITE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Cancel/Replace

warning

Only price change is allowed.

Time In Force

Time In Force for orders may be overridden with 59 (TimeInForce) attribute. The attribute is passed to the Exchange as is.

Reduce Only

Reduce Only order behaves differently depending on the Position Mode account setting.

  • ONE_WAY position mode: order reduces position without switching the position type
  • HEDGE position mode: SELL order reduces LONG position, BUY order reduces SHORT position

Reduce only switch can be specified via the 6201 (ReduceOnly) or 6470 (Offset) attributes. 6470 (Offset) attribute's value sets Reduce only switch to true.

Symbology

Symbols use the currency short code and perpetual abbreviation. For example:

accountTypesymbol
REGULARBTCPFC, XRPPFC, etc.
UNIFIEDBTC-PERP, ETH-PERP, etc.

Configuration

Connector settings

ParameterDefault ValueDescription
accountTypeREGULARFutures account type. Valid values: REGULAR or UNIFIED.
positionModeONE_WAYPosition mode. Valid values: ONE_WAY or HEDGE.
cancelAllOrdersAfternot enabledHas two settings: period, timeout. This feature can work like Cancel-On-Disconnect behavior. https://docs.lmex.io/pages/futures.html#/operations/post-api-v2.1-order-cancelAllAfter
websocketHeartbeatInterval10 secondsWebsocket ping interval.
tradesSyncSettings.allTradesRequestSizeLimit200Limitation for the number of trades in the account trade list history response. Maximum value is 500.
tradesSyncSettings.orderTradesRequestSizeLimit500Limitation for the number of trades in the single order trade list history response. Maximum value is 500.
tradesSyncSettings.tradeHistoryLookBackPeriod5sThe time interval from order creation to the past for the start time filter of the trade history requests (all trade history and trade history for a single order).
tradesSyncSettings.maxInactiveOrderAge5mDelay before INACTIVE order cancellation after synchronization. The delay counts from the orders submission. Inactive state is reported by the exchange for unknown or closed orders.

Supported order attributes

KeyDescription
1818 (PostOnly) attribute is relevant for LIMIT orders only. Possible values: 6.
59TimeInForce override for an order. Expected values: GTC, IOC, FOK, HALFMIN, FIVEMIN, HOUR, TWELVEHOUR, DAY, WEEK or MONTH.
6201reduceOnly switch. Valid values: true or false. Default: false. See Reduce Only section for detailed explanation.
6340Position mode. Valid values: ONE_WAY or HEDGE.
64706470 (Offset) attribute allows to configure reduceOnly switch. CLOSE attribute's value sets reduceOnly value to true. Possible values: OPEN or CLOSE. See Reduce Only section for detailed explanation.

Config sample

connectors {
LMEXFUT: ${template.connector.crypto.lmexfut} {
settings {
restUrl = "https://api.lmex.io"
websocketUrl = "wss://ws.lmex.io/ws/futures"

apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}