Skip to content

jholdstock/dcrwages

Repository files navigation

dcrwages

Build Status ISC License

dcrwages is a web application which provides average monthly DCR/USDT price. It starts a web server with a HTML page displaying the price information, as well as providing the information over an API.

http://dcrwages.jholdstock.uk

This rate is used when Decred project contractors submit invoices denominated in US Dollars and receive payment in DCR.

How dcrwages works

Before April 2019

Price data retrieved from Poloniex was used to calculate the monthly price of Decred in USDT. The weighted average price over 15 minute intervals on the BTC/USDT and BTC/DCR markets were used to find monthly average DCR/USDT prices.

This historic data is now hard-coded in dcrwages - the Poloniex API is no longer used by this project.

April 2019 - November 2024

The price calculation was updated to use Binance instead of Poloniex, and the interval was changed from 15 minutes to 1 hour.

Since December 2024

The Binance DCR/USDT market is now used to find the monthly average price instead of the DCR/BTC and BTC/USDT markets.

How to use dcrwages

Build and run locally:

# Build the executable
go install .

# Run the executable
$(go env GOPATH)/bin/dcrwages

Or build and run in docker:

# Build the container
docker build -t jholdstock/dcrwages .

# Run the container
docker run -d -p 3000:3000 jholdstock/dcrwages:latest

The process will begin contacting Binance and downloading price information.

The web server will start listening on port 3000. You can open the homepage in your browser http://localhost:3000/.

REST API

HTTP Request Response
/api/prices All available prices
/api/prices/{year} Prices for a single year
/api/prices/{year}/{month} Price for a single month

Months are handled as integers. 1 = Jan, 2 = Feb, etc.

Errors are indicated using HTTP status codes and an error description in the response body. For example, a request for data which is unavailble will give a 404 HTTP status and the following body:

{ "error": "No data for year 1966" }

About

Decred contractor price dashboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published