Skip to content

leeminhan/coinbase-orderbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coinbase WebSocket Feed

This application subscribes to Coinbase L2 WebSocket channel and maintains an OrderBook of 10 levels.

Getting Started

  1. Compile Project
mvn clean compile package
  1. Start Application
java -jar target/coinbase-orderbook-1.0-SNAPSHOT.jar BTC-USD
  1. Terminate Application
CTRL+C

Demo

WebSocket Information

L2 Subscription Message

{
    "type": "subscribe",
    "product_ids": ["BTC-USD"],
    "channels": ["level2"]
}

L2 Subscription Response

{"type":"subscriptions","channels":[{"name":"level2","product_ids":["BTC-USD"]}]}

L2 Snapshot Message

{
    "type": "snapshot",
    "product_id": "BTC-USD",
    "bids": [["10101.10", "0.45054140"]],
    "asks": [["10102.55", "0.57753524"]]
}

L2 Update Message

{"type":"l2update","product_id":"BTC-USD","changes":[["buy","41501.16","0.03924800"]],"time":"2022-02-06T06:43:18.845125Z"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages