Real time crypto monitoring tool

Overview

Real-time Crypto Currency Monitor

This monitor is a command line dashboard, it uses ncurses, in combination with the Binance API where it fetches all the data from.

Crypto currency data is readily available from Binance API end points, not only that, but we are able to make a ludicrous amount of requests (up to 1200 request weight per minute!). We can take profit of that and develop cool tools, such as this present command line dashboard.

Right now it can also be linked to your personal Binance portfolio using your api key and api secret key. It will only display your current portfolio cryptos, as well as an overview of the total value in USDT

Crypto Monitor

Conntact me on twitter Tweet | Create an issue


Table of Contents

  1. Disclaimer
  2. Description
  3. Usage
  4. Dependencies
  5. Installation
  6. References
  7. Author

Disclaimer

I know cryptocurrency might be a hot polarizing topic. This project was done to exploit the fine resolution data that is easily accessible for everyone. Crypto trading should not be seen as a game at all.

I am by no means a crypto currency expert. This project was done out of curiosity and the fact that there is a lot of data to fetch out there, which made a project like this interesting to do.

The usage you might give to the application is at your own risk. Crypto currency trading is not a game and should not be seen as one.

Description

This command line dashboard was built using ncurses, in combination with Binance API.

Crypto currency data is fetched using the following Binance API end points:

  1. https://api.binance.com/api/v3/aggTrades
  2. https://api.binance.com/api/v3/ticker/price
  3. https://api.binance.com/api/v3/ticker/account (HMAC SHA256)1

1 Requires HMAC SHA256 signature

End points 1 and 2 are used to get historical data, aggTrades is used within the code to get all aggregrated currencies that should be listed in Orchestrator.cpp::Orchestrator::currencies vector,

Orchestrator::Orchestrator(bool wallet) : _wallet(wallet){
  std::vector<std::string> currencies{"BTCUSDT", "REEFUSDT"};
  ...
 
}

You can add more to the currencies vector, these will be queried once every 10 seconds. This task is launched in threads, meaning that the requests to binance will be done in parallel (in case you are querying more than one currency). It is important to notice that you have a request weight limit! More info on that on the official Binance API website

End point 2, is the one used to fetch the data that is used for the dashboard. This one is querying data every two seconds.

The third endpoint will only work if you set to true the WALLET variable in Variables.h. To do so you need to add the -DWALLET=true option when making the executable via cmake.

#define WALLET false

It is per default in false. If you do change it to true, please notice that you have to add the following env variables into your .bashrc file.

BINANCE_API_KEY="YOUR API KEY"
BINANCE_API_SECRE="YOUR API SECRET"

These will be used eventually in QueryCrypto.cpp::QueryCrypto::getRequest(),

  ...
  // Headers and set up signature
  if (wallet){
    const char *API_KEY = std::getenv("BINANCE_API_KEY");
    const char *API_SECRET = std::getenv("BINANCE_API_SECRET");

Adding your api key information will make the dashboard able to display your current wallet information, as displayed below,

Wallet Tracker

Displaying then, information related to all currencies you hold plus the total potfolio value in usdt. There is some information that will be always displayed as per default, this being the current request weight, that resets to 0 every 1 minute.

Usage

Tested in linux only

Starting the dashboard

source cryptomonitor

The dashboard will show in the terminal with some default coins to display. It might take a couple of seconds until it has requested some data from the Binance api end point to fully display a crypto currency time series.

Selecting different currencies

Click F1, this will open a selection window (modified code from flarn2006's repo)

Selection Window

You can select up to 3 different cryptos to display on the dashboard.

You can also select the amount of data to display. The deault is 180 data points. That corresponds to 360 seconds of data, or a 6 minute window frame.

Dependencies

  1. ncurses sudo apt install libncurses5-dev libncursesw5-dev
  2. libcurl sudo apt-get install -y libcurl-dev
  3. Open SSL sudo apt-get install libssl-dev
  4. cmake sudo apt-get -y install cmake

Installation

Clone this repository like so,

git clone https://github.com/edghyhdz/crypto_monitor.git

Once inside the root project folder crypto_monitor,

# Lets start by creating the build directory
mkdir build && cd build

# If you dont want to enable any Binance wallet
# then just run
cmake ..

# If you want to enable your binance wallet and 
#you have input your API details (key and secret)
cmake .. -DWALLET=true

# Finally
source install.sh

install.sh will run the final installation that will create a terimal shortcut named cryptomonitor.

The final project folder structure is the following,

.
├── ...
├── build                     # Directory were project was built
│   ├── executable            # Executable location
│       ├── data_test         # csv data used by the dashboard <- all data will be in these two folders
│       └── data_aggregated   # aggregated csv data -not used by the dashboard-
└── ...

If everything was done allright, you should be able to run the dashboard by doing the following,

source cryptomonitor

References

There was one incredible repository I happen to come accross, this was flarn2006's repository MiscPrograms.

This repo included an amazing script to do plots using the ncurses library. I took parts of his/her script, particularly this one graph.c, and adapted it to plot in a real-time basis.

All other references can be found inside the code.

Author

Edgar Hernandez

You might also like...
A command-line tool to generate Linux manual pages from C source code.

mangen A command-line tool to generate Linux manual pages from C source code. Description mangen is, as said above, a program to generate Linux manual

Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage

What is UTBotCpp? UTBotCpp generates test cases by code, trying to cover maximum statements and execution paths. We treat source code as source of tru

CfgManipulator is a fast and powerful tool for working with configuration files for the C++ language
CfgManipulator is a fast and powerful tool for working with configuration files for the C++ language

CfgManipulator is a fast and powerful tool for working with configuration files for the C++ language. It can read, create strings and sections, change the value of a string and much more.

brn is a command line tool similar to vimv.
brn is a command line tool similar to vimv.

brn is a command line tool similar to vimv. It can be used to easily mass-rename files in your preferred text editor (i.e. vim).

This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied.

stereodemux This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied. It expects 16-bit signed-integer MPX (F

nicegraf-shaderc is a command-line tool that transforms HLSL code into shaders for various graphics APIs.
nicegraf-shaderc is a command-line tool that transforms HLSL code into shaders for various graphics APIs.

User Manual Table of Contents Introduction Project Status Obtaining the Source Code and Building Running Defining Techniques Generated Header File Pip

FastReport.Cloud console tool for Linux and perhaps some other OSes

FastReport Cloud console shell This is a simple console shell to FastReport Cloud service. Prerequests GNU packages for build shell: curl-development

Netdata's distributed, real-time monitoring Agent collects thousands of metrics from systems, hardware, containers, and applications with zero configuration.
Netdata's distributed, real-time monitoring Agent collects thousands of metrics from systems, hardware, containers, and applications with zero configuration.

Netdata is high-fidelity infrastructure monitoring and troubleshooting. It runs permanently on all your physical/virtual servers, containers, cloud deployments, and edge/IoT devices, and is perfectly safe to install on your systems mid-incident without any preparation.

A shellcode crypto-packing tool for PoC (used with msfvenom payloads)

crypter A shellcode crypto-packing tool for PoC (used with msfvenom/binary payloads) This tool is for proof of concept only - please use responsibly.

A Powerful, Easy-to-Use, Compact, Cross-Platform and Installation-Free Crypto Tool. 一个强大,易用,小巧,跨平台且免安装的加密解密签名工具。
A Powerful, Easy-to-Use, Compact, Cross-Platform and Installation-Free Crypto Tool. 一个强大,易用,小巧,跨平台且免安装的加密解密签名工具。

GpgFrontend GpgFrontend is a Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP Crypto Tool. By using GpgFrontend, you can

Overlay Microsoft Flight Simulator (FS2020) aircraft data onto real airport charts in real-time
Overlay Microsoft Flight Simulator (FS2020) aircraft data onto real airport charts in real-time

FLIGHTSIM CHARTS Introduction Overlay Microsoft Flight Simulator (FS2020) aircraft data onto real airport charts in real-time. Instantly teleport to a

jvm-monitor is a lightweight monitoring tool that logs all the local variables whenever exceptions occur.

jvm-monitor jvm-monitor is a Java agent attached to a Java VM (virtual machine), which logs all the local variables when exceptions occur. Rationales

MemoryLeakDetector is a native memory leak monitoring tool developed by Xigua video android team
MemoryLeakDetector is a native memory leak monitoring tool developed by Xigua video android team

MemoryLeakDetector is a native memory leak monitoring tool developed by Xigua video android team. It has simple access, wide monitoring range, excellent performance and good stability. It is widely used in native-memory-leak-governance of ByteDance's major apps, and the benefits are significant!

NVIDIA GPUs htop like monitoring tool
NVIDIA GPUs htop like monitoring tool

NVTOP What is NVTOP? Nvtop stands for NVidia TOP, a (h)top like task monitor for NVIDIA GPUs. It can handle multiple GPUs and print information about

Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.
Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.

Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.

Updates the Wii's current system time with the real world time.

Fix Wii System Time This is a homebrew tool I made for the Wii a while ago. It updates the current system time with the real world time via worldtimea

Anomaly Detection on Dynamic (time-evolving) Graphs in Real-time and Streaming manner
Anomaly Detection on Dynamic (time-evolving) Graphs in Real-time and Streaming manner

Anomaly Detection on Dynamic (time-evolving) Graphs in Real-time and Streaming manner. Detecting intrusions (DoS and DDoS attacks), frauds, fake rating anomalies.

Analytics In Real-time (AIR) is a light-weight system profiling tool

Analytics In Real-time Analytics In Real-time (AIR) is a light-weight system profiling tool that provides a set of APIs for profiling performance, lat

Owner
Edgar Hernandez
Edgar Hernandez
A command line tool for numerically computing Out-of-time-ordered correlations for N=4 supersymmetric Yang-Mills theory and Beta deformed N=4 SYM.

A command line tool to compute OTOC for N=4 supersymmetric Yang–Mills theory This is a command line tool to numerically compute Out-of-time-ordered co

Gaoli Chen 1 Oct 16, 2021
pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material.

pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material. The tool is detecting depending on the filename, which PBR information is stored. It swizzles the images and does reassign the channels to a glTF 2.0 image. The tool stores the images plus a minimal, valid glTF 2.0 file containing the required material, textures and images.

UX3D GmbH 23 Jul 31, 2022
A command-line tool to display colorful distro information.

sjfetch A command-line tool to display colorful distro information.

Fikret Musk 6 Apr 6, 2022
Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Ferhat Geçdoğan 3 Jun 11, 2021
Bootloader recovery and updater tool for StarFive JH17x0 SoCs.

JH71xx-tools Bootloader recovery and updater tool for StarFive JH7100 SoCs.

Kali Prasad 12 May 1, 2022
Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

GPUOpen Effects 190 Dec 12, 2022
A command line tool with no external dependencies to print information about an X server instance.

xinfo A command line tool with no external dependencies to print information about an X server instance. Building and running To build the code in thi

Jean-Michel Gorius 6 Jan 13, 2022
A C++ console tool to tracker baby actions.

BabyTracker This is a C++ console tool to tracker baby actions. Currently it supports adding Sleep Sessions Breast Feed Sessions Bottle Feed Sessions

YuchenPersonal 1 Oct 17, 2021
A command-line tool to extract dylib files from the dyld shared cache file.

DyldExtractor A command-line tool to extract dylib files from the dyld shared cache file. Starting with macOS 11, standalone binaries of system librar

Cyandev 10 Sep 13, 2022
Microsoft Visual TrueType(VTT) command line compile tool.

Project Microsoft Visual TrueType(VTT) is a professional-level tool for graphically instructing TrueType and OpenType fonts. For details on the tool v

Microsoft 39 Dec 21, 2022