Socket
Book a DemoInstallSign in
Socket

binance-local-exchange

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binance-local-exchange

Binance local exchange

1.0.9
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Binance logo

Binance Local Exchange

License: GPL v3 Gitter

🏦 What is "BLE" or "Binance Local Exchange"

You can interact with BLE as if you would be trading with the real Binance API without taking the risk of making an actual trade. All orders calls will be saved in memory (as long as the server is running) and will be internally matched once the price on Binance hits the expected target. In case of a MARKET order the order will be settled at the current market price on Binance.

Once the order is settled an ExecutionReport is emitted according to the interface of the Binance API. Note that BLE is not 100% local, some endpoints are (always) proxied to Binance. For example kline events will always be proxied to Binance so that BLE can correctly match the orders internally.

Quick start

  • npx binance-local-exchange
  • Make api calls or point your trading bot to: http://localhost:8000

Help, it's not working?

  • I can't create an order: make sure to call GET /api/v3/exchangeInfo. (why?)
  • I am not receiving any executionReports:
    • make sure to call POST /api/v3/userDataStream. (why?)
    • make sure to listen for Kline/Candlestick Streams. (why?)

Still not working? Please open a bug report

βš™οΈ Configuration

The following configuration options can be configured either by argument or by environment variable.

OptionEnv varDescription
-V, --versionoutput the version number
-p, --port PORTport number (default: 8000)
-lt, --local-timeLOCAL_TIMElocal time (default: true)
-lei, --local-exchange-infoLOCAL_EXCHANGE_INFOlocal exchange info (default: true)
-fm, --fee-maker FEES_MAKERmaker fee (default: 0.001)
-ft, --fee-taker FEES_TAKERtaker fee (default: 0.001)
--I-KNOW-WHAT-I-AM-DOINGI_KNOW_WHAT_I_AM_DOINGremoves all security warnings
-h, --helpdisplay help for command

For example: export PORT=8001 && npx binance-local-exchange or npx binance-local-exchange -p 8001

πŸͺ API endpoints

MethodPathImplemented
GET/api/v3/exchangeInfoβœ…
POST/api/v3/orderβœ…
GET/api/v3/timeβœ…
POST/api/v3/userDataStreamβœ…

Websocket streams

StreamImplemented
klineβœ…
userDataStreamβœ…

Internal server endpoints

Can be used to debug or get more information about the internal state of the server

MethodPathImplementedBody / QueryInfo
GET/server/debugβœ…Returns the state of the internal stores
GET/server/configβœ…Returns the configuration that is used by the server
POST/server/matchβœ…{ symbol: string, price: number }Tries to match open orders.

πŸ—ΊοΈ Roadmap

  • Add support for additional API endpoints
  • Spot account trades
  • Margin account trades
  • ...

πŸ’ How to contribute?

  • Clone repo git clone https://github.com/SockTrader/Binance-local-exchange
  • Install dependencies cd Binance-local-exchange && npm install
  • Start server npm run start or in watch mode npm run watch
  • Make code changes, test with Postman, create unit tests
  • Open pull request

✨ Contributors

⚠️ DISCLAIMER

Use at your own risk. Neither SockTrader nor any project contributor can be held responsible for any potential losses.

Keywords

binance

FAQs

Package last updated on 21 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.