Config

Gateway config files use the TOML format.

All gateways include a template config file installed to $PREFIX/share/<name>/config.toml. For example, you can copy the template like this, if you have installed the Deribit gateway to your conda environment

cp $CONDA_PREFIX/share/roq-deribit/config.toml deribit.toml

Symbols

These are the include/exclude regex filters for reference and market data.

1[symbols]
2include = [ "some_symbol", "some_prefix-.*" ]
3exclude = [ ".*without_this.*" ]

This may be simplified.

1symbols = ".*"
1symbols = [ "some_symbol", "some_prefix-.*" ]

Accounts

These are the exchange logins.

The master account is the one being used for subscribing e.g. reference and market data. There can only be one master account.

Each table contains the authentication details for an account.

1[accounts]
2
3  [accounts.my_account]
4  login = "some_username"
5  secret = "some_secret"
6  symbols = [ "some_symbol", "some_prefix-.*" ]
7  master = true

Symbols can be a single symbol or regex, or a list of such.

Users

These are the permissions for each client (trading strategy) allowed to connect to the gateway.

Permissions include

  • List of accounts that can be used for order routing.

  • List of symbols that can be traded.

  • Limits on order placement frequency.

Each table contains the authentication details of a user.

1[users]
2
3  [users.user_one]
4  password = "some_secret_password"
5  accounts = [ "my_account" ]
6  symbols = [ "some_symbol" ]
7  monitor_period = 60
8  ban_period = 300
9  request_limit = 10

Secrets

It may be useful to exclude secrets from the general config file.

A secrets file is a simple key-value map like this

1A1 = "some_secret"
2A2 = "some_other_secret"

When the general config file is being parsed for an account and

  • the secret key is not found, and

  • a secrets file has been specified on the command-line, then

the secret will be looked up from the secrets file.

Note

The inverse is not true: If the config file has the secret key specified for an account, it will be used.

Assume this is part of the config file

1[accounts]
2
3  [accounts.A1]
4  login = "some_username"
5
6  [accounts.A2]
7  login = "another_username"
8  secret = "another_secret"

Then the secret for A1 is some_secret (looked up in the secrets file) and the secret for A2 is another_secret (from config file).