BTS Spark SDK
Getting Started
Docker
We use docker to provide a full dev environment with all the tools users need to develop their own algos.
- Setup docker on your preferred OS and pull down the BTS docker
- If you are new to docker you can find out more about it here: https://docs.docker.com/get-started/
$ docker pull bluetradingsystems/linux_docker
- Our docker can also be found here: https://hub.docker.com/r/bluetradingsystems/linux_docker/
- Start the docker container
$ docker run \
--net host \
--shm-size=1024m \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-w $PWD \
-v /home:/home \
--name bts_sdk \
-i \
-t bluetradingsystems/linux_docker \
/bin/bash
- Note that the lifetime of docker instance above is tied to the life of the shell instance, so if you exit bash, the container stops running. To start and re-attach to the container, use:
$ docker start --attach -i bts_sdk
- If you prefer to run docker as a daemon, check out
~/spark_sdk/sdk_shell.sh
Git
-
We assume the git you are using is git-lfs compatible; if you're using the git that comes with our docker, you're all set.
-
else go here: https://github.com/git-lfs/git-lfs/wiki/Installation
Now that you're ssh'd into the docker container, clone the repo into ~/spark_sdk/ and cd to that directory
$ cd
$ git clone https://github.com/BlueTradingSystems/spark_sdk.git
$ cd spark_sdk
Development
Look at examples/md_publisher_example.cpp to look at how to build a custom market data producer
Look at examples/order_plugin_example.cpp to look at how to create custom algos.
run build_examples.sh to make sure you can build the examples, this will produce an order_plugin_example.so
$ cd ~/spark_sdk/examples
$ ./build_examples.sh
Debugging
Copy the order_plugin_example.so to spark_sdk/lib/plugins/ and start the sparkd server process inside gdb
$ cp -f order_plugin_example.so ~/spark_sdk/lib/plugins/
$ cd ~/spark_sdk/lib
$ gdb --args ./sparkd run
In gdb:
(gdb) break order_plugin_example.cpp:366
Running without debugger
$ cp -f order_plugin_example.so ~/spark_sdk/lib/plugins/
$ cd ~/spark_sdk/lib
$ ./sparkd run
Connect Spark windows client
- To start a spark client, use the -ConfigServer parameter to point at this new server
> spark.exe -ConfigServer http://location/8000/config
Or create a file called spark.conf at %APPDATA%\bts\conf\ that contains:
include: "http://location:8000/config/"
Notes
- When you have a running server you can:
- Browse to http://location/8000 to set risk limits and create users
- Browse to http://location/8000/config to check configuration overrides
- Browse to http://location/8000/perf_trace to see socket to socket latencies
- Send us an email for help: api_support@bluetradesys.com