npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@doriginals/orderbook

v0.1.7

Published

An Order Book app built with React/Typescript and powered by WebSockets.

Downloads

97

Readme

Order Book

An Order Book app built with React/Typescript and powered by WebSockets.

I have written a tutorial about how I did this. You can find it here or here.

Tests Build Status

Tech stack

  • React / Typescript
  • SASS / styled-components
  • WebSockets / react-use-websocket
  • react-testing-library

Screenshots

Default View

iPhone 6/7/8

Responsive

XBTUSD Grouping: 1

ETHUSD Market

Application features:

I. Order Book

  1. The Order Book consists of two sides: the buy side and the sell side.
  2. Both sides contain information about the amount of orders opened at each price level.
  3. Each level displays the:
    1. Price - this is what defines the level. As orders must be placed at a price that is a multiple of the selected markets tick size (0.5) each level will be an increment of 0.5 (as long as there is an order open at that level).
    2. Size - the total quantity of contracts derived from open orders that have been placed at this level.
    3. Total - the summed amount of contracts derived from open orders that reside in the book at this level and above. To calculate the total of a given level we take the size of the current level and sum the sizes leading to this price level in the order book. The total is also used to calculate the depth visualizer (colored bars behind the levels), the depth of each level is calculated by taking that level's total as a percentage of the highest total in the book.

II. Grouping Select Box

  1. By default the orders are grouped by the select markets ticket size (0.5).
  2. Possible toggling of the grouping: between 0.5, 1, 2.5 for XBTUSD market and 0.05, 0.1 and 0.25 for ETHUSD market.
  3. To group levels we combine the levels rounded down to the nearest group size e.g. if we change our grouping from 0.5 to 1 then we would combine the data from prices 1000 and 1000.5 and display it under a single level in the orderbook with the price 1000.

III. Toggle Feed Button

  1. Toggles the selected market between PI_XBTUSD and PI_ETHUSD.
  2. Supports dynamic grouping logic - handles groupings for XBT (0.5, 1, 2.5) and groupings for ETH (0.05, 0.1, 0.25).

IV. Kill Feed Button

  1. Clicking this button stops the feed.
  2. Clicking this button second time renews the feed.

Demo

:star: orderbook-mihailgaberov.vercel.app :star:

Running the app locally

To run the app, follow these steps.

  1. Ensure that NodeJS is installed.
  2. Install yarn.
  3. From the project folder, execute the following commands:

To install dependencies:

  yarn

To run the app:

  yarn start

To run the tests:

  yarn test

Star History

Star History Chart