Skip to content

HODLR is a High Frequency Trading algorithm written in NodeJS and this version works exclusively for USTC (Terra Classic)

Notifications You must be signed in to change notification settings

arunadaybasu/hodlr-ustc-trading-automation

Repository files navigation

HODLR

PROPRIETARY High Frequency Trading Algorithm

NOTE - DO NOT COPY OR USE THE CODE WRITTEN IN THE ALGORITHM FOR ANY COMMERCIAL PURPOSES THAT IS NOT APPROVED BY ME (ARUNADAY BASU)

For licensing and usage rights please contact at the following email id: [email protected]

THIS ALGORITHM HAS BEEN RELEASED FOR EDUCATIONAL PURPOSES "ONLY" AND ALL ATTEMPTS TO USE IT COMMERCIALLY FOR ABSOLUTELY ANY PURPOSE WITHOUT LEGAL RIGHTS WILL BE REPORTED TO CONCERNED AUTHORITIES AND LITIGATED

DO NOT USE THIS ALGORITHM WITHOUT LEGAL USAGE RIGHTS

Instructions

  1. Install Node JS and MongoDB
  2. Create blank database
  3. Install Node modules
  4. Connect Binance API
  5. Run Node application
  6. Fire APIs

Install Node JS and MongoDB

Node JS - https://nodejs.org/ MongoDB Community Edition - https://www.mongodb.com/try/download/community

Create blank database

Create a new database called ustc_db_main

Create the following collections in the database:

  1. credentials
  2. entries_ustc
  3. prices_ustc
  4. ustc_usdt_logs
  5. market_queue_usdt
  6. dec_wait_queue
  7. inc_wait_queue
  8. binance_wait_queue
  9. binance_txns_all
  10. ustc_wait_queue
  11. ustc_txns_all

Your database should look like this:

MongoDB Database

Install Node modules

On Node/Git/Shell console - npm install

Connect Binance API

You will need to log into your profile and Select API Management from the dropdown on the upper right corner, like shown below:

Binance1

We will be generating new API keys to use in the application, as shown below:

Binance2

Binance3

Binance4

After you successfully generate a new API key, you will see the following API Key block:

Binance5

NOTE - Binance will show you the API Secret only for the first time, so remember copy both API Key and API Secret and keep it for the new step

Go back to MongoDB: to the database just created

We will create a new document in the credentials collection

Copy paste the following to Insert Document as shown below (if you are using a GUI):

{
  "apiKey": "FROM PREVIOUS STEP",
  "apiSecret": "FROM PREVIOUS STEP",
  "type": "binance"
}

MongoDB1

Run Node application

On Node/Git/Shell console - npm run start

Fire APIs

Install Postman - https://www.postman.com/downloads/

Fire APIs from Postman in the following order with a few seconds between firing APIs (after you receive confirmation on Postman fire the next)

All are GET Requests:

  1. http://localhost:3603/binanceapi/prices/update/binance-ustc
  2. http://localhost:3603/binanceapi/entry/create/rand-ustc
  3. http://localhost:3603/binanceapi/entry/process/longs
  4. http://localhost:3603/binanceapi/queue/process/ustc
  5. http://localhost:3603/binanceapi/entry/process/shorts
  6. http://localhost:3603/binanceapi/queue/process/usdt

Once you fire an API, you will receive a confirmation in Postman as shown below:

Postman1

If you have done everything as described above, you will see output on your console like the following:

Console1

About

HODLR is a High Frequency Trading algorithm written in NodeJS and this version works exclusively for USTC (Terra Classic)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages