Platform Java
The Reactive Platform API for Java.
Building
Linux/Mac
git clone https://github.com/reactivemarkets/platform-java
cd platform-java
./gradlew build
Windows
git clone https://github.com/reactivemarkets/platform-java
cd platform-java
./gradlew.bat build
Using the API
Feed Gateway WebSocket API
The feed gateway provides an API to a binary feed over websockets using the Google Flatbuffers serialisation library. The API provides a flexible subscription model to stream of Level 2 market data snapshots and public trades. Subscriptions are made using a FeedRequest
message resulting in a stream of MDSnapshotL2
or PublicTrade
messages. Invalid or failed subscriptions will return a FeedRequestReject
.
A full example of subscribing to and consuming from the level 2 market data feed can be seen in the com.reactivemarkets.platform.example.feed.FeedGatewayL2Subscription
example. You will need an authorisation token to access the API which is generated against your authenticated login in the Reactive Markets platform; instructions are in the next section. The generated token must then be inserted into the websocket headers in the form "Bearer your_token".
Flatbuffers provides an efficient serialization/deserializaton mechanism in terms of both processing and space requirements. The com.reactivemarkets.platform.example.feed.FeedMessageHandler
provides an example of how to consume the binary feed into your application. Note, the generated java classes for our Flatbuffers schema are located in the com.reactivemarkets.papi
package.
Generating the authorisation token
Creating an authorisation token is a simple three step process:
- Log in to the Reactive Markets platform here
- Select the API keys option from the pop out menu in the top left of the UI.
- Select 'Create new API key'
Feed Gateway Reference Data
Reference data for use with the API is available via the REST API here. Reference data is specified on a per market basis where a market is an instrument on a venue e.g. BTCUSD-CNB or BTCUSD on Coinbase. For the market data feed the following fields are relevant:
- symbol: the symbol that should be used for subscribing to the market e.g. "BCHUSD-CNB"
- tick_numer and tick_denom: describe the numerator and denominator for market data tick sizes. For example, tick_numer=1 and tick_denom=100 would indicate the data should be formatted to 1/100 or 0.01.
- display, description, instr & venue should all be self explanatory
Help and Support
If you require any help/support, or wish to raise a new feature request, then please contact us via the support desk here.
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
Versioning
We use SemVer for versioning. For the versions available, see the releases page.
License
This project is licensed under the Apache 2.0 License. A copy of the license is available in the LICENSE.md file in the root directory of the source tree.