### Utopian for CoinGecko: Utopian.io is running this task request on behalf of [CoinGecko.com](https://coingecko.com) <center> https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmb1qRjsYXwawCHsjhwehMUDrQe9xZhc5iD8gegQMHuNuf/utopian%20coingecko%20collab.png </center> #### GitHub Repository https://github.com/coingecko/cryptoexchange #### Project Background Cryptoexchange is a rubygem that allows Ruby developers to interact with over 240+ cryptocurrency exchange market data APIs in a single library. This rubygem is used to power [CoinGecko](https://www.coingecko.com). It is open source under the terms of the MIT License. #### Task Specification For the existing HTTP API, this rubygem has established a pretty good abstraction which allows developers to easily contribute new exchanges. The **websocket API feature**, however, is a new addition to this rubygem. As such, we are still figuring out the best abstraction/structure. Below pull request is the initial proof-of-concept for Bitfinex connection. Please use it as general reference in creating the Binance websocket API: https://github.com/coingecko/cryptoexchange/pull/1008 #### Deliverables We are looking for candidate(s) to complete the following tasks: - [ ] Implement **public websocket API** connections for [Binance](https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md) (Ticker, OrderBook, Trade) - [ ] Suggest ways to improve upon the rubygem websocket connection design. (See *notes below) - [ ] Suggest ways to spec/test external websocket API connection. (See *notes below) #### *Notes - The Bitfinex websocket API requires us to make only ONE connection for ONE trading pair. For example, only one websocket connection of BTC/USDT is needed in order to obtain stream data corresponding to that pairing. As such, the existing structure in place for Bitfinex leverages on Threads in order to handle multiple streams. - There may be a case where some websocket API (such as Binance) require only ONE connection for MULTIPLE trading pairs. You may need to introduce additional abstractions to handle this situation. - The HTTP API implementation of this rubygem uses [VCR](https://github.com/vcr/vcr) in order to mock API responses to ensure we can run an end-to-end integration test. VCR does not appear to work with websocket. We are considering manually mocking the websocket response but this can turn out to be unscalable when response changes. - Feel free to suggest ways to streamline this abstraction. #### Additional Notes for Binance Implementation We have looked into the [Binance websocket API documentation](https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md). Here is a code you can use to get started making websocket connection for testing purposes in ruby console. ``` EM.run do ws = WebSocket::EventMachine::Client.connect(uri: 'wss://stream.binance.com:9443/ws/bnbbtc@ticker') ws.onopen do end ws.onmessage do |message, _| begin message = JSON.parse(message) puts message rescue Exception => e puts e end end ws.onclose do puts "Close!" end end ``` Binance websocket also allows multiple streams. This allows us to maintain less websocket connections (if possible just one) ``` EM.run do ws = WebSocket::EventMachine::Client.connect(uri: 'wss://stream.binance.com:9443/stream?streams=bnbbtc@miniTicker/ethbtc@miniTicker/ethbtc@miniTicker') ws.onopen do end ws.onmessage do |message, _| begin message = JSON.parse(message) puts message rescue Exception => e puts e end end ws.onclose do puts "Close!" end end ``` `!miniTicker@arr` seems to be an ideal candidate for Ticker data as stated in https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#all-market-mini-tickers-stream The following channels on Binance correspond to the data we want to capture: - !miniTicker@arr OR @ticker OR @miniTicker (Ticker) - @depth (OrderBook) - @trade (Trade) #### How to get started? 1. Navigate to the repository on Github https://github.com/coingecko/cryptoexchange 2. Be sure to check out the README on its [usages](https://github.com/coingecko/cryptoexchange) to familiarize yourself with the gem and [contributing guide](https://github.com/coingecko/cryptoexchange/wiki/Implementing-a-New-Exchange-(Websocket-API)). 3. https://github.com/coingecko/cryptoexchange/wiki/Implementing-a-New-Exchange-(Websocket-API) will likely be useful to you to get started. 4. When you begin work, we suggest creating a Pull Request with a WIP headline so we can commence discussion there. #### Deadline 2 weeks. Set to start upon candidate selection. #### Communication Please register your interest at https://discord.gg/pKGV9sp, CoinGecko's official Discord server in the "utopian-io" channel. You may contact us directly for further information via email at hello@coingecko.com or in our Discord developer discussion hub. #### Github https://github.com/coingecko #### Rewards Information Rewards generated by this task request will be sent as liquid STEEM to the task solver once the task is completed, as decided by the project owner. The task will be considered considered completed after it has been merged by CoinGecko developement team and when the solver published a Utopian post, explaining what they did in order to solve the task.
author | utopian.tasks |
---|---|
permlink | coingecko-task-request-public-websocket-api-connections-for-binance |
category | utopian-io |
json_metadata | {"tags":["utopian-io","task-development","coingecko","rubygem","websocket"],"users":["ticker","miniticker","depth","trade"],"image":["https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmb1qRjsYXwawCHsjhwehMUDrQe9xZhc5iD8gegQMHuNuf/utopian%20coingecko%20collab.png"],"links":["https://coingecko.com","https://github.com/coingecko/cryptoexchange","https://www.coingecko.com","https://github.com/coingecko/cryptoexchange/pull/1008","https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md","https://github.com/vcr/vcr","https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#all-market-mini-tickers-stream","https://github.com/coingecko/cryptoexchange/wiki/Implementing-a-New-Exchange-(Websocket-API)","https://github.com/coingecko/cryptoexchange/wiki/Implementing-a-New-Exchange-","https://discord.gg/pKGV9sp","https://github.com/coingecko"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-11-30 13:39:15 |
last_update | 2018-11-30 13:39:15 |
depth | 0 |
children | 1 |
last_payout | 2018-12-07 13:39:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 66.776 HBD |
curator_payout_value | 21.102 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 5,480 |
author_reputation | 38,345,857,993,507 |
root_title | "Coingecko Task Request: Public Websocket API Connections for Binance" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 76,149,054 |
net_rshares | 144,656,573,021,430 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
abh12345 | 0 | 65,355,746,281 | 8% | ||
techslut | 0 | 402,083,029,831 | 100% | ||
jaredk123 | 0 | 995,749,752 | 100% | ||
headsink | 0 | 414,523,863 | 50% | ||
lawrenceho84 | 0 | 421,164,190,563 | 100% | ||
fingersik | 0 | 102,969,539,136 | 100% | ||
tdiv7653 | 0 | 2,451,493,523 | 100% | ||
grider123 | 0 | 3,232,416,270 | 100% | ||
jga | 0 | 9,725,058,725 | 50% | ||
yehey | 0 | 6,819,958,262 | 10% | ||
glocken93 | 0 | 302,271,997 | 100% | ||
haiyangdeperci | 0 | 6,891,261,375 | 20% | ||
fandy | 0 | 520,841,748 | 100% | ||
jacekw | 0 | 40,124,760,906 | 20% | ||
codingdefined | 0 | 7,864,575,965 | 7.5% | ||
muhammadan | 0 | 14,057,742,691 | 100% | ||
marlon6 | 0 | 26,917,136,136 | 17% | ||
clumsysilverdad | 0 | 10,045,439,394 | 8% | ||
kasho | 0 | 1,283,101,121,121 | 100% | ||
valerious | 0 | 2,153,732,446 | 100% | ||
izmy.steemit | 0 | 1,862,376,053 | 100% | ||
roman1973 | 0 | 4,135,911,314 | 100% | ||
netraleon | 0 | 2,045,500,452 | 100% | ||
tigerz | 0 | 2,747,332,512 | 100% | ||
accelerator | 0 | 20,702,338,583 | 1.5% | ||
karcher-310 | 0 | 1,337,806,944 | 100% | ||
rosatravels | 0 | 12,927,948,222 | 5% | ||
espoem | 0 | 165,034,700,700 | 100% | ||
mcfarhat | 0 | 6,438,618,385 | 8% | ||
darsn | 0 | 2,284,344,363 | 100% | ||
pierlave | 0 | 3,259,333,482 | 100% | ||
myjourney | 0 | 4,063,729,570 | 10% | ||
zdamna100ogebio | 0 | 2,344,546,430 | 100% | ||
utopian-io | 0 | 139,768,261,770,327 | 100% | ||
shammi | 0 | 29,093,306,071 | 30% | ||
dantealfaiz | 0 | 519,843,619 | 100% | ||
newsrx | 0 | 1,347,958,522 | 100% | ||
funtraveller | 0 | 49,269,716,019 | 4.8% | ||
sachincool | 0 | 30,049,208,884 | 100% | ||
hashash | 0 | 531,339,502 | 100% | ||
cpufronz | 0 | 5,121,092,858 | 100% | ||
lawrenceho | 0 | 613,322,414,618 | 100% | ||
amosbastian | 0 | 44,671,991,555 | 20% | ||
safetony | 0 | 2,964,453,281 | 100% | ||
predictionbot | 0 | 225,656,857,305 | 100% | ||
grzesiekb | 0 | 177,006,234,141 | 100% | ||
holger80 | 0 | 141,290,901,605 | 30% | ||
didic | 0 | 19,134,797,320 | 20% | ||
dexterdev | 0 | 7,358,657,646 | 100% | ||
roj | 0 | 5,623,938,881 | 100% | ||
wolontariusz | 0 | 7,186,102,349 | 100% | ||
effofex | 0 | 88,476,762 | 0.75% | ||
michaeladkins | 0 | 163,459,260,044 | 100% | ||
biochem | 0 | 6,153,757,885 | 100% | ||
zdamna100egebio | 0 | 1,963,531,852 | 100% | ||
seredina | 0 | 2,405,178,587 | 100% | ||
probaperra | 0 | 1,689,866,341 | 100% | ||
daily.johny | 0 | 22,804,777,620 | 100% | ||
nervniymen | 0 | 1,808,910,249 | 100% | ||
orange777 | 0 | 706,574,184 | 100% | ||
dementei | 0 | 490,988,995 | 100% | ||
golgo-13 | 0 | 64,712,225 | 20% | ||
council | 0 | 640,712,950 | 10% | ||
leebe | 0 | 490,629,128 | 100% | ||
kabernee | 0 | 490,623,177 | 100% | ||
art-s | 0 | 6,154,950,539 | 39% | ||
dreadfulfilk | 0 | 490,911,720 | 100% | ||
eczemamuon | 0 | 490,211,195 | 100% | ||
armandosodano | 0 | 5,910,031,721 | 21% | ||
elidirbrown | 0 | 490,413,623 | 100% | ||
genrbe | 0 | 69,762,310,594 | 100% | ||
kacmorova | 0 | 105,083,648 | 100% | ||
clusonsopi | 0 | 535,817,369 | 100% | ||
fontetersti | 0 | 532,443,387 | 100% | ||
ternutore | 0 | 521,781,213 | 100% | ||
nieloagranca | 0 | 1,781,599,980 | 4% | ||
isabellau935 | 0 | 524,719,828 | 100% | ||
steemchoose | 0 | 20,937,586,174 | 1.05% | ||
twitterprime | 0 | 491,020,759 | 100% | ||
zombieprivilege | 0 | 491,410,007 | 100% | ||
marcatounique | 0 | 491,117,281 | 100% | ||
mops2e | 0 | 1,228,155,349 | 80% | ||
katherineye | 0 | 532,711,034 | 100% | ||
nataliemg | 0 | 538,372,322 | 100% | ||
kayla3 | 0 | 532,365,011 | 100% | ||
photocirclebot | 0 | 845,564,765 | 24% | ||
jacekw.dev | 0 | 2,649,622,243 | 40% | ||
quediceharry | 0 | 1,121,587,454 | 100% | ||
rgirgin | 0 | 497,660,869 | 100% | ||
online87700 | 0 | 406,886,040 | 100% | ||
vieletporid | 0 | 532,098,504 | 100% | ||
scenjovixa | 0 | 536,901,077 | 100% | ||
bonadicta | 0 | 1,985,248,842 | 100% | ||
merlin7 | 0 | 21,587,345,687 | 0.84% | ||
hdikkerson | 0 | 494,681,093 | 100% | ||
mbond198 | 0 | 494,674,410 | 100% | ||
votes4minnows | 0 | 479,146,062 | 3% | ||
drewhudson | 0 | 530,294,034 | 100% | ||
nfc | 0 | 20,941,691,057 | 2% | ||
ozgurcinarli | 0 | 1,343,681,031 | 100% | ||
hdu | 0 | 479,413,866 | 1.5% | ||
luialejavencar | 0 | 387,892,076 | 100% | ||
kayleev | 0 | 536,476,299 | 100% | ||
olegka111 | 0 | 494,689,499 | 100% | ||
teamruffs | 0 | 494,662,232 | 100% | ||
apimasses | 0 | 494,670,631 | 100% | ||
pumicebreeder | 0 | 494,668,360 | 100% | ||
bridfarsto | 0 | 527,292,577 | 100% | ||
bitok.xyz | 0 | 8,634,976,350 | 1% | ||
avalonprosky | 0 | 117,415,026 | 75% | ||
hojiaxian | 0 | 21,912,872,134 | 100% | ||
whitebot | 0 | 454,882,176,155 | 24% | ||
soroush.shahyar | 0 | 455,648,153 | 100% | ||
tomekatomek | 0 | 17,968,359,072 | 100% | ||
cripple | 0 | 308,018,550 | 100% | ||
steemfucker | 0 | 322,479,707 | 100% | ||
goodshepherd | 0 | 1,627,625,499 | 10% | ||
killerklown93 | 0 | 406,843,691 | 100% | ||
proof-of-stake | 0 | 346,412 | 100% | ||
lycamtmttz | 0 | 411,024,415 | 100% | ||
dahamsa | 0 | 328,656,679 | 100% | ||
zaphyr | 0 | 8,749,513,037 | 100% | ||
yifeiliu | 0 | 510,474,288 | 100% | ||
kyberswap | 0 | 226,905,101 | 100% | ||
cafedecoral | 0 | 234,069,387 | 100% | ||
ll0752 | 0 | 532,094,815 | 100% |
Reading about it.....😇 Posted using [Partiko Android](https://steemit.com/@partiko-android)
author | mediawizards |
---|---|
permlink | mediawizards-re-utopian-tasks-coingecko-task-request-public-websocket-api-connections-for-binance-20181130t155139995z |
category | utopian-io |
json_metadata | {"app":"partiko"} |
created | 2018-11-30 15:51:39 |
last_update | 2018-11-30 15:51:39 |
depth | 1 |
children | 0 |
last_payout | 2018-12-07 15:51:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 93 |
author_reputation | 22,927,285,597,690 |
root_title | "Coingecko Task Request: Public Websocket API Connections for Binance" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,155,382 |
net_rshares | 0 |