https://github.com/codingnagger/gdax-api-playthrough
Playing a bit with the gdax API
https://github.com/codingnagger/gdax-api-playthrough
Last synced: about 1 year ago
JSON representation
Playing a bit with the gdax API
- Host: GitHub
- URL: https://github.com/codingnagger/gdax-api-playthrough
- Owner: CodingNagger
- Created: 2018-01-24T23:19:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-24T23:30:42.000Z (about 8 years ago)
- Last Synced: 2025-01-03T07:52:35.211Z (about 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GDAX API PLAYTHROUGH
## Description
This API contains one endpoint /quote allowing to get a quote for any currency pair supported by the GDAX API.
## Trade-offs
- Getting the currency pairs as an hardcoded string array in the `quote.js` file directly to prevent having them pulled from the API at every request. Seemed appropriate as the documentation states that if a pair/id exists it will not be removed. They could also be loaded from a configuration file but hardcoding allows to keep this
implementation simpler.
## Improvements to add
- More descriptive error messages in terms of what input to correct, etc.
- Return an error message in case there is no order small/big enough to satisfy the quote.
- Add unit tests for cases where the best priced orders have a quantity too big for the quote.
- Add unit tests for reversed quotes handling (i.e. BTC-ETH)
## UNIX setup
- You will need Node.js and NPM setup on your system.
- Once you have these setup you can load the project dependencies by running `npm install` in this directory.
- Once the dependencies installed, you can use`npm start` to run the API. This will start the Express server on the port 8888. However if a PORT environment variable is setup it is going to be used as port to serve the API.
- You can also run unit tests using `npm test`.