Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 2.25 KB

README.md

File metadata and controls

53 lines (44 loc) · 2.25 KB

Screen Shot 2021-06-27 at 11 30 51 PM

Coinbase Pro L2 Order Book

This project implements an L2 order book for the Coinbase Pro exchange, connecting to both the websocket and REST endpoints necessary to fetch and handle L3 order data, which is maintained as an L2 order book in the backend and displayed in the web GUI via a second websocket connection.

Requirements

Tested on [email protected] with [email protected], but other versions may still work.

Running the Backend

First, install the necessary packages for the backend.

~/coinbase-pro-orderbook/backend-api $ npm i

(Optional) Next, run the tests to confirm proper functionality. The end result should look like this:

~/coinbase-pro-orderbook/backend-api $ npm run test
...

Test Suites: 1 passed, 1 total
Tests:       28 passed, 28 total
Snapshots:   0 total
Time:        0.531 s, estimated 1 s
Ran all test suites.

(Optional) If you would like to see detailed output of the server, you can set const enableInfoLogging = true in ~/coinbase-pro-orderbook/backend-api/config.ts. Note: error logging is enabled by default in the same file.

Finally, start the server. The REST API is accessible at http://localhost:8000 and websocket at ws://localhost:8000, although there are currently no accepted REST endpoints.

~/coinbase-pro-orderbook/backend-api $ npm run serve

Running the Frontend

Install the necessary packages for the frontend.

~/coinbase-pro-orderbook/web-app $ npm i

(Optional) Build the image if you wish to run the production version.

~/coinbase-pro-orderbook/web-app $ npm run build

Finally, start the application, which is available in the browser at http://localhost:3000.

~/coinbase-pro-orderbook/web-app $ npm run start

Credits

Written by Austin Born ([email protected])

Resources

Create React App
Build an API with Node.js, Express, and TypeScript
Coinbase Pro API - Full Channel