roq-gate¶
Links¶
Supports¶
Spot |
✓ |
Futures |
|
Options |
|
Combos |
Reference Data |
✓ |
Market Status |
|
Top of Book |
✓ |
Market by Price |
✓ |
Market by Order |
|
Trade Summary |
✓ |
Statistics |
✓ |
Create |
✓ |
Modify |
|
Cancel |
✓ |
Cancel All |
✓ |
Auto-Cancel |
Positions |
|
Funds |
✓ |
Installing¶
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-gate
$ mamba install \
--channel https://roq-trading.com/conda/unstable \
roq-gate
Using¶
$ roq-gate \
--name "gate" \
--config_file $CONFIG_FILE_PATH \
--client_listen_address $UNIX_SOCKET_PATH \
--flagfile $ENVIRONMENT_FLAGFILE
Flags¶
$ roq-gate --help
--exchange
("gate
)Exchange identifier
--rest_uri
({"https://api.gateio.ws/api/v4"s}
)Exchange end-point
--rest_proxy
({""s}
)Proxy end-point
--rest_ping_freq
({5s}
)Ping frequency
--rest_ping_path
("/
)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
--ws_uri
({"wss://api.gateio.ws/ws/v4/"s}
)Exchange end-point
--ws_ping_freq
({5s}
)Ping frequency
--ws_request_timeout
({15s}
)Request timeout
--ws_max_subscriptions_per_stream
(256
)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
(true
)Allow price inversion?
--order_book_depth
(100
)Order book depth
--order_book_freq
({100ms}
)Order book frequency
Environments¶
$ $CONDA_PREFIX/share/roq-gate/flags/prod/flags.cfg
# flagfile for the roq-gate gateway
--rest_uri=https://api.gateio.ws/api/v4
--ws_uri=wss://api.gateio.ws/ws/v4/
Configuration¶
$ $CONDA_PREFIX/share/roq-gate/config.toml
Important
The template will be replaced when the software is upgraded. Make a copy and modify to your needs.
symbols = [
"^BTC_USD[A-Z]?$",
"^ETH_USD[A-Z]?$"
]
[accounts]
[accounts.A1]
master = true
login = "YOUR_GATE.IO_API_KEY_GOES_HERE"
secret = "YOUR_GATE.IO_SECRET_GOES_HERE"
symbols = [ ".*" ]
[users]
[users.test]
password = "1234"
symbols = ".*"
[users.trader]
password = "secret"
accounts = [ "A1" ]
symbols = [ ".*BTC.*", ".*ETH.*" ]
[rate_limits]
[rate_limits.global]
type = "ORDER_ACTION"
aggregate = true
request_limit = 100
monitor_period = "10s"
ban_period = "5m"
Market Data¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
MarketData |
spot.book_ticker |
||
MarketData |
spot.order_book_update |
||
MarketData |
spot.trades |
||
MarketData |
spot.tickers |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Rest |
/spot/currencies, /spot/currency_pairs |
||
Rest |
/spot/order_book |
||
Statistics¶
Type |
Comments |
---|---|
|
(spot.tickers) |
Order Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Order Types¶
TBD
Time in Force¶
TBD
Position Effect¶
TBD
Execution Instructions¶
TBD
Account Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Streams¶
Type |
Comments |
---|---|
REST |
Primary purpose
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Constraints¶
Order book updates are throttled at 100ms (default) or 1000ms.
Order books appear to allow inverted prices.
Comments¶
All symbols not having trade_status == tradable are dropped.
Order/account management is completely missing (needs sponsorship).