Skip to content

8351270/zubr-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About the ZUBR bot

A model trading bot for the ZUBR cryptocurrency derivative trading platform. Includes connector classes that provide an abstracted interface to APIs for receiving market data and for placing trade orders, as well as a working bot that uses them to execute a basic trading strategy.

Running the bot

The bot is a non-user-interactive command line application. It requires a json configuration file to specify its numerous connection and strategy parameters, illustrated here.

Getting the bot something to talk to

To connect the bot to a live testing server to place trades requires an account with ZUBR and obtaining an IP-specific login ID. This repository includes a simple dummy server creatively named DummyBYSONServer which can accept a connection and acknowledge basic trading messages, sufficient for the bot to run, but does not test message validity or simulate the complexities of the active trading environment.

Bot Behavior

The robot attempts to maintain two limit orders:

  • a buy order at (current best purchase price + current best sale price)/2 - interest - shift * position
  • a sell order at (current best purchase price + current best sale price)/2 + interest - shift * position

Both orders are placed with volume equal to the "quoteSize" parameter, or the largest volume that will keep the bot within the bounds of maxposition >= position >= -maxposition if that is less. Orders are updated if either order is entirely filled, or when the best current prices change. The bot additionally has mechanisms to avoid violating message flooding limits.

Connector classes

BYSONChannel and MarketObserver respectively implement connections to the trading gate and the order book subscription and each can make calls to an associated interface when messages arrive. BYSONChannel additionally provides support for outgoing trading messages.

Logging

SLF4J is used for logging throughout. Initial development and testing was done with the SimpleLogger binding an a classpath properties file such as this, you can use whichever binding you please.

Dependencies

In addition to SLF4J 1.7.30, the ExampleZUBRRobot and MarketObserver classes depend on minimal-json 0.9.5 and Java-WebSocket 1.5.1. Java 8 is required.

License

The code is provided under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%