Skip to content

juancarlospaco/binance

Repository files navigation

Binance

Requisites

  • 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

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

💰➡️🍕

Bitcoin BTC

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

BTC Bitcoin Network

1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi

Lightning Network

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

Stars

@juancarlospaco@kennym@nickolaz@Nacho512@hannylicious@Walter-Santillan@kamilchm@Parzivalcen@hugosenari@RodrigoTorresWeb@villawolfpy@frankmoshe@lf-araujo@badsector666@Hamzadutsher@Kensingtonn@ccamateur@hienpro00123@moigagoo@vegardsjo@serjepatoff@teroz@AndrewGPU@touhid12310@JPANA108@tejusb9@Osamaalsabahy@Osamaalsabahy@Osamaalsabahy@Osamaalsabahy@deliriant@Nomemartin@FENIXG99@tuanductran