Skip to content

dm13450/CoinbasePro.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoinbasePro

A basic API for getting Coinbase data into Julia.

This package provides a Julia interface for the market data functions listed here: https://docs.pro.coinbase.com/

Under Development

  • Non market data based functions.

Getting Started

Install the package in Julia using the Pkg REPL:

julia> ]
pkg> add CoinbasePro

or

using Pkg
Pkg.add("CoinbasePro")

Functions

Market Data Functions

Information on all currency pairs for trading or a specific currency pair.

products()
products("BTC-USD")
produces("ETH", "USD")

Get the orderbook for a product.

  • Level 1: Best Bid and Ask
  • Level 2: Full order book aggregated
  • Level 3: Full order book not aggregated.

Change the level with the 2nd argument to the function.

#level 1
book("BTC-USD", 1)
#level 3
book("BTC-USD", 3)
  • ticker Get the last trade, best bid/offer and 24 hour volume for a product.
ticker("BTC-USD")
  • trades Get a list of trades of a product. Paginated so will return both the data and a pagination cursor. using lasttrades to get the last n trades of a product.
trades("BTC-USD")
lasttrades("BTC-USD", 100)
  • candles Historical rates for a product in terms of open, high, low, and close (OHLC).
    1 minute, 5 minute, 15 minute, 1 hour, 6 hour and 1 day granularity available.
# 1 minute bars
using DateTime
candles("BTC-USD", now() - Hour(1), now(), 60)
  • stats OHLC and volume data from the last 24 hours and 30 day average volume.
stats("BTC-USD")

A tutorial on the various functions can be found here.