java-market-maker
java-market-maker copied to clipboard
Simple Market Making bot for Quedex Bitcoin Derivatives Exchange.
Simple Market Maker in Java
An implementation of a dummy market making bot which intends to be a starting point showing a possible way of integration with Quedex Java API. Before starting to work with this code, please read the documentation of our Java API.
The implementation of the bot MUST NOT be considered complete and ready for production use. The pricing algorithms, risk management, handling of WebSocket disconnects (lack thereof), etc. are just to illustrate a simple use case.
Running
To run the bot you need to have Java 8 installed (Oracle Java is recommended).
Standalone JAR
The following steps are for Linux (tested on Ubuntu 16.04):
- Execute
./gradlew shadowJarfrom the main project directory (java-market-maker). - Jar will be created in
java-market-maker/build/libs/namedjava-market-maker-<version>-all.jar. - Copy the jar to a convenient location, place your
quedex-config.propertiesandmarket-maker.properties(examples may be found injava-market-maker/src/main/resources) next to it. - Run the jar with
java -jar java-market-maker-<version>-all.jar quedex-config.properties market-maker.properties. To exit hit CTRL + C.
From an IDE
- Clone the repository.
- Import the gradle project to your favourite IDE (tested with IntelliJ).
- Fetch the dependencies (should happen automatically).
- Rename the file
quedex-config.properties.exampleinjava-market-maker/src/main/resourcestoquedex-config.propertiesand fill in your details. - Rename the file
market-maker.properties.exampleinjava-market-maker/src/main/resourcestomarket-maker.propertiesand change the configuration according to your liking. - Run the
Mainclass.
Features
The market making bot:
- places orders with configurable quantities on configurable number of levels,
- has configurable spread,
- follows a predefined Fair Price for futures (currently last price or mid - change the implementation in the
MarketMakerclass betweenLastFairPriceProviderandMidFairPriceProvider), - places option orders priced according to Black 76' model,
- has configurable risk management - stops quoting one side of the order book when delta or vega limit exceeded,
- enables risk monitoring based on greeks (delta, vega, gamma, theta), per position and in total,
- cancels all orders when going down or on error.
Disclaimer
This document and the code presented in this repository does not constitute any investment advice. By running it, you are not guaranteed to earn any bitcoins (rather the opposite).
Contributing Guide
Default channel for submitting questions regarding the bot is opening new issues. In cases when information disclosure is not possible, you can contact us at [email protected].
Pull requests containing bugfixes are very welcome!
License
Copyright © 2017 Quedex Ltd. The bot is released under Apache License Version 2.0.