Coder Social home page Coder Social logo

wyatt's Introduction

alt text

Wyatt is a Java & Spring based cryptocurrency trading bot that uses the public Binance API. It is run by providing it with API keys generated at binance.com (Also provide Wyatt with Twitter API keys if tweet alerts are desired). The bot then will pull recent trade candlestick data for the last 125 hours (5.2 days) and calculate a target price. If the target price is above the current price, a sell is executed and a buy back is placed. If not, Wyatt will wait 25 seconds before repeating the prediction/trading process. Above is a link to the current status of Wyatt running connected to my personal Binance account.

Architecture

The bot itself is kicked off by a Spring Boot Application. The Spring App also exposes some endpoints that can interact and use the bot's functions. The available endpoints will be described in the API section. These endpoints will then be used for a web UI showing more informative feedback about the bot's operation and status.

Logic

Wyatt trade logic

Endpoints

To get the current bot's status (main UI):

GET: http://host-ip:port/status

To get the current bot's BTC balance:

GET: http://host-ip:port/balance/btc

To get the current bot's profit (%):

GET: http://host-ip:port/balance/profit

To get the current bot's open orders:

GET: http://host-ip:port/orders

To shutdown the bot:

GET: http://host-ip:port/seppuku?pass={password}

Install

Some example commands to run before attempting to build or run

# Install necessary commands/software
sudo apt update
sudo apt upgrade
sudo apt install apache2 default-jdk maven cloc

# Clone the necessary repos
git clone https://github.com/mtheory7/wyatt.git
git clone https://github.com/binance-exchange/binance-java-api.git

# Move the example start script to the root directory
# Make sure to edit the sh file to fill in password and api keys
cp wyatt/src/main/resources/examples/bringYourselfBackOnline.sh bringYourselfBackOnline.sh
# Make the script executable
chmod +x bringYourselfBackOnline.sh

# Remove and replace index with example
# Make sure to edit the index.php file to point to the correct place, i.e. replace host and port number
sudo rm /var/www/html/index.*
sudo cp wyatt/src/main/resources/examples/index.php /var/www/html/index.php

# Execute start script to rebuild Binance-API, Wyatt, and start the program
./bringYourselfBackOnline.sh

Building

First clone and build the Binance-API repository to install the necessary packages into your local Maven repository (it is needed to build Wyatt)

To build Wyatt clone this repository and on the same level as pom.xml, execute

mvn clean install

Executing

To run Wyatt, execute the following

java -jar target/wyatt-{VERSION}.jar <arg1> <arg2> <arg3> <arg4> <arg5> <arg6>
  • arg1 = Binance API Key*
  • arg2 = Binance Secret Key*
  • arg3 = Twitter OAuth Consumer Key
  • arg4 = Twitter OAuth Consumer Secret
  • arg5 = Twitter OAuth Access Token
  • arg6 = Twitter OAuth Access Token Secret

Executing without Twitter

If you desire to not use the tweeting feature of the bot, simply pass in only the two Binance keys necessary to trade!

java -jar target/wyatt-{VERSION}.jar <arg1> <arg2>
  • arg1 = Binance API Key*
  • arg2 = Binance Secret Key*

*The Binance API Key absolutely MUST have approval to execute trades from Binance, but does not need approval to withdraw.

wyatt's People

Contributors

mtheory7 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.