GithubHelp home page GithubHelp logo

crypto-service's Introduction

Go Lang developer test

Create a microservice that collect data from a cryptocompare using its API for example (https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC&tsyms=USD,EUR)

For instance:

"fsyms" => ["BTC", "XRP", "ETH", "BCH", "EOS", "LTC", "XMR", "DASH"],

"tsyms" => ["USD", "EUR", "GBP", "JPY", "RUR"],

Struct of response currency

{

CHANGE24HOUR string

CHANGEPCT24HOUR string

OPEN24HOUR string

VOLUME24HOUR string

VOLUME24HOURTO string

LOW24HOUR string

HIGH24HOUR string

PRICE string

SUPPLY string

MKTCAP string

}

Currency pairs should be configurable.

Mysql parameters should be configurable.

Service must store data to mysql by sheduler (rawjson is ok).

Service must work in background.

If cryptocompare is non accessible service must return data from database via own API.

Data in response must be fresh (realtime). 2-3 minutes discrepancy is ok.

Using websockets is a plus. Clean architecture is a plus. Service scalability is a plus.

APPENDIX:

Example of HTTP request:

GET service/price?fsyms=BTC&tsyms=USD

Example of response:

{

"RAW": {

"BTC": {

"USD": {

"CHANGE24HOUR": -13.25,

"CHANGEPCT24HOUR": -0.18152873223073468,

"OPEN24HOUR": 7299.12,

"VOLUME24HOUR": 47600.120073200706,

"VOLUME24HOURTO": 348033250.4911315,

"LOW24HOUR": 7197.22,

"HIGH24HOUR": 7426.64,

"PRICE": 7285.87,

"LASTUPDATE": 1586433196,

"SUPPLY": 18313937,

"MKTCAP": 133432964170.19

}

}

},

"DISPLAY": {

"BTC": {

"USD": {

"CHANGE24HOUR": "$ -13.25",

"CHANGEPCT24HOUR": "-0.18",

"OPEN24HOUR": "$ 7,299.12",

"VOLUME24HOUR": "Ƀ 47,600.1",

"VOLUME24HOURTO": "$ 348,033,250.5",

"HIGH24HOUR": "$ 7,426.64",

"PRICE": "$ 7,285.87",

"FROMSYMBOL": "Ƀ",

"TOSYMBOL": "$",

"LASTUPDATE": "Just now",

"SUPPLY": "Ƀ 18,313,937.0",

"MKTCAP": "$ 133.43 B"

}

}

}

}

Example of WS request:

WS service/price

{ "fsyms": "DASH", "tsyms": "RUR" }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.