Skip to content

rem-code-s/binance-websocket-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binance Websocket Examples

Local orderbook(Spot)

# cache loal orderbook and echo best price
# btcusdt by default
npm run orderbook

# or provide the trading pair
SYMBOL=bnbusdt npm run orderbook

SPOT user data stream

# get user data steam
APIKEY=xxxxxx APISECET=xxxxx npm run user

# get margin account update from websocket
APIKEY=xxxxxx APISECET=xxxxx npm run margin-user

Futures user data stream

# get user data steam on production
APIKEY=xxxxxx APISECET=xxxxx npm run futures-user

# on testnet
APIKEY=xxxxxx APISECET=xxxxx WSS_BASE_URL="wss://stream.binancefuture.com/" HTTP_BASE_URL="https://testnet.binancefuture.com/" npm run futures-user

Delivery Futures user data stream

# get user data steam, by default, it's working on production
APIKEY=xxxxxx APISECET=xxxxx npm run delivery-futures-user

Combined streams

# get multi pairs stream, setting the pairs in src/multi-stream-depth
npm run multi-stream

Spot trade stream delay monitoring

npm run monitor-spot-trade

Spot depth stream delay monitoring

npm run monitor-spot-depth

Futures depth stream delay monitoring

npm run monitor-futures

How to setup

npm install

# run test
npm run test

License

MIT

About

Example code in Nodejs that demonstrate how to subscribe to Binance Websocket server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 99.5%
  • Dockerfile 0.5%