Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/juancarlospaco/binance

Binance API Client Futures Spot
https://github.com/juancarlospaco/binance

binance binance-bot crypto-bot crypto-currency crypto-whale-watcher cryptocurrency-exchanges cryptotrading day-trading easy-money easy-to-use economy finance get-rich-slowly market-data memecoin nim nim-lang shitcoin stablecoin trading

Last synced: 25 days ago
JSON representation

Binance API Client Futures Spot

Awesome Lists containing this project

README

        

# Binance

![](https://raw.githubusercontent.com/juancarlospaco/binance/nim/binance.jpg)

![](https://raw.githubusercontent.com/juancarlospaco/binance/nim/futures.png "Leveraged Perpetual Futures")

![](https://github.com/juancarlospaco/binance/actions/workflows/build.yml/badge.svg)
![](https://img.shields.io/github/languages/top/juancarlospaco/binance?style=for-the-badge)
![](https://img.shields.io/github/stars/juancarlospaco/binance?style=for-the-badge)
![](https://img.shields.io/github/languages/code-size/juancarlospaco/binance?style=for-the-badge)
![](https://img.shields.io/github/issues-raw/juancarlospaco/binance?style=for-the-badge)
![](https://img.shields.io/github/issues-pr-raw/juancarlospaco/binance?style=for-the-badge)
![](https://img.shields.io/github/last-commit/juancarlospaco/binance?style=for-the-badge)

# Requisites

- Valid API Key and API Secret, with all permissions, get it for free at https://www.binance.com/en/my/settings/api-management

![](https://raw.githubusercontent.com/juancarlospaco/binance/nim/api_key_web.png)

- Device Date and Time must be configured, up to the seconds precision, Binance is strict about timestamps,
use https://github.com/juancarlospaco/binance/blob/nim/examples/binanceVslocalTime.nim to debug time diff.
In Windows, if you get `400 Bad Request`, check the time, Windows like to change the time without warning after updates,
set the correct time, up to the seconds precision, and disable Windows auto-update of time from the Windows settings.

- Some USDT in Binance Spot wallet to trade with, >10 USDT minimal, >100 USDT recommended.
- Some BNB coins in Binance Spot wallet for commisions, >1 USD in BNB minimal, >10 USD in BNB recommended.
- Some USDT in Binance Futures USD-M wallet to trade with, >100 USDT minimal, >1000 USDT recommended.
- Some BNB coins in Binance Spot wallet for commisions, >1 USD in BNB minimal, >10 USD in BNB recommended.
- If you are reading this after year 2023, the web of Binance for the API Keys has changed, but it still works.

# Examples

```nim
import std/httpcore, binance
let client = newBinance("YOUR_BINANCE_API_KEY", "YOUR_BINANCE_API_SECRET")
let preparedEndpoint = client.orderTest(SIDE_BUY, ORDER_TYPE_LIMIT, ORDER_RESP_TYPE_FULL, $TIME_IN_FORCE_GTC, "1", "BTCUSDT", 0.1, 10_000.00)
echo client.request(preparedEndpoint, HttpPost)
```

# Documentation

- https://juancarlospaco.github.io/binance
- By default is using the real production Binance API.
- Spot API (including OCO Orders) and Futures API (including 125x Leveraged Perpetual Futures) are supported.
- Automatic Trailing Stop-Loss is supported.
- Automatic Cancelation of Futures is supported.

# TradingBot

- How to create a TradingBot ?.

TradingBot example: https://github.com/juancarlospaco/binance/blob/nim/examples/newcoin.nim

Gift-Card Bot example: https://github.com/juancarlospaco/binance/blob/nim/examples/giftcardbot.nim

Leveraged Perpetual Futures with Stop-Loss and Trailing Stop-Loss example:
https://github.com/juancarlospaco/binance/blob/nim/examples/futures_maker.nim

# More

- See also https://github.com/juancarlospaco/tradingview#tradingview
- See also https://github.com/juancarlospaco/cloudbet#cloudbet

# 💰➡️🍕

Bitcoin BTC

**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**BTC Bitcoin Network**
```
1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi
```
**Lightning Network**
```
[email protected]
```

Ethereum ETH Dai DAI Uniswap UNI Axie Infinity AXS Smooth Love Potion SLP Uniswap UNI USDC

**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**ERC20 Ethereum Network**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```

Tether USDT

**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**ERC20 Ethereum Network**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**TRC20 Tron Network**
```
TWGft53WgWvH2mnqR8ZUXq1GD8M4gZ4Yfu
```

Solana SOL

**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**SOL Solana Network**
```
FKaPSd8kTUpH7Q76d77toy1jjPGpZSxR4xbhQHyCMSGq
```

Cardano ADA

**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```
**ADA Cardano Network**
```
DdzFFzCqrht9Y1r4Yx7ouqG9yJNWeXFt69xavLdaeXdu4cQi2yXgNWagzh52o9k9YRh3ussHnBnDrg7v7W2hSXWXfBhbo2ooUKRFMieM
```

Sandbox SAND Decentraland MANA

**ERC20 Ethereum Network**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```

Algorand ALGO

**ALGO Algorand Network**
```
WM54DHVZQIQDVTHMPOH6FEZ4U2AU3OBPGAFTHSCYWMFE7ETKCUUOYAW24Q
```

Polkadot DOT

**DOT Network**
```
13GdxHQbQA1K6i7Ctf781nQkhQhoVhGgUnrjn9EvcJnYWCEd
```
**BEP20 Binance Smart Chain Network BSC**
```
0xb78c4cf63274bb22f83481986157d234105ac17e
```

Binance

[https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3](https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3 "Send via Binance Pay")

# Stars

![](https://starchart.cc/juancarlospaco/binance.svg)
:star: [@juancarlospaco](https://github.com/juancarlospaco '2022-02-15')
:star: [@kennym](https://github.com/kennym '2022-02-16')
:star: [@nickolaz](https://github.com/nickolaz '2022-02-18')
:star: [@Nacho512](https://github.com/Nacho512 '2022-02-20')
:star: [@hannylicious](https://github.com/hannylicious '2022-03-02')
:star: [@Walter-Santillan](https://github.com/Walter-Santillan '2022-03-21')
:star: [@kamilchm](https://github.com/kamilchm '2022-03-23')
:star: [@Parzivalcen](https://github.com/Parzivalcen '2022-04-06')
:star: [@hugosenari](https://github.com/hugosenari '2022-05-28')
:star: [@RodrigoTorresWeb](https://github.com/RodrigoTorresWeb '2022-06-25')
:star: [@villawolfpy](https://github.com/villawolfpy '2022-07-11')
:star: [@frankmoshe](https://github.com/frankmoshe '2022-07-13')
:star: [@lf-araujo](https://github.com/lf-araujo '2022-07-28')
:star: [@badsector666](https://github.com/badsector666 '2022-09-24')
:star: [@Hamzadutsher](https://github.com/Hamzadutsher '2022-10-03')
:star: [@Kensingtonn](https://github.com/Kensingtonn '2022-11-09')
:star: [@ccamateur](https://github.com/ccamateur '2022-12-28')
:star: [@hienpro00123](https://github.com/hienpro00123 '2023-01-09')
:star: [@moigagoo](https://github.com/moigagoo '2023-04-06')
:star: [@vegardsjo](https://github.com/vegardsjo '2023-04-12')
:star: [@serjepatoff](https://github.com/serjepatoff '2023-04-25')
:star: [@teroz](https://github.com/teroz '2023-05-03')
:star: [@AndrewGPU](https://github.com/AndrewGPU '2023-06-13')
:star: [@touhid12310](https://github.com/touhid12310 '2023-08-12')
:star: [@JPANA108](https://github.com/JPANA108 '2023-08-22')
:star: [@tejusb9](https://github.com/tejusb9 '2023-09-22')
:star: [@Osamaalsabahy](https://github.com/Osamaalsabahy '2023-10-03')
:star: [@Osamaalsabahy](https://github.com/Osamaalsabahy '2023-10-04')
:star: [@Osamaalsabahy](https://github.com/Osamaalsabahy '2023-10-07')
:star: [@Osamaalsabahy](https://github.com/Osamaalsabahy '2023-10-10')
:star: [@deliriant](https://github.com/deliriant '2024-02-27')
:star: [@Nomemartin](https://github.com/Nomemartin '2024-04-12')
:star: [@FENIXG99](https://github.com/FENIXG99 '2024-05-19')
:star: [@tuanductran](https://github.com/tuanductran '2024-05-29')