dcrwages
dcrwages is a web application which provides average monthly USDT/DCR price. It starts a web server with a HTML page displaying the price information, as well as providing the information over an API.
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 USDT/BTC and BTC/DCR markets were used to find monthly average USDT/DCR prices.
This historic data is now hard-coded in dcrwages - the Poloniex API is no longer used by this project.
Since April 2019
The price calculation was updated to use Binance instead of Poloniex, and the interval was changed from 15 minutes to 1 hour.
How to use dcrwages
Build and run locally:
# Build the executable
env GO111MODULE=on 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" }