Code Monkey home page Code Monkey logo

binance-orderbook's Introduction

OrderBook.js is a React component that displays a real-time order book for the BTCUSDT trading pair on Binance. It uses the Binance WebSocket API to receive real-time order book updates and displays this data on a bar chart using Chart.js.

Features

  1. Real-time Data: The component establishes a WebSocket connection to Binance and subscribes to real-time depth updates for the BTCUSDT trading pair.
  2. Order Book Management: The component maintains an up-to-date order book by processing each WebSocket message. It updates the volumes of existing price levels, adds new price levels, and removes price levels with a volume of zero.
  3. Chart Display: The component displays the order book data on a bar chart, with separate bars for bids (buy orders) and asks (sell orders). The chart updates in real-time as new WebSocket messages are received.
  4. Error Handling: The component handles WebSocket errors and automatically attempts to reconnect if the WebSocket connection is closed.

Usage

To use this component, clone this repo by running git clone [email protected]:kev065/binance-orderbook.git on your terminal.

Then install Chart.js by running npm install chart.js in the cloned directory.

binance-orderbook's People

Contributors

kev065 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.