dotnet hosted services to handle data from the coinbasepro-sharp api
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
- 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)
})
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.