cryptoexchange
cryptoexchange copied to clipboard
WIP: Implement Poloniex websocket API
- What is the purpose of this Pull Request? Solves https://github.com/coingecko/cryptoexchange/issues/1211
- What is the related issue for this Pull Request (if this PR fixes issue, prepend with "Fixes" or "Closes")?
- [ ] I have added Specs
- [ ] (If implementing Market Ticker) I have verified that the
volume
refers to BASE - [ ] (If implementing Market Ticker) I have verified that the
base
andtarget
is assigned correctly - [ ] I have implemented the
trade_page_url
method that links to the exchange page with thebase
andtarget
passed in. If not available, enter the root domain of the exchange website. - [ ] I have verified at least ONE ticker volume matches volume shown on the trading page (use script below)
client = Cryptoexchange::Client.new
pairs = client.pairs 'exchange_name'
tickers = pairs.map do |p| client.ticker p end
sorted_tickers = tickers.sort_by do |t| t.volume end.reverse
Will update it in 5-7 days :+1:
@srisankethu
- I tested this code but it seems like the values are not getting mapped correctly, everything seems blank other than
base
andtarget
. I supposed it is pointing to the wrong element in the array. eg. the ticker message is in the following format
[1002, nil, [50, "0.00830500", "0.00831376", "0.00830133", "0.02792413", "111.12106534", "13454.60628988", 0, "0.00846000", "0.00802279"]]
-
Since this websocket returns all pairs in a single connection, it would be ideal to have it done in a way that we do not need to pass in a specific pair. In any case a mapping needs to be done with (Refer to the bottom currency pair ID at https://poloniex.com/support/api/#websockets_channels_ticker) whichever approach we choose to take. Don't seem to see any API that allows us to pull this list in real time
-
Would also suggest documenting the websocket output response in the comment (see Bitfinex implementation) as a reference for others.
@tmlee Thanks for the comment. I will look into it ASAP.
@tmlee I am facing problem with the ticker format. Unlike Bitfinex, this is a different format. How do I test my implementation?