Skip to content

Commit

Permalink
Updated pkgdown
Browse files Browse the repository at this point in the history
Included descriptions and updated README
  • Loading branch information
serkor1 committed Oct 5, 2023
1 parent 25fe33e commit e898eba
Show file tree
Hide file tree
Showing 13 changed files with 231 additions and 55 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ playground
^_pkgdown\.yml$
^docs$
^pkgdown$
^codecov\.yml$
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: cryptoQuotes
Title: Access Market Data From Major Cryptocurrency Exchanges
Title: Access Market Data from Major Cryptocurrency Exchanges
Version: 1.0.0
Authors@R: c(
person("Serkan", "Korkmaz", role = c("cre", "aut", "ctb", "cph"), email = '[email protected]')
person("Serkan", "Korkmaz", role = c("cre", "aut", "ctb", "cph"), email = '[email protected]', comment = c(ORCID = "0000-0002-5052-0982"))
)
Description: Access spot and futures markets from major cryptocurrency exchanges.
License: GPL (>= 2)
Expand Down
52 changes: 28 additions & 24 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,26 @@ knitr::opts_chunk$set(
)
```

# cryptoQuotes
## cryptoQuotes

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/serkor1/cryptoQuotes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/serkor1/cryptoQuotes/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/serkor1/cryptoQuotes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/serkor1/cryptoQuotes?branch=main)
<!-- badges: end -->

The goal of cryptoQuotes is to create a unified API access to all known major cryptocurrency exchanges, and preserving the compatibility with libraries such as `quantmod` and `TTR`.
The cryptoQuotes package is an unified REST API access to public market data from all major cryptocurrency exchanges. The package is compatible with `quantmod` and `TTR` out of the box.

### Supported Exchanges and Markets
#### Supported Exchanges and Markets

`cryptoQuotes` currently supports `binance`, `kucoin` and `kraken`. For each exchange `spot` and `futures` markets are supported.
Currently, cryptoQuotes supports perpetual futures and spot markets on the following exchanges; `binance`, `kucoin` and `kraken`. More exchanges will be added in the future.

> **Note:** cryptoQuotes supports various intervals limited
> to what the different exchange APIs allows. The lowest interval is 1s (Seconds), and the highest is 1M (Months)
## Installation
#### Basic usage

``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'main'
)
```

You can install the development version of cryptoQuotes like so:

``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'development'
)
```

## Example

To get the latest prices on a desired cryptocurrency pair,
Get USDT denominated ATOM in the spot market from Binance in `30m` intervals,

```{r example}
## get perpetual contracts on USDT denominated ATOM
Expand All @@ -69,10 +54,29 @@ quantmod::chartSeries(
theme = quantmod::chartTheme('black')
)
```

When the `spotPrice` has been charted, the indicators in `quantmod` is directly applicable. See for example `addBBands`

```{r addBBands, echo=TRUE, warning=FALSE, message = FALSE}
## add bollinger bands
## using quantmod
quantmod::addBBands()
```

#### Installation

**Stable Version**
``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'main'
)
```

**Development Version**
``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'development'
)
```
69 changes: 40 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# cryptoQuotes
## cryptoQuotes

<!-- badges: start -->

[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/serkor1/cryptoQuotes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/serkor1/cryptoQuotes/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/serkor1/cryptoQuotes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/serkor1/cryptoQuotes?branch=main)
<!-- badges: end -->

The goal of cryptoQuotes is to create a unified API access to all known
major cryptocurrency exchanges, and preserving the compatibility with
libraries such as `quantmod` and `TTR`.
The cryptoQuotes package is an unified REST API access to public market
data from all major cryptocurrency exchanges. The package is compatible
with `quantmod` and `TTR` out of the box.

### Supported Exchanges and Markets
#### Supported Exchanges and Markets

`cryptoQuotes` currently supports `binance`, `kucoin` and `kraken`. For
each exchange `spot` and `futures` markets are supported.
Currently, cryptoQuotes supports perpetual futures and spot markets on
the following exchanges; `binance`, `kucoin` and `kraken`. More
exchanges will be added in the future.

## Installation
> **Note:** cryptoQuotes supports various intervals limited to what the
> different exchange APIs allows. The lowest interval is 1s (Seconds),
> and the highest is 1M (Months)
``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'main'
)
```
#### Basic usage

You can install the development version of cryptoQuotes like so:

``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'development'
)
```

## Example

To get the latest prices on a desired cryptocurrency pair,
Get USDT denominated ATOM in the spot market from Binance in `30m`
intervals,

``` r
## get perpetual contracts on USDT denominated ATOM
Expand All @@ -63,9 +53,10 @@ quantmod::chartSeries(
)
```

<img src="man/figures/README-chartSeries-1.png" width="100%" /> When the
`spotPrice` has been charted, the indicators in `quantmod` is directly
applicable. See for example `addBBands`
<img src="man/figures/README-chartSeries-1.png" width="100%" />

When the `spotPrice` has been charted, the indicators in `quantmod` is
directly applicable. See for example `addBBands`

``` r
## add bollinger bands
Expand All @@ -74,3 +65,23 @@ quantmod::addBBands()
```

<img src="man/figures/README-addBBands-1.png" width="100%" />

#### Installation

**Stable Version**

``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'main'
)
```

**Development Version**

``` r
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'development'
)
```
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
Binary file modified man/figures/README-addBBands-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-chartSeries-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
39 changes: 39 additions & 0 deletions vignettes/articles/01_intervals.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Intervals"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(cryptoQuotes)
```

#### Available intervals

The available intervals depends on the exchange that you use, as your `source` of market data. It is, for example, only possible to get monthly data from `binance`. To get an overview of the available intervals, the `cryptoQuotes::availableIntervals`-function can be used. It takes two arguments, `source` and `futures`.

> **Note:** The same intervals are not necessarily
> equal across markets on the same exchange
```{r}
cryptoQuotes::availableIntervals(
source = 'kucoin',
futures = TRUE
)
```

```{r}
cryptoQuotes::availableIntervals(
source = 'kucoin',
futures = FALSE
)
```

The available intervals are directly passed as `character` using the`interval` argument, in the `cryptoQuotes::getQuote`-function.


32 changes: 32 additions & 0 deletions vignettes/articles/02-tickers.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "Available Tickers"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(cryptoQuotes)
```

#### Available tickers

All tradable tickers on each exchange is supported. The naming convention differs across exchanges, so passing `ATOMUSDT` on the `cryptoQuotes::getQuote` as an argument will not necessarily provide you with the ticker you are looking for.

To get all tradable assets on the desired market, and exchange, you can use the `cryptoQuotes::availableTickers()` function.

> **Note: the function here is not evaluated as it
> fails the R-CMD-CHECK on github, and CRAN. The function returns a character
> vector with all available tickers
```{r, eval=FALSE}
cryptoQuotes::availableTickers(
source = 'kraken',
futures = TRUE
)
```

23 changes: 23 additions & 0 deletions vignettes/articles/03-exchanges.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Supported Exchanges"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(cryptoQuotes)
```

#### Supported exchanges

The currently supported exchanges can be viewed using the `cryptoQuotes::availableExchanges`-function. It has no `arguments` and are updated as more exchanges are added to the package.

```{r}
cryptoQuotes::availableExchanges()
```

File renamed without changes.

0 comments on commit e898eba

Please sign in to comment.