A service that connects to the CME's Straight Through Processing API to download trades in FIXML format, and returns easy-to-read, JSON-formatted trades.
The STP API provides access to trades done on NYMEX, COMEX, DME, CBOT, CME Clearing Europe, CDS and CME. Although the API is fairly easy to use, there are interactions thatare more appriopriately handled independent of the trade creation logic. Those include:
- managing CME downtime,
- parsing responses into more desirable formats, and
- handling API authentication.
This adapter handles these interactions, and lets you focus on handling the trades themselves (which is hard enough!). We think the industry would be better off with a tool like this out in the open, so we open-sourced it.
- Set up the prerequisites and the adapter.
- Turn on the adapter.
- Make some trades on ClearPort.
- Pick up your JSON.
This service has a few prerequisites.
- It must be run on a *nix machine.
- A queue where the adapter can drop JSON-formatted trades.
- We use Redis; a good hosted Redis is IBM's Compose.io.
- Feel free to adapt this service to work with other message queues, and send us a pull request!
- A test CME STP account.
- Clone this repo.
- Run
bundle install
. - Set environment variables.
- You can do this on the machine running the adapter, or in an
application.yml
file. A sample file is inconfig/application.sample.yml
. - For most things you can leave the defaults. You will need to set these variables:
RESQUE_HOST
should be the URL of your Redis server, i.e.,redis://x.compose.io:1234
FETCH_ACCOUNT_FROM_CONFIG
should be set totrue
so that you can configure your CME credentials via config file.
- You can do this on the machine running the adapter, or in an
- Set CME account credentials.
- You can do this in
config/account-config.json
(recommended), or set up a web service that returns the same information. A sample config file is inconfig/account-config-sample.json
.
- You can do this in
- Start the adapter.
- The listener's entry point is a simple Thor script. Run
./cme.thor
to start the program (it will begin logging useful information). If you see Creating MasterSupervisor then you know the listener was started correctly.
- The listener's entry point is a simple Thor script. Run
- Make a trade on the CME ClearPort website.
- Look for the FIXML message in the logs, and the JSON in your Redis queue!
Copyright © 2016 Molecule Software, Inc. All Rights Reserved.
Licensed under the MIT License (the "License"). You may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE.md file.