Gateway Integrated FIX Bridge¶
You will learn how to configure and use a gateway integrated fix-bridge.
Conda¶
Install the “roq-binance-futures” package
$ conda install -y -c https://roq-trading.com/conda/unstable roq-binance-futures
Configure¶
The FIX bridge integrated gateway is configured exactly like the classic gateway.
The gateway packages always include a TOML config template which you can copy and modify
$ cp $CONDA_PREFIX/share/roq-binance-futures/config.toml $HOME/binance-futures.toml
Edit the config file
$ vi $HOME/binance-futures.toml
This could be a valid config file
symbols = [
"^BTCUSD[A-Z]?(_[0-9]{6})?$",
"^ETHUSD[A-Z]?(_[0-9]{6})?$"
]
[accounts.A1]
login = "YOUR_BINANCE_FUTURES_API_KEY_GOES_HERE"
secret = "YOUR_BINANCE_FUTURES_SECRET_GOES_HERE"
symbols = [ ".*" ]
[users.trader]
accounts = [ "A1" ] # permissioned accounts
symbols = [ ".*BTC.*" ] # permissioned symbols
master = true # this user is used for routing order requests
[users.fix_client_1]
password = "secret"
accounts = [ "A1" ] # permissioned accounts
symbols = [ ".*BTC.*" ] # permissioned symbols
Important
Replace "YOUR_BINANCE_FUTURES_LOGIN_GOES_HERE" and "YOUR_BINANCE_FUTURES_SECRET_GOES_HERE" with your
actual exchange credentials.
Users¶
The integrated FIX bridge requires a user to be assigned “master”. All client requests are routed through this user.
All other users are FIX clients.
Running¶
The command-line to launch the gateway integrated FIX bridge
$ roq-binance-futures-fix-bridge \
--name "binance-futures" \
--config_file $HOME/binance-futures.toml \
--client_listen_address tcp://localhost:1234 \
--flagfile $CONDA_PREFIX/share/roq-binance-futures/flags/prod/flags-dapi.cfg
Note
The binary name has the -fix-bridge extension.
Here we listen for FIX client connections on TCP port 1234.
Note
The FIX bridge can listen for client connections on either TCP or UNIX socket.
Summary¶
Differences to the classic gateway
The name of the gateway integrated FIX bridge binary has the
-fix-bridgeextension.You must assign
master = trueto the user used for routing order requests.All other user names are those of FIX clients.
The
--client_listen_addresscommand-line flag is the end-point where FIX clients can connect.
And that’s it!