roq-upbit#

Important

This gateway needs sponsorship to complete certain features.

Purpose#

  • Maintain network connectivity with the UPbit 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: TBD

Conda#

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

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

Config#

Flags#

$ roq-upbit --help
--exchange (upbit)

exchange identifier (string)

--request_limit (80)

request limit per interval

--request_limit_interval (10s)

request limit monitor interval

--self_trade_prevention (CN)

self-trade prevention: CN, CO, CB, DC

--encode_buffer_size (1048576)

encode buffer size

--decode_buffer_size (10485760)

decode buffer size

--mbp_allow_price_inversion (false)

allow price inversion?

--rest_uri (https://api.upbit.com/)

REST end-point (URI)

--rest_proxy

proxy end-point (URI)

--rest_ping_freq (5s)

ping frequency

--rest_ping_path (/v1/ticker?markets=KRW-BTC)

URI path used for REST connection keep-alive messages

--rest_request_timeout (30s)

request: timeout

--rest_download_orders_page_size (500)

page size used when downloading orders

--rest_download_orders_begin (24h)

download orders since (now - begin)

--rest_download_only_active_orders (false)

download only active orders?

--rest_download_fills_page_size (500)

page size used when downloading fills

--rest_download_fills_begin (24h)

download fills since (now - begin)

--rest_token_refresh_freq (8h)

token refresh frequency

--ws_public_uri (wss://api.upbit.com/websocket/v1)

WS public end-point (URI)

--ws_private_uri (wss://api.upbit.com/websocket/v1)

WS private end-point (URI)

--ws_ping_freq (5s)

ping frequency

--ws_request_timeout (15s)

request: timeout

--ws_max_subscriptions_per_stream (100)

max symbols per connection (count)

--ws_mbp_request_delay (500ms)

request delay

--ws_mbp_request_max_retries (3)

request max retries

Environments#

$ $CONDA_PREFIX/share/roq-upbit/flags
# flagfile for the roq-upbit gateway

--rest_uri=https://api.upbit.com
--ws_public_uri=wss://api.upbit.com/websocket/v1

Market Data#

Event

Stream

Messages

Comments

roq::ReferenceData

roq::MarketStatus

MarketData

ticker

roq::TopOfBook

roq::MarketByPriceUpdate

MarketData

orderbook

roq::MarketByOrderUpdate

roq::TradeSummary

MarketData

trade

roq::StatisticsUpdate

MarketData

ticker

Statistics#

Type

Comments

OPEN_PRICE

(ticker) opening-price

HIGHEST_TRADED_PRICE

(ticker) high_price

LOWEST_TRADED_PRICE

(ticker) low_price

CLOSE_PRICE

(ticker) trade_price

TRADE_VOLUME

(ticker) trade_volume

Order Management#

Event

Stream

Messages

Comments

roq::OrderUpdate

roq::TradeUpdate

Event

Stream

Messages

Comments

roq::OrderUpdate

roq::TradeUpdate

Event

Stream

Messages

Comments

roq::OrderAck

Order Types#

Time in Force#

Position Effect#

Execution Instructions#

Account Management#

Event

Stream

Messages

Comments

roq::PositionUpdate

roq::FundsUpdate

Event

Stream

Messages

Comments

roq::PositionUpdate

roq::FundsUpdate

Streams#

Type

Comments

REST

Primary purpose

  • discover the full list of symbols

Type

Comments

WebSocket

Primary purpose

  • live market data

Each connection

  • supports a slice of the symbols

Constraints#

  • We are not currently using WebSocket compression negotiation

Comments#

  • All orderbook updates are full snapshot. We need to translate into incremental update.