roq-kucoin-futures#

Important

This gateway needs sponsorship to complete certain features.

Purpose#

  • Maintain network connectivity with the KuCoin Futures exchange

  • Route exchange updates to connected clients

  • Route client requests to the relevant exchange accounts

  • Stream all messages to an event-log

Overview#

Products

Spot

Futures

Options

Market Data

Reference Data

Market Status

Top of Book

Market by Price (L2)

Market by Order (L3)

Trade Summary

Statistics

Order Management

Create

Modify

Cancel

Cancel All

Auto Cancellation

Account Management

Positions

Funds

  • Data center located in … (to be confirmed)

  • No test environment

Conda#

$ conda install \
  --channel https://roq-trading.com/conda/stable \
  roq-kucoin-futures
$ cp $CONDA_PREFIX/share/roq-kucoin-futures/config.toml $CONFIG_FILE_PATH

# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-kucoin-futures \
      --name "kucoin-futures" \
      --config_file "$CONFIG_FILE_PATH" \
      --client_listen_address "$UNIX_SOCKET_PATH" \
      --metrics_listen_address "$TCP_LISTEN_PORT" \
      --flagfile "$FLAG_FILE"

Flags#

$ roq-kucoin-futures --help

Environments#

# flagfile

--rest_uri=https://api-futures.kucoin.com
# flagfile

--rest_uri=https://api-sandbox-futures.kucoin.com

Note

The WebSocket URI will be discovered by querying the REST service. There are therefore no additional flags to specify network end-points.

Market Data#

Event

Stream

Messages

Comments

roq::ReferenceData

MarketData

/contract/instrument

roq::MarketStatus

MarketData

/contract/instrument

roq::TopOfBook

MarketData

/contractMarket/tickerV2 or /contractMarket/ticker

roq::MarketByPriceUpdate

MarketData

/contractMarket/level2

roq::MarketByOrderUpdate

roq::TradeSummary

MarketData

/contractMarket/execution

roq::StatisticsUpdate

MarketData

/contract/announcement

Event

Stream

Messages

Comments

roq::ReferenceData

Rest

/api/v1/contracts/active

roq::MarketStatus

Rest

/api/v1/contracts/active

roq::TopOfBook

roq::MarketByPriceUpdate

Rest

/api/v1/level2/snapshot

roq::MarketByOrderUpdate

roq::TradeSummary

roq::StatisticsUpdate

Statistics#

Type

Comments

SETTLEMENT_PRICE

mark_index_price.mark_price

INDEX_VALUE

mark_index_price.index_value

FUNDING_RATE

funding_rate.funding_rate

FUNDING_RATE_PREDICTION

funding_begin.funding_rate

TRADE_VOLUME

snapshot_24h.volume

Order Management#

Event

Stream

Messages

Comments

roq::OrderUpdate

DropCopy

/contractMarket/tradeOrders

roq::TradeUpdate

Event

Stream

Messages

Comments

roq::OrderUpdate

OrderEntry

GET /api/v1/orders

It’s only possible to poll?

roq::TradeUpdate

OrderEntry

GET /api/v1/fills

It’s only possible to poll?

Event

Stream

Messages

Comments

roq::CreateOrder

OrderEntry

POST /api/v1/orders

roq::ModifyOrder

roq::CancelOrder

OrderEntry

DELETE /api/v1/orders/{order-id}

roq::CancelAllOrders

OrderEntry

DELETE /api/v1/orders

Event

Stream

Messages

Comments

roq::OrderAck

Order Types#

TBD

Time in Force#

TBD

Position Effect#

TBD

Execution Instructions#

TBD

Account Management#

Event

Stream

Messages

Comments

roq::PositionUpdate

DropCopy

/contract/position:{symbol}

roq::FundsUpdate

DropCopy

/contractAccount/wallet

Event

Stream

Messages

Comments

roq::PositionUpdate

OrderEntry

GET /api/v1/position

roq::FundsUpdate

Streams#

Type

Comments

REST

Primary purpose

  • download reference data and L2 snapshot

Type

Comments

WebSocket

Primary purpose

  • live market data

  • reference data and market status

Each connection

  • supports a slice of the symbols

Constraints#

  • It does not appear to be possible to subscribe all symbols more than once per IP address.

Comments#

  • Orders can NOT be canceled by client order id.

  • Fills are not communicated in real-time (only indirectly through order updates).

  • There are no options to instruct the exchange to auto-cancel orders on disconnect.