Code Monkey home page Code Monkey logo

binancetrader's Introduction

Binance Trader

A fast and minimalist web frontend to trade cryptos on Binance®

v1.0.png (version 1.0)

Introduction

Binance is a great crypto exchange with one of the largest selection of crypto assets to buy and sell.

However, if you use the site on a regular basis you might notice that their web interface is quite cluncky and slow to use. For example, there is no easy way to display and see live prices of all your favorite cryptos in one view. In addition, buying and selling is slow and cumbersome as you have to open each asset in dedicated windows and enter your trade inputs each time. There is also no price alert functionality so you cannot closely monitor specific price changes such as breakouts/resistance changes.

All this ultimately gets in the way of the trading workflow and the ability to react and make fast decisions.

This project aims to fix those issues by providing an alternative trading UI which focuses on fast order placement, real time position monitoring and quick price alerting functionalities - all in one view.

Project history

I originally built this app to trade on the FTX exchange. However, with the exchange going ☠️ in November 2022 I decided to adapt the code to trade on Binance.

This app therefore has the same look and feel and most of the functionalities of the original FTX app and I am adding new features and improvements on a regular basis.

Installation steps and info about the project detailed in sections below.

Contributions: if you are interested in contributing have a look at the features and bugs listed here or feel free to raise a new issue :)

Installation

!! WARNINGS !!

This app places LIVE trading orders, use it at your own risk!

I do use this app for my own trading however I make NO GUARANTY as to it's safety for YOUR trading and YOUR FUNDS! Therefore, if you are considering using this app for your own trading please make sure you understand the code and the risks before attempting to use it.

Also this app is my own personal project and it is not affiliated with Binance whatsoever.

1. Pre-requisites

You will you need your own Binance account and API keys in order to run this app. Check Binance's website if you don't have those.

2. Clone the project and run npm install (this will to download the libraries defined in BinanceTrader/package.json):

git clone https://github.com/jule64/BinanceTrader.git
cd BinanceTrader
npm install

3. Compile the Typescript project:

npm run tsc

4. Start the app:

APIKEY=your-api-key APISECRET=your-api-secret APP_PORT=5001 node App.js

Once started head over to http://localhost:5001/ on your browser to access the app.

5. Account balances (Optional):

If you want your account balances to display correctly in the app you need to update the totalFunding variable in the appData.json file to your account cash value (note it is zero by default: "totalFunding": 0)

Tech stack

This app is built with Typescript, Nodejs and Express.js with a light weight html front end. It uses tiagosiebler's Binance connectors to get real time prices from Binance and submit trading orders to the exchange. It uses socket.io for the communication between the web UI and nodejs backend.

App Timeline & Features

9 July 2023 - Bug fixes and allow price alerts to be persisted & reused between sessions

11 Dec 2022 / v1.0 - First Binance-ready version following revamp from the old FTX App.

  • Contains all the features that existed with the original FTX App except the Pnl module (to be added at a future time)
  • Main features include market/limit orders placement, account and coin balances, price alerts.
  • Also added volume and trade counts stats per coin (see "Volume30" and "TC_30s" columns in the UI)

Timeline and screenshots from the original FTX APP:

25 Sep 22 / v1.2 - Added Limit orders and some bug fixes

26 June 22 / v1.1 - Improvements on version 1

  • cleaner Front end with a FTX-like color theme
  • added account balances section at the top of the app
  • flashing alerts: as well as the sound effect from v1 now the ticker cells flash red or green on alerts
  • intelligent alerting: The alerts automatically stop flashing and stop play sound when the price crosses the alert threshold back in the non-alert price zone
  • single position balance updates: update a given position immediately after order is successfully executed
  • added a Coins column in main table to display positions in coins next to usd-equivalent positions
  • new "Add ticker" input box: add a new ticker to the main table. note the tickers are not yet persistent so they disappear from the main table on app restart (persistence to be added in next version of the app)

v1.1.png

(v1.1 screenshot)

15 June 22 / v1.0 - First working version

  • display real time prices and volumes from the exchange
  • place market orders
  • position display
  • alert setup with sound effects

v1.png

(v1 screenshot)

binancetrader's People

Contributors

jule64 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

binancetrader's Issues

Fix ticker position not showing when ticker is added via the "Add ticker" function

When a ticker is added via the "Add ticker" button, any existing position in that ticker doesn't display on the UI when it should.
Similarly if a user has no prior position in a ticker and adds that ticker using the "Add ticker" function, then any position he opens afterwards will not will not be displayed either. See example screenshots below for illustration.

Current workaround is to add the ticker to the static "tickerWatchlist" in appData.json and restart the app so that the ticker gets displayed.

Example replication:

  1. User with existing position in SNX/BUSD adds the ticker via the "Add ticker" function:
    image

  2. SNX ticker is added but user's position is not showing:
    image

Enable /USDT tickers

Currently the app works only for tickers denominated in BUSD. So for example ETH/BUSD

While this works for most coins it doesn't work for coins listed against other stable coins (or any denominator other than BUSD for that matter), for example ARB/USDT.

So by this change we want to fix the issue for the USDT case first, as this will take care of most of the tickers that are currently not listed in BUSD. Later we can generalise the logic so that the app works for any denominator.

Fix wrong ticker balance when order is executed in multiple slices

We currently use the 'quantity' field of the order execution confirmation to update the ticker balance in the UI (see 'orders:fill' event). This is wrong as the quantity is the original order quantity not the executed quantity. This is a problem when an order is executed in multiple slices, as usually happens with limit orders, as now we update the ticker balance with the original quantity every time a slice is executed. This cause the final displayed balance to be incorrect.

Using the 'lastTradeQuantity' value of the order confirmation instead should fix the problem

Persist tickers added via "Add ticker" function

Currently a ticker added to the UI via the "Add ticker" function will disappear from the list on app restart. We want to fix this by persisting the tickers to main watchlist.

Dependency: this feature is dependent on #1 to be implemented first as currently the main watchlist in configured in a json file.

Persist tickerWatchlist to Sqlite

The tickers watchlist is currently configured in appData.json. We want to have this list in a db table instead.

Since we do not use a db in the project yet I suggest going for SQLite as the db provider however happy to use something else if anyone has knows of a better option.

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.