All Projects → niXman → binapi

niXman / binapi

Licence: Apache-2.0 license
Binance API C++ implementation

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to binapi

binance-bot
Very simple binance trading Bot using Binance REST API
Stars: ✭ 108 (-16.28%)
Mutual labels:  binance, binance-api
hedgehog
Source code for the "Hands-on Elixir & OTP: Cryptocurrency Trading Bot" course
Stars: ✭ 70 (-45.74%)
Mutual labels:  binance, binance-api
binance-chain-kit-ios
Full Binance DEX iOS library (SDK), implemented on Swift.
Stars: ✭ 15 (-88.37%)
Mutual labels:  binance, binance-api
Twitter Activated Crypto Trading Bot
Buys crypto through keyword detection in new tweets. Executes buy in 1 second and holds for a given time (e.g. Elon tweets 'doge', buys Dogecoin and sells after 5 minutes). Tested on Kraken and Binance exchanges
Stars: ✭ 92 (-28.68%)
Mutual labels:  binance, binance-api
binance-client-websocket
🛠️ C# client for Binance websocket API
Stars: ✭ 41 (-68.22%)
Mutual labels:  binance, binance-api
binancer
An R client to the Public Rest API for Binance.
Stars: ✭ 51 (-60.47%)
Mutual labels:  binance, binance-api
cryptodiversify
Automatically check your portfolio on the Binance exchange and advice you on rebalancing your portfolio into the top 20 cryptocurrencies by market capitalization
Stars: ✭ 43 (-66.67%)
Mutual labels:  binance, binance-api
binance-spot-order-notification-heoku
[binance order trade fill notification] Telegram Notification when Binance order created, cancelled or filled. Ready to Deploy on Heroku
Stars: ✭ 30 (-76.74%)
Mutual labels:  binance, binance-api
unicorn-binance-suite
The UNICORN Binance Suite is a Python Meta Package of unicorn-fy, unicorn-binance-local-depth-cache, unicorn-binance-rest-api, unicorn-binance-trailing-stop-loss and unicorn-binance-websocket-api.
Stars: ✭ 35 (-72.87%)
Mutual labels:  binance, binance-api
java-binance-api
Java Binance API Client
Stars: ✭ 72 (-44.19%)
Mutual labels:  binance, binance-api
binance-technical-algorithm
Technical trading algorithm for Binance
Stars: ✭ 44 (-65.89%)
Mutual labels:  binance, binance-api
binance-rs-async
Async client for the Binance APIs
Stars: ✭ 74 (-42.64%)
Mutual labels:  binance, binance-api
multi pairs martingle bot
A muti pairs martingle trading bot for Binance exchange.
Stars: ✭ 55 (-57.36%)
Mutual labels:  binance, binance-api
binance-connector-dotnet
Lightweight connector for integration with Binance API
Stars: ✭ 77 (-40.31%)
Mutual labels:  binance, binance-api
howtrader
Howtrader is a crypto currency quant framework, you can easily develop, backtest and run your own strategy in real market. It also supports tradingview or other 3rd party signals, just simply send a post request and it will help trade automatically. Now it only support binance spot, futures and inverse futures exchange. It will support okex, ftx…
Stars: ✭ 294 (+127.91%)
Mutual labels:  binance, binance-api
BitView
A crypto portfolio written in Flutter. It supports Binance, Bittrex, HitBTC, Coinbase, Coinbase Pro and Mercatox
Stars: ✭ 50 (-61.24%)
Mutual labels:  binance, binance-api
Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook
Python based Trading Bot that uses TradingView.com webhook JSON alerts to place orders(buy/sell/close/manage positions/TP/SL/TS etc.) on Bybit.com. Hire me directly here https://www.freelancer.com/u/Beannsofts for any assistance
Stars: ✭ 235 (+82.17%)
Mutual labels:  binance, binance-api
twitter-crypto-bot
This is a Twitter bot that tweets about cryptocurrencies prices every certain amount of minutes
Stars: ✭ 21 (-83.72%)
Mutual labels:  binance, binance-api
Crypto Signal
Github.com/CryptoSignal - #1 Quant Trading & Technical Analysis Bot - 3,100+ stars, 900+ forks
Stars: ✭ 3,690 (+2760.47%)
Mutual labels:  binance, binance-api
hands-on-elixir-and-otp-cryptocurrency-trading-bot
Source code to generate the "Hands-on Elixir & OTP: Cryptocurrency trading bot" book
Stars: ✭ 210 (+62.79%)
Mutual labels:  binance, binance-api

binapi

Binance API implemented in C++ for both synchronous and asynchronous way.

Donate

BTC: 3BJKvx6LyKB2J5KgRBqst415KKmwQE5eQX

Motivation

This implementation has been developed as a consequence of the lack of suitable alternatives as part of my multiuser trading platform project.

REST API

WebSocket API

Implementation details

The project is written using C++14 and boost (at least version 1.70). boost.beast is used to interact with the network.

Synchronous example

#include "binapi/api.hpp"

#include <boost/asio/io_context.hpp>

#include <iostream>

int main() {
    const std::string pk = "...";
    const std::string sk = "...";

    boost::asio::io_context ioctx;
    binapi::rest::api api(
        ioctx
        ,"api.binance.com"
        ,"443"
        ,pk
        ,sk
        ,10000 // recvWindow
    );

    auto account = api.account_info();
    if ( !account ) {
        std::cerr << "account info error: " << account.errmsg << std::endl;
        return EXIT_FAILURE;
    }

    std::cout << "account info: " << account.v << std::endl << std::endl;

    return EXIT_SUCCESS;
}

Asynchronous example

#include "binapi/api.hpp"

#include <boost/asio/io_context.hpp>

#include <iostream>

int main() {
    const std::string pk = "...";
    const std::string sk = "...";

    boost::asio::io_context ioctx;
    binapi::rest::api api(
        ioctx
        ,"api.binance.com"
        ,"443"
        ,pk
        ,sk
        ,10000 // recvWindow
    );

    api.account_info([](const char *fl, int ec, std::string errmsg, binapi::rest::account_info_t res) {
        if ( ec ) {
            std::cerr << "account info error: fl=" << fl << ", ec=" << ec << ", emsg=" << errmsg << std::endl;
            return false;
        }

        std::cout << "account info: " << res << std::endl;

        return true;
    });

    ioctx.run();

    return EXIT_SUCCESS;
}

WebSocket example

#include <binapi/api.hpp>
#include <binapi/websocket.hpp>

#include <boost/asio/io_context.hpp>

#include <iostream>

int main() {
    boost::asio::io_context ioctx;

    binapi::ws::websockets ws{
         ioctx
        ,"stream.binance.com"
        ,"9443"
    };

    ws.part_depth("BTCUSDT",
        [](const char *fl, int ec, std::string emsg, auto depths) {
            if ( ec ) {
                std::cerr << "subscribe depth error: fl=" << fl << ", ec=" << ec << ", emsg=" << emsg << std::endl;

                return false;
            }

            std::cout << "depths: " << depths << std::endl;

            return true;
        }
    );

    ws.trade("BTCUSDT",
        [](const char *fl, int ec, std::string emsg, auto trades) {
            if ( ec ) {
                std::cerr << "subscribe trades error: fl=" << fl << ", ec=" << ec << ", emsg=" << emsg << std::endl;

                return false;
            }

            std::cout << "trades: " << trades << std::endl;

            return true;
        }
    );

    ioctx.run();

    return EXIT_SUCCESS;
}

Tools (will write later...)

  • filters
  • report generators
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].