{"id":25718982,"url":"https://github.com/socktrader/binance-local-exchange","last_synced_at":"2025-10-24T09:04:05.700Z","repository":{"id":42538092,"uuid":"413942511","full_name":"SockTrader/Binance-local-exchange","owner":"SockTrader","description":"🏦 Binance local exchange 🪙 💶","archived":false,"fork":false,"pushed_at":"2023-03-06T22:47:14.000Z","size":1210,"stargazers_count":11,"open_issues_count":6,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-30T18:02:44.016Z","etag":null,"topics":["algorithmic-trading","binance","candlesticks","crypto","cryptocurrency","exchange","javascript","local-exchange","mock-server","paper-trading","trading","trading-bot","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SockTrader.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"SockTrader"}},"created_at":"2021-10-05T18:52:50.000Z","updated_at":"2024-08-28T17:14:30.000Z","dependencies_parsed_at":"2024-10-29T23:50:35.228Z","dependency_job_id":null,"html_url":"https://github.com/SockTrader/Binance-local-exchange","commit_stats":{"total_commits":78,"total_committers":3,"mean_commits":26.0,"dds":"0.16666666666666663","last_synced_commit":"0839f85859951aa65fec65b244671c3e91c62afb"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SockTrader%2FBinance-local-exchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SockTrader%2FBinance-local-exchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SockTrader%2FBinance-local-exchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SockTrader%2FBinance-local-exchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SockTrader","download_url":"https://codeload.github.com/SockTrader/Binance-local-exchange/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252597860,"owners_count":21774155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithmic-trading","binance","candlesticks","crypto","cryptocurrency","exchange","javascript","local-exchange","mock-server","paper-trading","trading","trading-bot","typescript"],"created_at":"2025-02-25T16:27:34.334Z","updated_at":"2025-10-24T09:04:05.609Z","avatar_url":"https://github.com/SockTrader.png","language":"TypeScript","funding_links":["https://patreon.com/SockTrader"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"150\" height=\"150\" src=\"https://raw.githubusercontent.com/SockTrader/Binance-local-exchange/master/docs/assets/binance.png\" alt=\"Binance logo\" /\u003e\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eBinance Local Exchange\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.gnu.org/licenses/gpl-3.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-GPL%20v3-blue.svg\" alt=\"License: GPL v3\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/SockTrader/Binance-local-exchange/actions/workflows/main.yml\"\u003e\u003cimg src=\"https://github.com/SockTrader/Binance-local-exchange/actions/workflows/main.yml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/SockTrader/Binance-local-exchange\"\u003e\u003cimg src=\"https://codecov.io/gh/SockTrader/Binance-local-exchange/branch/main/graph/badge.svg?token=5DG2K3RGEJ\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://codeclimate.com/github/SockTrader/Binance-local-exchange/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/ef5537a6aa6b8cb10cba/maintainability\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://gitter.im/SockTrader/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\"\u003e\u003cimg src=\"https://badges.gitter.im/SockTrader/community.svg\" alt=\"Gitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## 🏦 What is \"BLE\" or \"Binance Local Exchange\"\n\nYou can interact with BLE as if you would be trading with the real Binance API without taking the risk of making an actual trade.\nAll 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.\nIn case of a MARKET order the order will be settled at the current market price on Binance.\n\nOnce the order is settled an ExecutionReport is emitted according to the interface of the Binance API.\nNote that BLE is not 100% local, some endpoints are (always) proxied to Binance.\nFor example `kline` events will always be proxied to Binance so that BLE can correctly match the orders internally.\n\n\n### Quick start\n\n- `npx binance-local-exchange`\n- Make api calls or point your trading bot to: `http://localhost:8000`\n\n\n### Help, it's not working?\n\n- I can't create an order: make sure to call GET /api/v3/exchangeInfo. ([why?](https://github.com/SockTrader/Binance-local-exchange/wiki/FAQ#i-cant-create-an-order))\n- I am not receiving any executionReports:\n  - make sure to call POST /api/v3/userDataStream. ([why?](https://github.com/SockTrader/Binance-local-exchange/wiki/FAQ#i-am-not-receiving-any-executionreports))\n  - make sure to listen for Kline/Candlestick Streams. ([why?](https://github.com/SockTrader/Binance-local-exchange/wiki/FAQ#i-am-not-receiving-any-executionreports))\n\nStill not working? Please open a [bug report](https://github.com/SockTrader/Binance-local-exchange/issues/new)\n\n## ⚙️ Configuration\n\nThe following configuration options can be configured either by argument or by environment variable.\n\n| Option                      | Env var                | Description                         |\n|-----------------------------|------------------------|-------------------------------------|\n| -V, --version               |                        | output the version number           |\n| -p, --port \u003cnumber\u003e         | PORT                   | port number (default: 8000)         |\n| -lt, --local-time           | LOCAL_TIME             | local time (default: true)          |\n| -lei, --local-exchange-info | LOCAL_EXCHANGE_INFO    | local exchange info (default: true) |\n| -fm, --fee-maker \u003cnumber\u003e   | FEES_MAKER             | maker fee (default: 0.001)          |\n| -ft, --fee-taker \u003cnumber\u003e   | FEES_TAKER             | taker fee (default: 0.001)          |\n| --I-KNOW-WHAT-I-AM-DOING    | I_KNOW_WHAT_I_AM_DOING | removes all security warnings       |\n| -h, --help                  |                        | display help for command            |\n\nFor example: `export PORT=8001 \u0026\u0026 npx binance-local-exchange` or `npx binance-local-exchange -p 8001`\n\n## 🪝 API endpoints\n\n| Method | Path                   | Implemented |\n|--------|------------------------|-------------|\n| GET    | /api/v3/exchangeInfo   | ✅           |\n| POST   | /api/v3/order          | ✅           |\n| GET    | /api/v3/time           | ✅           |\n| POST   | /api/v3/userDataStream | ✅           |\n\n\n### Websocket streams\n\n| Stream         | Implemented |\n|----------------|-------------|\n| kline          | ✅           |\n| userDataStream | ✅           |\n\n\n### Internal server endpoints\n\nCan be used to debug or get more information about the internal state of the server\n\n| Method | Path           | Implemented | Body / Query                      | Info                                                 |\n|--------|----------------|-------------|-----------------------------------|------------------------------------------------------|\n| GET    | /server/debug  | ✅           |                                   | Returns the state of the internal stores             |\n| GET    | /server/config | ✅           |                                   | Returns the configuration that is used by the server |\n| POST   | /server/match  | ✅           | { symbol: string, price: number } | Tries to match open orders.                          |\n\n\n## 🗺️ Roadmap\n- Add support for additional API endpoints\n- Spot account trades\n- Margin account trades\n- ...\n\n\n## 💁 How to contribute?\n\n- Clone repo `git clone https://github.com/SockTrader/Binance-local-exchange`\n- Install dependencies `cd Binance-local-exchange \u0026\u0026 npm install`\n- Start server `npm run start` or in watch mode `npm run watch`\n- Make code changes, test with Postman, create unit tests\n- Open pull request\n\n\n## ✨ Contributors\n\u003ca href=\"https://github.com/SockTrader/Binance-local-exchange/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=SockTrader/Binance-local-exchange\" /\u003e\n\u003c/a\u003e\n\n\n## ⚠️ DISCLAIMER\nUse at your own risk. Neither SockTrader nor any project contributor can be held responsible for any potential losses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocktrader%2Fbinance-local-exchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocktrader%2Fbinance-local-exchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocktrader%2Fbinance-local-exchange/lists"}