roq-bitget

$ conda install \
      --channel https://roq-trading.com/conda/unstable \
      roq-bitget
$ conda install \
      --channel https://roq-trading.com/conda/stable \
      roq-bitget

Supports

Products

Spot

Futures

Swap

Option

Orders & Quotes
Account

Funds

Position

Note

✅ = Available.

❎ = Not implemented.

❌ = Unavailable.

❶ The exchange protocol does not support streaming updates for reference data and market status.

❷ The exchange protocol does not support stop orders.

Using

$ roq-bitget [FLAGS]

Flags

$ roq-bitget --help
--exchange (bitget)

Exchange identifier

--api

API (SPOT, MARGIN, USDT-FUTURES, USDC-FUTURES, COIN-FUTURES)

--rest_uri (https://capi.bitget.com)

Exchange end-point

--rest_proxy

Proxy end-point

--rest_ping_freq (5s)

Ping frequency

--rest_ping_path (/api/spot/v1/public/time)

Ping path

--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

--rest_cancel_on_disconnect (false)

Auto-cancel orders on disconnect?

--ws_public_uri (wss://ws.bitget.com/v2/ws/public)

Exchange end-point

--ws_private_uri (wss://ws.bitget.com/v2/ws/private)

Exchange end-point

--ws_ping_freq (15s)

Ping frequency

--ws_request_timeout (15s)

Request timeout

--ws_max_subscriptions_per_stream (100)

Maximum number of symbols per connection

--ws_mbp_request_delay (500ms)

Request delay

--ws_mbp_request_max_retries (3)

Request max retries

--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?

Environments

$ --flagfile $CONDA_PREFIX/share/roq-bitget/flags/prod/flags.cfg
# flagfile for the roq-bitget gateway

--rest_uri=https://api.bitget.com
--ws_public_uri=wss://ws.bitget.com/v3/ws/public
--ws_private_uri=wss://ws.bitget.com/v3/ws/private

Configuration

$ --flagfile $CONDA_PREFIX/share/roq-bitget/config.toml

Important

This template will be replaced when the software is upgraded. Make a copy and modify to your own needs.

# config template for the roq-bitget gateway

symbols = [
 "^BTCUSDT$",
 "^BTCPERP$",
]

[accounts]

  [accounts.A1]
  master = true
  login = "YOUR_BITGET_API_KEY_GOES_HERE"
  secret = "YOUR_BITGET_SECRET_GOES_HERE"
  symbols = [ ".*" ]

[users]

  [users.test]
  password = "1234"
  symbols = ".*"

  [users.trader]
  password = "secret"
  accounts = [ "A1" ]
  symbols = [ "BTCUSDT", "BTCPERP" ]

[rate_limits]

  [rate_limits.global]
    type = "ORDER_ACTION"
    aggregate = true
    request_limit = 100
    monitor_period = "10s"
    ban_period = "5m"

Market Data

Inbound

Enum

listed

UNDEFINED

online

OPEN

limit_open

PRE_OPEN

offline

CLOSE

restrictedAPI

HALT

Event

Field

Ticker

openPrice24h

OPEN_PRICE

Ticker

highPrice24h

HIGHEST_TRADED_PRICE

Ticker

lowPrice24h

LOWEST_TRADED_PRICE

Ticker

indexPrice

INDEX_VALUE

Ticker

volume24h

TRADE_VOLUME

Ticker

fundingRate

FUNDING_RATE

Ticker

openInterest

OPEN_INTEREST

Order Management

Inbound

Enum

MARKET

MARKET

LIMIT

LIMIT

Enum

ioc

IOC

fok

FOK

gtc

GTC

post_only

GTC

Enum

live

WORKING

new

WORKING

partially_filled

WORKING

filled

COMPLETED

cancelled

CANCELED

Outbound

order_type

execution_instructions

price

stop_price

orderType

timeInForce

price

reduceOnly

MARKET

NaN

NaN

market

MARKET

NaN

LIMIT

NaN

limit

LIMIT

PARTICIPATE_DO_NOT_INITIATE

NaN

Limit

TBD

TBD

TBD

Comments

  • Stop orders are not supported

References

Common

Exchange