Skip to content

dotnet hosted services to handle data from the coinbasepro-sharp api

License

Notifications You must be signed in to change notification settings

chrisw000/coinbasepro-application

Repository files navigation

coinbasepro-application

dotnet hosted services to handle data from the coinbasepro-sharp api

Build status

Getting Started

Generate your key at https://pro.coinbase.com/profile/api

  • Navigate to the CoinbasePro.ConsoleExample folder
  • Create a new file; appsettings.Development.json (appsettings.Development.json is excluded from git)
  • Populate your apiKey, apiSecret, passPhrase keep these secret!
  • Provide a folder location for the csv output
{
  "csvPath": "c:/csv-data/",
  "apiKey":  "",
  "apiSecret":  "",
  "passPhrase":  ""
}
  • Populate a /Properties/launchSettings.json file
{
  "profiles": {
    "CoinbasePro.ConsoleExample": {
      "commandName": "Project",
      "environmentVariables": {
        "ENVIRONMENT": "Development",
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
  • Run it
dotnet run coinbasepro.consoleexample

Output

CoinbasePro.ConsoleExample will batch up a series of API calls and download 1 years worth of candle data for the following:
  • Btc-Usd, Hour 1 candles
  • Eth-Usd, Hour 1 candles
  • Eth-Eur, Minutes 15 candles

Saving the data into into csv files together with csv meta data to allow it to pickup only new data on subsequent runs.

The data is pulled in batches, so there can be a pause of upto 1 minute between batch runs.

The currency and candle periods are defined in the example ConsoleHost.cs file

// Setup the markets to pull data for
services.AddTransient<ICandleMonitorFeedProvider>(sp => new CsvCandleMonitorFeed(new List<CandleMonitorFeeds>()
    {
        new CandleMonitorFeeds(ProductType.BtcUsd, CandleGranularity.Hour1),
        new CandleMonitorFeeds(ProductType.EthUsd, CandleGranularity.Hour1),
        new CandleMonitorFeeds(ProductType.EthEur, CandleGranularity.Minutes15)
    })

RabbitMq

More docs to follow, check out the example RabbitMq producer and consumer examples.

Requires running a RabbitMq server, configuring user/password and endpoints for both the producer and consumer. Then TimeSeries / candle data can be transmitted across RabbitMq

TODO: More docs, and how to register the ICandleProducer, ICandleConsumer implementations into the ConsoleExample app.

About

dotnet hosted services to handle data from the coinbasepro-sharp api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages