An open API service indexing awesome lists of open source software.

https://github.com/iyedexe/binfrost

Unofficial Client Library for Binance in C++
https://github.com/iyedexe/binfrost

async binance bitcoin cpp17 cpp20 crypto fix low-latency rest websocket

Last synced: 10 months ago
JSON representation

Unofficial Client Library for Binance in C++

Awesome Lists containing this project

README

          



BINFROSTLOGO


A blazing-fast, multi-protocol Binance client library β€” bridging your code to the Binance universe.

"Like the mythical Bifrost bridge, Binfrost connects you instantly and securely β€” only here, it’s crypto, not Asgard."

---

## πŸš€ Overview
**Binfrost** is a C++ client library for Binance with a focus on **performance** and **ease of use**.
It supports:
- **FIX protocol**
- **WebSocket streams**
- **REST API**

You can establish **Order Entry**, **Market Data**, and **Drop Copy** FIX connections.
The architecture is designed for **low latency**, **cross-platform builds**, and **scalability**.

---

## πŸ“¦ Features

- βœ… **FIX Protocol** β€” TLS connections, custom message cracker, order management
- βœ… **WebSocket API** β€” Exchange info, order placement, cancel orders, test orders, user streams
- βœ… **REST API** β€” Fully integrated with HMAC signing and examples
- βœ… **Portable Build** β€” Windows & Linux with [vcpkg](https://vcpkg.io)
- βœ… **Unit Tests** β€” For key components (signatures, payloads, key loading)
- βœ… **Performance-Oriented** β€” Designed for low-latency trading systems

---

## πŸ› οΈ Building

### Windows
```powershell
set VCPKG_ROOT=C:\Users\Administrator\Desktop\workbench\vcpkg
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
cmake --build build
```

### Linux

Make sure vcpkg is installed and VCPKG_ROOT & PATH are configured:
```
export VCPKG_ROOT=$HOME/workbench/vcpkg
export PATH=$PATH:$VCPKG_ROOT
```

Build from the build folder:

```
cmake .. -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
make
```
## βœ… DONE

- βœ… **FIX** Build basic client
- βœ… **FIX** Connect TLS to Binance
- βœ… **FIX** ED25519 signature generation
- βœ… **FIX** Unit tests added
- βœ… **FIX** Separated client session & router
- βœ… **WS_API** Base implementation
- βœ… **UTILS** Refactored utils, added HMAC
- βœ… **REST_CLIENT** Full implementation
- βœ… **WS_STREAMS** User streams tested & refactored
- βœ… **WS_API** Exchange info, Place/Test/Cancel Orders
- βœ… **BUILD** vcpkg dependencies, cross-platform builds
- βœ… **FIX** Migrated from **fix8** β†’ **QuickFIX**
- βœ… **FIX** Implemented `placeOrder` & `subscribeToFeed`
- βœ… **FIX** Integrated codegen classes & custom message cracker
- βœ… **FIX** Dual session config for feeder/broker
- βœ… **FIX** `onMessage` handler for user
- βœ… **CRYPTO** ED25519 key loading
- βœ… **FIX** Feeder & broker wrapper
- βœ… **FIX** Get Market Info implementation

---

## πŸ“‹ TODO

- βœ… **WS** Example builds via vcpkg
- βœ… **LIBRARY** Export as library for RTEX integration
- βœ… **LIBRARY** Version 0.0 Beta
- βœ… **WS_API** Rework WS to use beast instead of wspp
- βœ… **WS_API** Logon without signature after authentication
- βœ… **FIX** Add response type with code, type, and data
- βœ… **REST** Remove singleton request builder and aggregate to client
- βœ… **WS** Remove singleton request builder and aggregate to client
- βœ… **UTESTS** More coverage for signatures, payloads, key loading
- βœ… **WS_ALL** Parameter enforcement for request types
- βœ… **FIX** Implement FIX messages fully
- βœ… **WS** Feeder-Broker implementation
- βœ… **CRYPTO** RSA key loading and sign

## ⚑ Inspiration

The name Binfrost is a nod to the Bifrost bridge from Norse mythology β€” a rainbow bridge connecting worlds.
Here, it’s the bridge between your C++ code and the Binance trading universe.

## πŸ“œ License

MIT License β€” free to use, modify, and share.