From 68815b4b35c490645b6425b528a5dfb2f55dde1f Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 2 May 2019 11:05:02 +0800 Subject: [PATCH 1/7] fix knc exchange url --- lib/cryptoexchange/exchanges/kyber_network/market.rb | 2 +- spec/exchanges/kyber_network/integration/market_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cryptoexchange/exchanges/kyber_network/market.rb b/lib/cryptoexchange/exchanges/kyber_network/market.rb index ff2a0d225..e8945810e 100644 --- a/lib/cryptoexchange/exchanges/kyber_network/market.rb +++ b/lib/cryptoexchange/exchanges/kyber_network/market.rb @@ -5,7 +5,7 @@ class Market < Cryptoexchange::Models::Market API_URL = 'https://tracker.kyber.network/api' def self.trade_page_url(args={}) - "https://kyber.network/swap/#{args[:target]}_#{args[:base]}" + "https://kyber.network/swap/#{args[:target].downcase}-#{args[:base].downcase}" end end end diff --git a/spec/exchanges/kyber_network/integration/market_spec.rb b/spec/exchanges/kyber_network/integration/market_spec.rb index 6c513a746..842844615 100644 --- a/spec/exchanges/kyber_network/integration/market_spec.rb +++ b/spec/exchanges/kyber_network/integration/market_spec.rb @@ -16,7 +16,7 @@ it 'give trade url' do trade_page_url = client.trade_page_url 'kyber_network', base: knc_eth_pair.base, target: knc_eth_pair.target - expect(trade_page_url).to eq "https://kyber.network/swap/ETH_KNC" + expect(trade_page_url).to eq "https://kyber.network/swap/eth-knc" end it 'fetch ticker' do @@ -31,7 +31,7 @@ expect(ticker.high).to be_nil expect(ticker.volume).to be_a Numeric expect(ticker.timestamp).to be nil - + expect(ticker.payload).to_not be nil end end From 5f40ab46d7230e47b12618e2488bd29a87aaed98 Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 2 May 2019 11:13:24 +0800 Subject: [PATCH 2/7] spacing --- spec/exchanges/kyber_network/integration/market_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/exchanges/kyber_network/integration/market_spec.rb b/spec/exchanges/kyber_network/integration/market_spec.rb index 842844615..8ce12a19b 100644 --- a/spec/exchanges/kyber_network/integration/market_spec.rb +++ b/spec/exchanges/kyber_network/integration/market_spec.rb @@ -31,7 +31,7 @@ expect(ticker.high).to be_nil expect(ticker.volume).to be_a Numeric expect(ticker.timestamp).to be nil - + expect(ticker.payload).to_not be nil end end From c8f8f4900443ece4ba6aff8f0f9e82cf3824c8ef Mon Sep 17 00:00:00 2001 From: Jack Wong Date: Thu, 2 May 2019 11:22:15 +0800 Subject: [PATCH 3/7] Jw bitstorage implementation with mod (#1500) * Add Pairs, Tickers, OrderBook, Trade URL, Trades and update README for BitStorage * implement bitstorage --- README.md | 1 + .../exchanges/bitstorage/market.rb | 12 ++++ .../exchanges/bitstorage/services/market.rb | 51 ++++++++++++++ .../bitstorage/services/order_book.rb | 43 ++++++++++++ .../exchanges/bitstorage/services/pairs.rb | 23 +++++++ .../exchanges/bitstorage/services/trades.rb | 32 +++++++++ .../integration_specs_fetch_order_book.yml | 58 ++++++++++++++++ .../integration_specs_fetch_pairs.yml | 58 ++++++++++++++++ .../integration_specs_fetch_ticker.yml | 58 ++++++++++++++++ .../integration_specs_fetch_trade.yml | 62 +++++++++++++++++ .../bitstorage/integration/market_spec.rb | 69 +++++++++++++++++++ spec/exchanges/bitstorage/market_spec.rb | 6 ++ 12 files changed, 473 insertions(+) create mode 100644 lib/cryptoexchange/exchanges/bitstorage/market.rb create mode 100644 lib/cryptoexchange/exchanges/bitstorage/services/market.rb create mode 100644 lib/cryptoexchange/exchanges/bitstorage/services/order_book.rb create mode 100644 lib/cryptoexchange/exchanges/bitstorage/services/pairs.rb create mode 100644 lib/cryptoexchange/exchanges/bitstorage/services/trades.rb create mode 100644 spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_order_book.yml create mode 100644 spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_pairs.yml create mode 100644 spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_ticker.yml create mode 100644 spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_trade.yml create mode 100644 spec/exchanges/bitstorage/integration/market_spec.rb create mode 100644 spec/exchanges/bitstorage/market_spec.rb diff --git a/README.md b/README.md index 697383309..2c04f743a 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ Or install it yourself as: | Bitso | Y | | | | Y | | bitso | | | Bitstamp | Y | Y [x] | Y | | User-Defined| | bitstamp | | | Bitsten | Y | Y | N | | Y | Y | bitsten | | +| Bitstorage | Y | Y | Y | | Y | Y | bitstorage | | | Bittrex | Y | | | | Y | Y | bittrex | | | Bkex | Y | N | N | | Y | Y | bkex | | | Bleutrade | Y | | | | Y | | bleutrade | | diff --git a/lib/cryptoexchange/exchanges/bitstorage/market.rb b/lib/cryptoexchange/exchanges/bitstorage/market.rb new file mode 100644 index 000000000..8ab63fdd9 --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitstorage/market.rb @@ -0,0 +1,12 @@ +module Cryptoexchange::Exchanges + module Bitstorage + class Market < Cryptoexchange::Models::Market + NAME = 'bitstorage' + API_URL = 'https://bitstorage.finance/api' + + def self.trade_page_url(args={}) + "https://bitstorage.finance/market/#{args[:base]}-#{args[:target]}" + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitstorage/services/market.rb b/lib/cryptoexchange/exchanges/bitstorage/services/market.rb new file mode 100644 index 000000000..0f3aab95c --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitstorage/services/market.rb @@ -0,0 +1,51 @@ +module Cryptoexchange::Exchanges + module Bitstorage + module Services + class Market < Cryptoexchange::Services::Market + class << self + def supports_individual_ticker_query? + false + end + end + + def fetch + output = super(ticker_url) + adapt_all(output) + end + + def ticker_url + "#{Cryptoexchange::Exchanges::Bitstorage::Market::API_URL}/ticker" + end + + def adapt_all(output) + output.map do |pair| + base, target = pair['pairs'].split('_') + market_pair = Cryptoexchange::Models::MarketPair.new( + base: base, + target: target, + market: Bitstorage::Market::NAME + ) + adapt(market_pair, pair) + end + end + + def adapt(market_pair, output) + ticker = Cryptoexchange::Models::Ticker.new + ticker.base = market_pair.base + ticker.target = market_pair.target + ticker.market = Bitstorage::Market::NAME + ticker.last = NumericHelper.to_d(output['last_price']) + ticker.high = NumericHelper.to_d(output['high']) + ticker.low = NumericHelper.to_d(output['low']) + ticker.bid = NumericHelper.to_d(output['bid']) + ticker.ask = NumericHelper.to_d(output['ask']) + ticker.volume = NumericHelper.divide(output['24H_volume'], ticker.last) if ticker.last > 0 + ticker.change = NumericHelper.to_d(output['change']) + ticker.timestamp = nil + ticker.payload = output + ticker + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitstorage/services/order_book.rb b/lib/cryptoexchange/exchanges/bitstorage/services/order_book.rb new file mode 100644 index 000000000..fa237d6be --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitstorage/services/order_book.rb @@ -0,0 +1,43 @@ +module Cryptoexchange::Exchanges + module Bitstorage + module Services + class OrderBook < Cryptoexchange::Services::Market + class << self + def supports_individual_ticker_query? + true + end + end + + def fetch(market_pair) + output = super(ticker_url(market_pair)) + adapt(output, market_pair) + end + + def ticker_url(market_pair) + "#{Cryptoexchange::Exchanges::Bitstorage::Market::API_URL}/order-book?market=#{market_pair.base}¤cy=#{market_pair.target}" + end + + def adapt(output, market_pair) + order_book = Cryptoexchange::Models::OrderBook.new + + order_book.base = market_pair.base + order_book.target = market_pair.target + order_book.market = Bitstorage::Market::NAME + order_book.asks = output['order-book']['ask'].empty? ? ['Nil'] : adapt_orders(output['order-book']['ask']) + order_book.bids = output['order-book']['bid'].empty? ? ['Nil'] : adapt_orders(output['order-book']['bid']) + order_book.timestamp = nil + order_book.payload = output + order_book + end + + def adapt_orders(orders) + orders.collect do |order_entry| + Cryptoexchange::Models::Order.new(price: order_entry['price'], + amount: order_entry['order_amount'], + timestamp: order_entry['timestamp']) + end + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitstorage/services/pairs.rb b/lib/cryptoexchange/exchanges/bitstorage/services/pairs.rb new file mode 100644 index 000000000..24ec7da10 --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitstorage/services/pairs.rb @@ -0,0 +1,23 @@ +module Cryptoexchange::Exchanges + module Bitstorage + module Services + class Pairs < Cryptoexchange::Services::Pairs + PAIRS_URL = "#{Cryptoexchange::Exchanges::Bitstorage::Market::API_URL}/ticker" + + def fetch + output = super + market_pairs = [] + output.each do |pair| + base, target = pair['pairs'].split('_') + market_pairs << Cryptoexchange::Models::MarketPair.new( + base: base, + target: target, + market: Bitstorage::Market::NAME + ) + end + market_pairs + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitstorage/services/trades.rb b/lib/cryptoexchange/exchanges/bitstorage/services/trades.rb new file mode 100644 index 000000000..8a7711c5c --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitstorage/services/trades.rb @@ -0,0 +1,32 @@ +module Cryptoexchange::Exchanges + module Bitstorage + module Services + class Trades < Cryptoexchange::Services::Market + def fetch(market_pair) + output = super(ticker_url(market_pair)) + adapt(output, market_pair) + end + + def ticker_url(market_pair) + "#{Cryptoexchange::Exchanges::Bitstorage::Market::API_URL}/transactions?market=#{market_pair.base}¤cy=#{market_pair.target}" + end + + def adapt(output, market_pair) + output['transactions']['data'].collect do |trade| + tr = Cryptoexchange::Models::Trade.new + tr.trade_id = trade['id'] + tr.base = market_pair.base + tr.target = market_pair.target + tr.market = Bitstorage::Market::NAME + tr.type = trade['maker_type'] + tr.price = trade['price'] + tr.amount = trade['amount'] + tr.timestamp = trade['timestamp'] + tr.payload = trade + tr + end + end + end + end + end +end diff --git a/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_order_book.yml b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_order_book.yml new file mode 100644 index 000000000..58e325a32 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_order_book.yml @@ -0,0 +1,58 @@ +--- +http_interactions: +- request: + method: get + uri: https://bitstorage.finance/api/order-book?currency=USD&market=BTC + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - bitstorage.finance + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 05 Feb 2019 03:19:16 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '167' + Connection: + - close + Set-Cookie: + - PHPSESSID=7hmvb63selno6rq8gil18cb4u7; path=/; HttpOnly + - PHPSESSID=b0e9dog10o79t211f4h6bqk0f3; path=/; HttpOnly + - PHPSESSID=fiegqjibc6f3a8saavrn0vbeu3; path=/; HttpOnly + - __cfduid=db162cbddcb67139fe2c9a898f0cbf77f1549336755; expires=Wed, 05-Feb-20 + 03:19:15 GMT; path=/; domain=.bitstorage.finance; HttpOnly; Secure + X-Frame-Options: + - SAMEORIGIN + Access-Control-Allow-Origin: + - "*" + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Cache-Control: + - no-store, no-cache, must-revalidate, post-check=0, pre-check=0 + Pragma: + - no-cache + Access-Control-Allow-Methods: + - GET,POST,OPTIONS,DELETE,PUT + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a423c04a90894b7-NRT + body: + encoding: UTF-8 + string: '{"order-book":{"market":"BTC","currency":"USD","bid":[{"price":3600,"order_amount":0.00027,"order_value":0.97,"converted_from":null,"timestamp":1548447843}],"ask":[]}}' + http_version: + recorded_at: Tue, 05 Feb 2019 03:19:16 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_pairs.yml b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_pairs.yml new file mode 100644 index 000000000..9aa0b4d4f --- /dev/null +++ b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_pairs.yml @@ -0,0 +1,58 @@ +--- +http_interactions: +- request: + method: get + uri: https://bitstorage.finance/api/ticker + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - bitstorage.finance + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 05 Feb 2019 02:44:03 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '2243' + Connection: + - close + Set-Cookie: + - PHPSESSID=901ii9fjam8g2dpsjg81keu4h6; path=/; HttpOnly + - PHPSESSID=sguhg9luqq959anp5a1t3hp6a1; path=/; HttpOnly + - PHPSESSID=uorst4i27cq90u9jkjvda3e1v3; path=/; HttpOnly + - __cfduid=d21e321a5bdfb913acda510ff5dd65edd1549334640; expires=Wed, 05-Feb-20 + 02:44:00 GMT; path=/; domain=.bitstorage.finance; HttpOnly; Secure + X-Frame-Options: + - SAMEORIGIN + Access-Control-Allow-Origin: + - "*" + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Cache-Control: + - no-store, no-cache, must-revalidate, post-check=0, pre-check=0 + Pragma: + - no-cache + Access-Control-Allow-Methods: + - GET,POST,OPTIONS,DELETE,PUT + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a42085febd294ab-NRT + body: + encoding: UTF-8 + string: '[{"pairs":"NXB_BTC","bid":5.0e-8,"ask":7.0e-8,"high":7.0e-8,"low":5.0e-8,"last_price":5.0e-8,"change":-16,"24H_volume":0.00995784},{"pairs":"AYWA_BTC","bid":2.0e-8,"ask":1.7e-7,"high":5.0e-8,"low":5.0e-8,"last_price":5.0e-8,"change":0,"24H_volume":0},{"pairs":"ESBC_BTC","bid":5.04e-6,"ask":5.94e-6,"high":5.93e-6,"low":5.04e-6,"last_price":5.89e-6,"change":15,"24H_volume":1.25191232},{"pairs":"SUNP_BTC","bid":2.0e-8,"ask":2.0e-8,"high":1.0e-8,"low":1.0e-8,"last_price":1.0e-8,"change":-50,"24H_volume":6.33e-6},{"pairs":"SICC_BTC","bid":3.0e-8,"ask":4.0e-6,"high":4.42e-6,"low":4.42e-6,"last_price":4.42e-6,"change":-3,"24H_volume":0},{"pairs":"DOGE_BTC","bid":5.2e-7,"ask":5.8e-7,"high":5.8e-7,"low":5.2e-7,"last_price":5.4e-7,"change":-1,"24H_volume":0.94608925},{"pairs":"LTC_BTC","bid":0.00769,"ask":0.00769,"high":0.00769,"low":0.00769,"last_price":0.00769,"change":0,"24H_volume":0},{"pairs":"NXB_LTC","bid":4.56e-5,"ask":4.56e-5,"high":0,"low":0,"last_price":4.56e-5,"change":-10,"24H_volume":0},{"pairs":"SICC_DOGE","bid":5750.93,"ask":5750.93,"high":7.62068966,"low":7.62068966,"last_price":0,"change":0,"24H_volume":0},{"pairs":"NXB_DOGE","bid":1.2,"ask":1.2,"high":0,"low":0,"last_price":1.2,"change":0,"24H_volume":0},{"pairs":"SICC_DOGE","bid":5750.93,"ask":5750.93,"high":7.62068966,"low":7.62068966,"last_price":0,"change":0,"24H_volume":0},{"pairs":"NXB_USD","bid":0.01,"ask":0.01,"high":0,"low":0,"last_price":0.02,"change":0,"24H_volume":0},{"pairs":"BTC_USD","bid":3600,"ask":3600,"high":450268500,"low":450268500,"last_price":8250,"change":0,"24H_volume":0},{"pairs":"NXB_RUB","bid":0.03,"ask":0.48,"high":0,"low":0,"last_price":0.48,"change":2,"24H_volume":0},{"pairs":"NXB_EUR","bid":0.1,"ask":0.1,"high":0,"low":0,"last_price":10,"change":0,"24H_volume":0},{"pairs":"ESBC_DOGE","bid":5,"ask":5,"high":0,"low":0,"last_price":6,"change":-25,"24H_volume":0},{"pairs":"ESBC_RUB","bid":0.8,"ask":0.8,"high":0,"low":0,"last_price":0.8,"change":0,"24H_volume":0},{"pairs":"FNO_BTC","bid":8.2e-7,"ask":8.5e-7,"high":8.5e-7,"low":8.2e-7,"last_price":8.5e-7,"change":3,"24H_volume":0.02579373},{"pairs":"TUBE_BTC","bid":6.15e-6,"ask":6.5e-6,"high":6.49e-6,"low":6.16e-6,"last_price":6.44e-6,"change":0,"24H_volume":0.10826178}]' + http_version: + recorded_at: Tue, 05 Feb 2019 02:44:03 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_ticker.yml b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_ticker.yml new file mode 100644 index 000000000..6a988715f --- /dev/null +++ b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_ticker.yml @@ -0,0 +1,58 @@ +--- +http_interactions: +- request: + method: get + uri: https://bitstorage.finance/api/ticker + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - bitstorage.finance + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 05 Feb 2019 03:09:38 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '2254' + Connection: + - close + Set-Cookie: + - PHPSESSID=55j3jvrmfic56ar3qe028e9cp1; path=/; HttpOnly + - PHPSESSID=gtveaiotuebuk73jdpbkqhkbn1; path=/; HttpOnly + - PHPSESSID=qnc5a74i9hnfpebn489tal5pd0; path=/; HttpOnly + - __cfduid=dd65b7f268f16b228e90a19e0449236501549336173; expires=Wed, 05-Feb-20 + 03:09:33 GMT; path=/; domain=.bitstorage.finance; HttpOnly; Secure + X-Frame-Options: + - SAMEORIGIN + Access-Control-Allow-Origin: + - "*" + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Cache-Control: + - no-store, no-cache, must-revalidate, post-check=0, pre-check=0 + Pragma: + - no-cache + Access-Control-Allow-Methods: + - GET,POST,OPTIONS,DELETE,PUT + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a422dcb0a31949f-NRT + body: + encoding: UTF-8 + string: '[{"pairs":"NXB_BTC","bid":5.0e-8,"ask":7.0e-8,"high":7.0e-8,"low":5.0e-8,"last_price":7.0e-8,"change":16,"24H_volume":0.0100719},{"pairs":"AYWA_BTC","bid":2.0e-8,"ask":1.7e-7,"high":5.0e-8,"low":5.0e-8,"last_price":5.0e-8,"change":0,"24H_volume":0},{"pairs":"ESBC_BTC","bid":5.04e-6,"ask":5.94e-6,"high":5.93e-6,"low":5.04e-6,"last_price":5.49e-6,"change":4,"24H_volume":1.27770927},{"pairs":"SUNP_BTC","bid":1.0e-8,"ask":2.0e-8,"high":1.0e-8,"low":1.0e-8,"last_price":1.0e-8,"change":-50,"24H_volume":6.33e-6},{"pairs":"SICC_BTC","bid":3.0e-8,"ask":4.0e-6,"high":4.42e-6,"low":4.42e-6,"last_price":4.42e-6,"change":-3,"24H_volume":0},{"pairs":"DOGE_BTC","bid":5.2e-7,"ask":5.8e-7,"high":5.8e-7,"low":5.2e-7,"last_price":5.3e-7,"change":0,"24H_volume":0.96131627},{"pairs":"LTC_BTC","bid":0.00769,"ask":0.00769,"high":0.00769,"low":0.00769,"last_price":0.00769,"change":0,"24H_volume":0},{"pairs":"NXB_LTC","bid":4.56e-5,"ask":4.56e-5,"high":0,"low":0,"last_price":4.56e-5,"change":-10,"24H_volume":0},{"pairs":"SICC_DOGE","bid":5750.93,"ask":5750.93,"high":7.62068966,"low":7.62068966,"last_price":0,"change":0,"24H_volume":0},{"pairs":"NXB_DOGE","bid":1.2,"ask":1.2,"high":0,"low":0,"last_price":1.2,"change":0,"24H_volume":0},{"pairs":"SICC_DOGE","bid":5750.93,"ask":5750.93,"high":7.62068966,"low":7.62068966,"last_price":0,"change":0,"24H_volume":0},{"pairs":"NXB_USD","bid":0.01,"ask":0.01,"high":0,"low":0,"last_price":0.02,"change":0,"24H_volume":0},{"pairs":"BTC_USD","bid":3600,"ask":3600,"high":450268500,"low":450268500,"last_price":8250,"change":0,"24H_volume":0},{"pairs":"NXB_RUB","bid":0.03,"ask":0.48,"high":0,"low":0,"last_price":0.48,"change":2,"24H_volume":0},{"pairs":"NXB_EUR","bid":0.1,"ask":0.1,"high":0,"low":0,"last_price":10,"change":0,"24H_volume":0},{"pairs":"ESBC_DOGE","bid":5,"ask":5,"high":8.68965517,"low":0,"last_price":6,"change":-25,"24H_volume":0},{"pairs":"ESBC_RUB","bid":0.8,"ask":0.8,"high":3.0e-7,"low":0,"last_price":0.8,"change":0,"24H_volume":0},{"pairs":"FNO_BTC","bid":8.2e-7,"ask":8.5e-7,"high":8.5e-7,"low":8.2e-7,"last_price":8.3e-7,"change":0,"24H_volume":0.02613775},{"pairs":"TUBE_BTC","bid":6.15e-6,"ask":6.5e-6,"high":6.49e-6,"low":6.16e-6,"last_price":6.33e-6,"change":-2,"24H_volume":0.10957261}]' + http_version: + recorded_at: Tue, 05 Feb 2019 03:09:38 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_trade.yml b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_trade.yml new file mode 100644 index 000000000..1df3cb9ec --- /dev/null +++ b/spec/cassettes/vcr_cassettes/BitStorage/integration_specs_fetch_trade.yml @@ -0,0 +1,62 @@ +--- +http_interactions: +- request: + method: get + uri: https://bitstorage.finance/api/transactions?currency=USD&market=BTC + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - bitstorage.finance + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 05 Feb 2019 03:28:13 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '699' + Connection: + - close + Set-Cookie: + - PHPSESSID=e7n83bh4vs5dvt9ig14saju5a1; path=/; HttpOnly + - PHPSESSID=u73seqgp7k6leoq39oe1k7g2v0; path=/; HttpOnly + - PHPSESSID=vnr3ua60fbdprn8m5gm9l7hg25; path=/; HttpOnly + - __cfduid=d9cc43f2297baaf609a9490617b2d96eb1549337292; expires=Wed, 05-Feb-20 + 03:28:12 GMT; path=/; domain=.bitstorage.finance; HttpOnly; Secure + X-Frame-Options: + - SAMEORIGIN + Access-Control-Allow-Origin: + - "*" + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Cache-Control: + - no-store, no-cache, must-revalidate, post-check=0, pre-check=0 + Pragma: + - no-cache + Access-Control-Allow-Methods: + - GET,POST,OPTIONS,DELETE,PUT + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a42491eef1a946f-NRT + body: + encoding: UTF-8 + string: '{"transactions":{"market":"BTC","currency":"USD","data":[{"id":449,"date":"2018-07-24 + 12:04:18","timestamp":1532423058,"btc":2.14e-5,"maker_type":"sell","price":8250,"amount":0.17655,"currency":"USD","market":"BTC"},{"id":241,"date":"2018-05-20 + 14:43:12","timestamp":1526816592,"btc":2.405e-5,"maker_type":"sell","price":8250,"amount":0.1984125,"currency":"USD","market":"BTC"},{"id":127,"date":"2018-05-08 + 07:34:10","timestamp":1525754050,"btc":0.00048167,"maker_type":"buy","price":9130,"amount":4.3976471,"currency":"USD","market":"BTC"},{"id":84,"date":"2018-05-04 + 19:25:21","timestamp":1525451121,"btc":1.0e-5,"maker_type":"sell","price":9130,"amount":0.0913,"currency":"USD","market":"BTC"}]}}' + http_version: + recorded_at: Tue, 05 Feb 2019 03:28:13 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/exchanges/bitstorage/integration/market_spec.rb b/spec/exchanges/bitstorage/integration/market_spec.rb new file mode 100644 index 000000000..0927d6913 --- /dev/null +++ b/spec/exchanges/bitstorage/integration/market_spec.rb @@ -0,0 +1,69 @@ +require 'spec_helper' + +RSpec.describe 'BitStorage integration specs' do + let(:client) { Cryptoexchange::Client.new } + let(:btc_usd_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'USD', market: 'bitstorage') } + + it 'has trade_page_url' do + trade_page_url = client.trade_page_url btc_usd_pair.market, base: btc_usd_pair.base, target: btc_usd_pair.target + expect(trade_page_url).to eq "https://bitstorage.finance/market/BTC-USD" + end + + it 'fetch pairs' do + pairs = client.pairs('bitstorage') + expect(pairs).not_to be_empty + + pair = pairs.first + expect(pair.base).to_not be nil + expect(pair.target).to_not be nil + expect(pair.market).to eq 'bitstorage' + end + + it 'fetch ticker' do + ticker = client.ticker(btc_usd_pair) + + expect(ticker.base).to eq 'BTC' + expect(ticker.target).to eq 'USD' + expect(ticker.market).to eq 'bitstorage' + expect(ticker.last).to be_a Numeric + expect(ticker.low).to be_a Numeric + expect(ticker.high).to be_a Numeric + expect(ticker.bid).to be_a Numeric + expect(ticker.ask).to be_a Numeric + expect(ticker.change).to be_a Numeric + expect(ticker.volume).to be_a Numeric + expect(ticker.timestamp).to be nil + expect(ticker.payload).to_not be nil + end + + it 'fetch order book' do + order_book = client.order_book(btc_usd_pair) + + expect(order_book.base).to eq 'BTC' + expect(order_book.target).to eq 'USD' + expect(order_book.market).to eq 'bitstorage' + expect(order_book.asks).to_not be_empty + expect(order_book.bids).to_not be_empty + expect(order_book.asks.count).to be > 0 + expect(order_book.bids.count).to be > 0 + expect(order_book.timestamp).to be nil + expect(order_book.payload).to_not be nil + end + + it 'fetch trade' do + trades = client.trades(btc_usd_pair) + trade = trades.sample + + expect(trades).to_not be_empty + expect(trade.base).to eq 'BTC' + expect(trade.target).to eq 'USD' + expect(trade.market).to eq 'bitstorage' + expect(trade.trade_id).to_not be_nil + expect(['buy', 'sell']).to include trade.type + expect(trade.price).to_not be_nil + expect(trade.amount).to_not be_nil + expect(trade.timestamp).to be_a Numeric + expect(2000..Date.today.year).to include(Time.at(trade.timestamp).year) + expect(trade.payload).to_not be nil + end +end diff --git a/spec/exchanges/bitstorage/market_spec.rb b/spec/exchanges/bitstorage/market_spec.rb new file mode 100644 index 000000000..3a15e2e3d --- /dev/null +++ b/spec/exchanges/bitstorage/market_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' + +RSpec.describe Cryptoexchange::Exchanges::Bitstorage::Market do + it { expect(described_class::NAME).to eq 'bitstorage' } + it { expect(described_class::API_URL).to eq 'https://bitstorage.finance/api' } +end From 10f4375f3bc3d54024cb40d1fb6a2bafc4011b93 Mon Sep 17 00:00:00 2001 From: Esther <30499981+estherleongym@users.noreply.github.com> Date: Thu, 2 May 2019 11:34:48 +0800 Subject: [PATCH 4/7] Add Pairs, Tickers, OrderBook, Trades, Trade URL and update README for Bitalong (#1336) --- README.md | 3 +- .../exchanges/bitalong/market.rb | 12 ++ .../exchanges/bitalong/services/market.rb | 51 +++++++ .../exchanges/bitalong/services/order_book.rb | 42 ++++++ .../exchanges/bitalong/services/pairs.rb | 23 ++++ .../exchanges/bitalong/services/trades.rb | 32 +++++ .../integration_specs_fetch_order_book.yml | 51 +++++++ .../integration_specs_fetch_pairs.yml | 51 +++++++ .../integration_specs_fetch_ticker.yml | 51 +++++++ .../integration_specs_fetch_trade.yml | 130 ++++++++++++++++++ .../bitalong/integration/market_spec.rb | 72 ++++++++++ spec/exchanges/bitalong/market_spec.rb | 6 + 12 files changed, 523 insertions(+), 1 deletion(-) create mode 100644 lib/cryptoexchange/exchanges/bitalong/market.rb create mode 100644 lib/cryptoexchange/exchanges/bitalong/services/market.rb create mode 100644 lib/cryptoexchange/exchanges/bitalong/services/order_book.rb create mode 100644 lib/cryptoexchange/exchanges/bitalong/services/pairs.rb create mode 100644 lib/cryptoexchange/exchanges/bitalong/services/trades.rb create mode 100644 spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_order_book.yml create mode 100644 spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_pairs.yml create mode 100644 spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_ticker.yml create mode 100644 spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_trade.yml create mode 100644 spec/exchanges/bitalong/integration/market_spec.rb create mode 100644 spec/exchanges/bitalong/market_spec.rb diff --git a/README.md b/README.md index 2c04f743a..d6455c832 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Or install it yourself as: | Bisq | Y | | Y | | Y | | bisq | | | Bit2C | Y | Y | Y | | User-Defined| Y | bit2c | | | Bit-Z | Y | | | | Y | | bit_z | | +| Bitalong | Y | Y | Y | | Y | Y | bitalong | | | Bitbank | Y | Y | Y | | User-Defined| Y | bitbank | | | Bitbay | Y | | | | User-Defined| | bitbay | | | Bitbegin | Y | N | N | | Y | Y | bitbegin | | @@ -584,4 +585,4 @@ You can chat with the core team member or other participating in this repository ## License -The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). +The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/lib/cryptoexchange/exchanges/bitalong/market.rb b/lib/cryptoexchange/exchanges/bitalong/market.rb new file mode 100644 index 000000000..9fb6c9825 --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitalong/market.rb @@ -0,0 +1,12 @@ +module Cryptoexchange::Exchanges + module Bitalong + class Market < Cryptoexchange::Models::Market + NAME = 'bitalong' + API_URL = 'https://www.bitalong.com/api' + + def self.trade_page_url(args={}) + "https://www.bitalong.com/trade/index/market/#{args[:base].downcase}_#{args[:target].downcase}" + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitalong/services/market.rb b/lib/cryptoexchange/exchanges/bitalong/services/market.rb new file mode 100644 index 000000000..299daaa1e --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitalong/services/market.rb @@ -0,0 +1,51 @@ +module Cryptoexchange::Exchanges + module Bitalong + module Services + class Market < Cryptoexchange::Services::Market + class << self + def supports_individual_ticker_query? + false + end + end + + def fetch + output = super(ticker_url) + adapt_all(output) + end + + def ticker_url + "#{Cryptoexchange::Exchanges::Bitalong::Market::API_URL}/index/tickers" + end + + def adapt_all(output) + output.map do |pair| + base, target = pair[0].split('_') + market_pair = Cryptoexchange::Models::MarketPair.new( + base: base.upcase, + target: target.upcase, + market: Bitalong::Market::NAME + ) + adapt(market_pair, pair[1]) + end + end + + def adapt(market_pair, output) + ticker = Cryptoexchange::Models::Ticker.new + ticker.base = market_pair.base + ticker.target = market_pair.target + ticker.market = Bitalong::Market::NAME + ticker.last = NumericHelper.to_d(output['last']) + ticker.high = NumericHelper.to_d(output['high24hr']) + ticker.low = NumericHelper.to_d(output['low24hr']) + ticker.bid = NumericHelper.to_d(output['highestBid']) + ticker.ask = NumericHelper.to_d(output['lowestAsk']) + ticker.volume = NumericHelper.to_d(output['baseVolume']) + ticker.change = NumericHelper.to_d(output['percentChange']) + ticker.timestamp = nil + ticker.payload = output + ticker + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitalong/services/order_book.rb b/lib/cryptoexchange/exchanges/bitalong/services/order_book.rb new file mode 100644 index 000000000..eb523e427 --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitalong/services/order_book.rb @@ -0,0 +1,42 @@ +module Cryptoexchange::Exchanges + module Bitalong + module Services + class OrderBook < Cryptoexchange::Services::Market + class << self + def supports_individual_ticker_query? + true + end + end + + def fetch(market_pair) + output = super(ticker_url(market_pair)) + adapt(output, market_pair) + end + + def ticker_url(market_pair) + "#{Cryptoexchange::Exchanges::Bitalong::Market::API_URL}/index/orderBook/#{market_pair.base.downcase}_#{market_pair.target.downcase}" + end + + def adapt(output, market_pair) + order_book = Cryptoexchange::Models::OrderBook.new + + order_book.base = market_pair.base + order_book.target = market_pair.target + order_book.market = Bitalong::Market::NAME + order_book.asks = adapt_orders(output['asks']) + order_book.bids = adapt_orders(output['bids']) + order_book.timestamp = nil + order_book.payload = output + order_book + end + + def adapt_orders(orders) + orders.collect do |order_entry| + Cryptoexchange::Models::Order.new(price: order_entry[0], + amount: order_entry[1]) + end + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitalong/services/pairs.rb b/lib/cryptoexchange/exchanges/bitalong/services/pairs.rb new file mode 100644 index 000000000..5c4e2a85d --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitalong/services/pairs.rb @@ -0,0 +1,23 @@ +module Cryptoexchange::Exchanges + module Bitalong + module Services + class Pairs < Cryptoexchange::Services::Pairs + PAIRS_URL = "#{Cryptoexchange::Exchanges::Bitalong::Market::API_URL}/index/pairs" + + def fetch + output = super + market_pairs = [] + output.each do |pair| + base, target = pair.split('_') + market_pairs << Cryptoexchange::Models::MarketPair.new( + base: base.upcase, + target: target.upcase, + market: Bitalong::Market::NAME + ) + end + market_pairs + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/bitalong/services/trades.rb b/lib/cryptoexchange/exchanges/bitalong/services/trades.rb new file mode 100644 index 000000000..7c3bb91f8 --- /dev/null +++ b/lib/cryptoexchange/exchanges/bitalong/services/trades.rb @@ -0,0 +1,32 @@ +module Cryptoexchange::Exchanges + module Bitalong + module Services + class Trades < Cryptoexchange::Services::Market + def fetch(market_pair) + output = super(ticker_url(market_pair)) + adapt(output, market_pair) + end + + def ticker_url(market_pair) + "#{Cryptoexchange::Exchanges::Bitalong::Market::API_URL}/index/tradeHistory/#{market_pair.base.downcase}_#{market_pair.target.downcase}" + end + + def adapt(output, market_pair) + output['data'].collect do |trade| + tr = Cryptoexchange::Models::Trade.new + tr.trade_id = trade['tradeID'] + tr.base = market_pair.base + tr.target = market_pair.target + tr.market = Bitalong::Market::NAME + tr.type = trade['type'] + tr.price = trade['rate'] + tr.amount = trade['amount'] + tr.timestamp = DateTime.parse(trade['date']).to_time.to_i + tr.payload = trade + tr + end + end + end + end + end +end diff --git a/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_order_book.yml b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_order_book.yml new file mode 100644 index 000000000..c19b2b424 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_order_book.yml @@ -0,0 +1,51 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bitalong.com/api/index/orderBook/btc_usdt + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - www.bitalong.com + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 28 Jan 2019 15:54:38 GMT + Content-Type: + - text/html;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + Set-Cookie: + - __cfduid=d6c90a9bc937bdc09afc403d231ae5f131548690878; expires=Tue, 28-Jan-20 + 15:54:38 GMT; path=/; domain=.bitalong.com; HttpOnly; Secure + Vary: + - Accept-Encoding + X-Powered-By: + - PHP/7.1.21 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Headers: + - X-Requested-With,X_Requested_With,TOKEN,ID + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a04a385e971a9ae-SIN + body: + encoding: UTF-8 + string: '{"result":"true","asks":[["3449.39","0.0020"],["3447.54","0.0179"],["3445.58","0.0108"],["3444.47","0.6378"],["3443.57","0.3066"],["3442.51","0.3070"],["3442.23","0.2650"],["3441.57","0.1118"],["3441.14","0.1683"],["3427.38","0.0017"],["3426.81","0.1191"],["3426.24","0.0010"]],"bids":[["3412.49","0.1192"],["3411.92","0.1192"],["3411.35","0.1199"],["3404.78","0.0117"],["3404.20","0.0319"],["3402.98","0.0448"],["3401.25","0.0856"],["3400.52","0.1372"],["3399.86","0.1390"],["3397.96","0.0046"],["3397.40","0.0589"],["3397.23","0.0521"]]}' + http_version: + recorded_at: Mon, 28 Jan 2019 15:54:38 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_pairs.yml b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_pairs.yml new file mode 100644 index 000000000..cd93b9b66 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_pairs.yml @@ -0,0 +1,51 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bitalong.com/api/index/pairs + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - www.bitalong.com + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Sun, 27 Jan 2019 15:51:54 GMT + Content-Type: + - text/html;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + Set-Cookie: + - __cfduid=d3ac985e518c0b8bbd924f07d191b66601548604313; expires=Mon, 27-Jan-20 + 15:51:53 GMT; path=/; domain=.bitalong.com; HttpOnly; Secure + Vary: + - Accept-Encoding + X-Powered-By: + - PHP/7.1.21 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Headers: + - X-Requested-With,X_Requested_With,TOKEN,ID + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 49fc62219e62c36f-SIN + body: + encoding: UTF-8 + string: '["debb_usdt","btc_usdt","bch_usdt","ltc_usdt","eulo_usdt","eth_usdt","etc_usdt","zec_usdt","xmr_usdt","dash_usdt","doge_usdt","qtum_usdt","eos_usdt","ae_usdt","zil_usdt","btm_usdt","bchsv_usdt","ae_btc","zil_btc","pivx_btc","rvn_btc","xhv_btc","bchsv_btc","dero_btc","sumo_btc","ltc_btc","loki_btc","bch_btc","eth_btc","tube_btc","zec_btc","suqa_btc","xmr_btc","dash_btc","doge_btc","qtum_btc","eos_btc","etn_btc","ltc_eth","xmr_eth","dash_eth","zec_eth","ae_eth","eos_eth","zil_eth","pivx_eth","trtl_ltc"]' + http_version: + recorded_at: Sun, 27 Jan 2019 15:51:54 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_ticker.yml b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_ticker.yml new file mode 100644 index 000000000..4cdf40bf7 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_ticker.yml @@ -0,0 +1,51 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bitalong.com/api/index/tickers + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - www.bitalong.com + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Sun, 27 Jan 2019 16:02:25 GMT + Content-Type: + - text/html;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + Set-Cookie: + - __cfduid=d62036ffb01b485e266530b78c4179ca81548604945; expires=Mon, 27-Jan-20 + 16:02:25 GMT; path=/; domain=.bitalong.com; HttpOnly; Secure + Vary: + - Accept-Encoding + X-Powered-By: + - PHP/7.1.21 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Headers: + - X-Requested-With,X_Requested_With,TOKEN,ID + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 49fc718eda0da9f0-SIN + body: + encoding: UTF-8 + string: '{"debb_usdt":{"result":"true","last":"0.0000","lowestAsk":"0.0000","highestBid":"0.0000","percentChange":"0.00","baseVolume":"0.0000","quoteVolume":"0.0000","high24hr":"0.0000","low24hr":"0.0000"},"btc_usdt":{"result":"true","last":"3549.65","lowestAsk":"3575.42","highestBid":"3537.22","percentChange":"-0.17","baseVolume":"1023.52","quoteVolume":"3625961.40","high24hr":"3594.80","low24hr":"3502.43"},"bch_usdt":{"result":"true","last":"122.13","lowestAsk":"122.41","highestBid":"121.52","percentChange":"-2.81","baseVolume":"9474.74","quoteVolume":"1172140.03","high24hr":"127.07","low24hr":"118.91"},"ltc_usdt":{"result":"true","last":"32.2956","lowestAsk":"32.5126","highestBid":"32.1794","percentChange":"-2.09","baseVolume":"50812.4248","quoteVolume":"1667939.8049","high24hr":"33.2761","low24hr":"31.6707"},"eulo_usdt":{"result":"true","last":"0.012699","lowestAsk":"0.012801","highestBid":"0.012697","percentChange":"-1.49","baseVolume":"87801781.632718","quoteVolume":"1126219.779692","high24hr":"0.012992","low24hr":"0.012680"},"eth_usdt":{"result":"true","last":"113.1351","lowestAsk":"113.5956","highestBid":"113.0896","percentChange":"-1.94","baseVolume":"11728.3660","quoteVolume":"1348250.6929","high24hr":"116.7318","low24hr":"111.8610"},"etc_usdt":{"result":"true","last":"4.1853","lowestAsk":"4.2003","highestBid":"4.1795","percentChange":"-2.46","baseVolume":"222234.4520","quoteVolume":"945863.7627","high24hr":"4.3334","low24hr":"4.1462"},"zec_usdt":{"result":"true","last":"51.0408","lowestAsk":"51.2623","highestBid":"51.0078","percentChange":"-1.22","baseVolume":"22030.5374","quoteVolume":"1140443.2108","high24hr":"52.7046","low24hr":"50.2445"},"xmr_usdt":{"result":"true","last":"45.0432","lowestAsk":"45.6286","highestBid":"44.7802","percentChange":"-0.69","baseVolume":"17151.4950","quoteVolume":"779316.5010","high24hr":"45.9083","low24hr":"44.8793"},"dash_usdt":{"result":"true","last":"71.2323","lowestAsk":"71.3925","highestBid":"71.0657","percentChange":"-1.71","baseVolume":"13781.5904","quoteVolume":"997891.5618","high24hr":"74.0917","low24hr":"69.3501"},"doge_usdt":{"result":"true","last":"0.001973","lowestAsk":"0.001999","highestBid":"0.001965","percentChange":"-0.65","baseVolume":"289078899.747500","quoteVolume":"570364.952891","high24hr":"0.001998","low24hr":"0.001966"},"qtum_usdt":{"result":"true","last":"1.9831","lowestAsk":"1.9946","highestBid":"1.9827","percentChange":"-3.10","baseVolume":"517009.6930","quoteVolume":"1055058.1495","high24hr":"2.8272","low24hr":"1.9758"},"eos_usdt":{"result":"true","last":"2.3701","lowestAsk":"2.3710","highestBid":"2.3615","percentChange":"-2.11","baseVolume":"1615948.6039","quoteVolume":"3897105.0829","high24hr":"2.4420","low24hr":"2.3202"},"ae_usdt":{"result":"true","last":"0.3905","lowestAsk":"0.3915","highestBid":"0.3891","percentChange":"-5.31","baseVolume":"1304650.4905","quoteVolume":"530054.9151","high24hr":"0.4168","low24hr":"0.3851"},"zil_usdt":{"result":"true","last":"0.022514","lowestAsk":"0.022545","highestBid":"0.022387","percentChange":"1.74","baseVolume":"2571565.199400","quoteVolume":"58110.265186","high24hr":"0.024690","low24hr":"0.020513"},"btm_usdt":{"result":"true","last":"0.0774","lowestAsk":"0.0787","highestBid":"0.0762","percentChange":"-2.03","baseVolume":"1866324.6940","quoteVolume":"146808.7315","high24hr":"0.0801","low24hr":"0.0762"},"bchsv_usdt":{"result":"true","last":"71.96","lowestAsk":"72.05","highestBid":"71.30","percentChange":"-2.68","baseVolume":"58835.89","quoteVolume":"4305838.67","high24hr":"74.24","low24hr":"70.73"},"ae_btc":{"result":"true","last":"0.00010945","lowestAsk":"0.00011124","highestBid":"0.00010840","percentChange":"-5.06","baseVolume":"1340320.00700000","quoteVolume":"152.28106801","high24hr":"0.00011549","low24hr":"0.00010852"},"zil_btc":{"result":"true","last":"0.00000630","lowestAsk":"0.00000634","highestBid":"0.00000626","percentChange":"1.29","baseVolume":"9378462.47360000","quoteVolume":"59.42012371","high24hr":"0.00000684","low24hr":"0.00000595"},"pivx_btc":{"result":"true","last":"0.00020514","lowestAsk":"0.00020700","highestBid":"0.00020400","percentChange":"-4.55","baseVolume":"1431323.90170000","quoteVolume":"302.96500921","high24hr":"0.00022276","low24hr":"0.00019901"},"rvn_btc":{"result":"true","last":"0.00000344","lowestAsk":"0.00000350","highestBid":"0.00000338","percentChange":"-3.10","baseVolume":"66175127.43110000","quoteVolume":"232.57616310","high24hr":"0.00000364","low24hr":"0.00000342"},"xhv_btc":{"result":"true","last":"0.00009228","lowestAsk":"0.00009391","highestBid":"0.00009004","percentChange":"-1.49","baseVolume":"400990.66030000","quoteVolume":"37.91726322","high24hr":"0.00009997","low24hr":"0.00009007"},"bchsv_btc":{"result":"true","last":"0.0201368","lowestAsk":"0.0204038","highestBid":"0.0199001","percentChange":"-2.06","baseVolume":"447.9792000","quoteVolume":"9.2236227","high24hr":"0.0211621","low24hr":"0.0197880"},"dero_btc":{"result":"true","last":"0.00016121","lowestAsk":"0.00016376","highestBid":"0.00015929","percentChange":"-0.65","baseVolume":"1403809.27319039","quoteVolume":"227.06923904","high24hr":"0.00016569","low24hr":"0.00015871"},"sumo_btc":{"result":"true","last":"0.00000703","lowestAsk":"0.00000724","highestBid":"0.00000682","percentChange":"-3.17","baseVolume":"4169510.96370000","quoteVolume":"30.43590872","high24hr":"0.00000780","low24hr":"0.00000650"},"ltc_btc":{"result":"true","last":"0.00910629","lowestAsk":"0.00913703","highestBid":"0.00903105","percentChange":"-2.07","baseVolume":"75976.02989450","quoteVolume":"694.70272168","high24hr":"0.00935639","low24hr":"0.00894946"},"loki_btc":{"result":"true","last":"0.00003988","lowestAsk":"0.00004100","highestBid":"0.00003882","percentChange":"-2.66","baseVolume":"522389.75300000","quoteVolume":"20.84977746","high24hr":"0.00004133","low24hr":"0.00003806"},"bch_btc":{"result":"true","last":"0.0342","lowestAsk":"0.0346","highestBid":"0.0339","percentChange":"-2.56","baseVolume":"4961.3360","quoteVolume":"170.3522","high24hr":"0.0357","low24hr":"0.0339"},"eth_btc":{"result":"true","last":"0.03187510","lowestAsk":"0.03203230","highestBid":"0.03170480","percentChange":"-1.60","baseVolume":"9090.42840000","quoteVolume":"294.27499015","high24hr":"0.03272651","low24hr":"0.03173349"},"tube_btc":{"result":"true","last":"0.00000721","lowestAsk":"0.00000738","highestBid":"0.00000707","percentChange":"3.15","baseVolume":"1989067.30490000","quoteVolume":"14.39440898","high24hr":"0.00000773","low24hr":"0.00000693"},"zec_btc":{"result":"true","last":"0.01430278","lowestAsk":"0.01444487","highestBid":"0.01428522","percentChange":"-1.97","baseVolume":"13990.59620000","quoteVolume":"202.82502867","high24hr":"0.01468865","low24hr":"0.01423096"},"suqa_btc":{"result":"true","last":"0.00000047","lowestAsk":"0.00000048","highestBid":"0.00000046","percentChange":"0.00","baseVolume":"2316106.81820000","quoteVolume":"1.07842042","high24hr":"0.00000048","low24hr":"0.00000040"},"xmr_btc":{"result":"true","last":"0.01280263","lowestAsk":"0.01294986","highestBid":"0.01256242","percentChange":"0.53","baseVolume":"65656.86220000","quoteVolume":"838.14474142","high24hr":"0.01285549","low24hr":"0.01259363"},"dash_btc":{"result":"true","last":"0.02002122","lowestAsk":"0.02014221","highestBid":"0.01991393","percentChange":"-1.42","baseVolume":"14267.00420000","quoteVolume":"289.15070471","high24hr":"0.02082391","low24hr":"0.01953919"},"doge_btc":{"result":"true","last":"0.00000056","lowestAsk":"0.00000057","highestBid":"0.00000055","percentChange":"0.00","baseVolume":"1272978341.13829994","quoteVolume":"714.70867726","high24hr":"0.00000057","low24hr":"0.00000055"},"qtum_btc":{"result":"true","last":"0.00056074","lowestAsk":"0.00056180","highestBid":"0.00055521","percentChange":"-3.13","baseVolume":"281918.33750000","quoteVolume":"161.50215014","high24hr":"0.00058517","low24hr":"0.00055352"},"eos_btc":{"result":"true","last":"0.00066507","lowestAsk":"0.00066853","highestBid":"0.00066148","percentChange":"-1.87","baseVolume":"242294.35654027","quoteVolume":"163.23631076","high24hr":"0.00070946","low24hr":"0.00064727"},"etn_btc":{"result":"true","last":"0.00000193","lowestAsk":"0.00000195","highestBid":"0.00000190","percentChange":"-0.52","baseVolume":"20802003.34970000","quoteVolume":"39.99510814","high24hr":"0.00000196","low24hr":"0.00000186"},"ltc_eth":{"result":"true","last":"0.285064","lowestAsk":"0.286731","highestBid":"0.283107","percentChange":"-0.98","baseVolume":"26706.629200","quoteVolume":"7629.913787","high24hr":"0.288986","low24hr":"0.279691"},"xmr_eth":{"result":"true","last":"0.403256","lowestAsk":"0.405015","highestBid":"0.400388","percentChange":"2.28","baseVolume":"21038.435400","quoteVolume":"8332.733554","high24hr":"0.403256","low24hr":"0.386215"},"dash_eth":{"result":"true","last":"0.625191","lowestAsk":"0.628996","highestBid":"0.621069","percentChange":"-0.56","baseVolume":"10686.500700","quoteVolume":"6705.734602","high24hr":"0.636415","low24hr":"0.612019"},"zec_eth":{"result":"true","last":"0.450453","lowestAsk":"0.452300","highestBid":"0.447024","percentChange":"0.81","baseVolume":"11949.061200","quoteVolume":"5379.526667","high24hr":"0.457295","low24hr":"0.441967"},"ae_eth":{"result":"true","last":"0.003441","lowestAsk":"0.003461","highestBid":"0.003416","percentChange":"-2.63","baseVolume":"1043317.245800","quoteVolume":"3661.827160","high24hr":"0.003569","low24hr":"0.003391"},"eos_eth":{"result":"true","last":"0.020972","lowestAsk":"0.020997","highestBid":"0.020748","percentChange":"-0.10","baseVolume":"262489.587800","quoteVolume":"5491.322498","high24hr":"0.021381","low24hr":"0.020297"},"zil_eth":{"result":"true","last":"0.00019789","lowestAsk":"0.00019900","highestBid":"0.00019600","percentChange":"3.75","baseVolume":"2716707.34280000","quoteVolume":"535.39349769","high24hr":"0.00020855","low24hr":"0.00018890"},"pivx_eth":{"result":"true","last":"0.006440","lowestAsk":"0.006493","highestBid":"0.006407","percentChange":"-2.81","baseVolume":"1215834.579700","quoteVolume":"7959.203677","high24hr":"0.006756","low24hr":"0.006292"},"trtl_ltc":{"result":"true","last":"0.00000402","lowestAsk":"0.00000408","highestBid":"0.00000397","percentChange":"-6.51","baseVolume":"211621330.51071456","quoteVolume":"872.21978713","high24hr":"0.00000447","low24hr":"0.00000385"}}' + http_version: + recorded_at: Sun, 27 Jan 2019 16:02:25 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_trade.yml b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_trade.yml new file mode 100644 index 000000000..b8a3c5543 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Bitalong/integration_specs_fetch_trade.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://www.bitalong.com/api/index/tradeHistory/btc_usdt + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - www.bitalong.com + User-Agent: + - http.rb/3.0.0 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 28 Jan 2019 15:55:09 GMT + Content-Type: + - text/html;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + Set-Cookie: + - __cfduid=d8563fa5e9ef8aec6f4a222524ba6be611548690909; expires=Tue, 28-Jan-20 + 15:55:09 GMT; path=/; domain=.bitalong.com; HttpOnly; Secure + Vary: + - Accept-Encoding + X-Powered-By: + - PHP/7.1.21 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Headers: + - X-Requested-With,X_Requested_With,TOKEN,ID + Expect-Ct: + - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + Server: + - cloudflare + Cf-Ray: + - 4a04a4455d89c3b0-SIN + body: + encoding: UTF-8 + string: '{"result":"true","data":[{"tradeID":"38624473","date":"2019-01-28 23:55:08","type":"buy","rate":"3421.88","amount":0.0996,"total":340.819248},{"tradeID":"38624444","date":"2019-01-28 + 23:54:58","type":"buy","rate":"3419.68","amount":0.0009,"total":3.077712},{"tradeID":"38624427","date":"2019-01-28 + 23:54:50","type":"buy","rate":"3413.31","amount":0.0812,"total":277.160772},{"tradeID":"38624390","date":"2019-01-28 + 23:54:35","type":"buy","rate":"3422.80","amount":0.0056,"total":19.16768},{"tradeID":"38624345","date":"2019-01-28 + 23:54:21","type":"buy","rate":"3425.00","amount":0.4235,"total":1450.4875},{"tradeID":"38624336","date":"2019-01-28 + 23:54:18","type":"sell","rate":"3416.34","amount":0.001,"total":3.41634},{"tradeID":"38624301","date":"2019-01-28 + 23:54:03","type":"buy","rate":"3415.32","amount":0.0284,"total":96.995088},{"tradeID":"38624232","date":"2019-01-28 + 23:53:38","type":"buy","rate":"3412.97","amount":0.1056,"total":360.409632},{"tradeID":"38624188","date":"2019-01-28 + 23:53:20","type":"buy","rate":"3420.10","amount":0.008,"total":27.3608},{"tradeID":"38624161","date":"2019-01-28 + 23:53:07","type":"buy","rate":"3414.71","amount":0.03,"total":102.4413},{"tradeID":"38624100","date":"2019-01-28 + 23:52:46","type":"sell","rate":"3410.83","amount":0.1829,"total":623.840807},{"tradeID":"38624021","date":"2019-01-28 + 23:52:15","type":"sell","rate":"3414.72","amount":0.1401,"total":478.402272},{"tradeID":"38623961","date":"2019-01-28 + 23:51:46","type":"buy","rate":"3404.87","amount":0.0001,"total":0.340487},{"tradeID":"38623902","date":"2019-01-28 + 23:51:26","type":"buy","rate":"3415.16","amount":0.1579,"total":539.253764},{"tradeID":"38623852","date":"2019-01-28 + 23:51:04","type":"sell","rate":"3401.88","amount":0.02,"total":68.0376},{"tradeID":"38623833","date":"2019-01-28 + 23:50:57","type":"sell","rate":"3411.51","amount":0.0005,"total":1.705755},{"tradeID":"38623826","date":"2019-01-28 + 23:50:56","type":"sell","rate":"3407.46","amount":0.0024,"total":8.177904},{"tradeID":"38623811","date":"2019-01-28 + 23:50:52","type":"buy","rate":"3414.30","amount":0.21,"total":717.003},{"tradeID":"38623769","date":"2019-01-28 + 23:50:34","type":"buy","rate":"3407.68","amount":0.0057,"total":19.423776},{"tradeID":"38623732","date":"2019-01-28 + 23:50:17","type":"buy","rate":"3402.90","amount":0.0004,"total":1.36116},{"tradeID":"38623701","date":"2019-01-28 + 23:50:02","type":"sell","rate":"3404.10","amount":0.0061,"total":20.76501},{"tradeID":"38623657","date":"2019-01-28 + 23:49:42","type":"buy","rate":"3411.19","amount":0.199,"total":678.82681},{"tradeID":"38623623","date":"2019-01-28 + 23:49:26","type":"buy","rate":"3402.35","amount":0.7729,"total":2629.676315},{"tradeID":"38623572","date":"2019-01-28 + 23:49:05","type":"sell","rate":"3401.67","amount":0.026,"total":88.44342},{"tradeID":"38623511","date":"2019-01-28 + 23:48:39","type":"sell","rate":"3401.13","amount":0.0058,"total":19.726554},{"tradeID":"38623472","date":"2019-01-28 + 23:48:23","type":"buy","rate":"3401.54","amount":0.0901,"total":306.478754},{"tradeID":"38623437","date":"2019-01-28 + 23:48:09","type":"buy","rate":"3410.10","amount":3.9411,"total":13439.54511},{"tradeID":"38623345","date":"2019-01-28 + 23:47:36","type":"buy","rate":"3402.61","amount":0.0009,"total":3.062349},{"tradeID":"38623307","date":"2019-01-28 + 23:47:19","type":"buy","rate":"3403.02","amount":0.0096,"total":32.668992},{"tradeID":"38623268","date":"2019-01-28 + 23:47:01","type":"buy","rate":"3401.43","amount":0.221,"total":751.71603},{"tradeID":"38623223","date":"2019-01-28 + 23:46:47","type":"sell","rate":"3401.85","amount":0.0009,"total":3.061665},{"tradeID":"38623167","date":"2019-01-28 + 23:46:24","type":"sell","rate":"3399.69","amount":0.0418,"total":142.107042},{"tradeID":"38623109","date":"2019-01-28 + 23:45:58","type":"sell","rate":"3401.34","amount":0.234,"total":795.91356},{"tradeID":"38623073","date":"2019-01-28 + 23:45:38","type":"sell","rate":"3403.16","amount":0.0009,"total":3.062844},{"tradeID":"38622990","date":"2019-01-28 + 23:45:02","type":"sell","rate":"3402.64","amount":0.0004,"total":1.361056},{"tradeID":"38622943","date":"2019-01-28 + 23:44:38","type":"sell","rate":"3398.31","amount":0.0152,"total":51.654312},{"tradeID":"38622800","date":"2019-01-28 + 23:43:33","type":"buy","rate":"3404.28","amount":0.0005,"total":1.70214},{"tradeID":"38622765","date":"2019-01-28 + 23:43:19","type":"buy","rate":"3399.02","amount":0.2034,"total":691.360668},{"tradeID":"38622716","date":"2019-01-28 + 23:43:01","type":"buy","rate":"3401.38","amount":0.0009,"total":3.061242},{"tradeID":"38622646","date":"2019-01-28 + 23:42:32","type":"buy","rate":"3397.17","amount":0.0009,"total":3.057453},{"tradeID":"38622585","date":"2019-01-28 + 23:42:03","type":"buy","rate":"3390.44","amount":0.0005,"total":1.69522},{"tradeID":"38622521","date":"2019-01-28 + 23:41:32","type":"sell","rate":"3396.70","amount":0.0087,"total":29.55129},{"tradeID":"38622432","date":"2019-01-28 + 23:40:56","type":"buy","rate":"3389.55","amount":0.43,"total":1457.5065},{"tradeID":"38622388","date":"2019-01-28 + 23:40:36","type":"sell","rate":"3391.57","amount":0.0776,"total":263.185832},{"tradeID":"38622352","date":"2019-01-28 + 23:40:22","type":"buy","rate":"3389.59","amount":0.2,"total":677.918},{"tradeID":"38622341","date":"2019-01-28 + 23:40:14","type":"sell","rate":"3394.06","amount":0.46,"total":1561.2676},{"tradeID":"38622330","date":"2019-01-28 + 23:40:06","type":"buy","rate":"3390.72","amount":0.445,"total":1508.8704},{"tradeID":"38622318","date":"2019-01-28 + 23:40:03","type":"buy","rate":"3394.21","amount":0.184,"total":624.53464},{"tradeID":"38622282","date":"2019-01-28 + 23:39:52","type":"sell","rate":"3400.64","amount":0.3839,"total":1305.505696},{"tradeID":"38622244","date":"2019-01-28 + 23:39:39","type":"buy","rate":"3396.69","amount":0.0009,"total":3.057021},{"tradeID":"38622199","date":"2019-01-28 + 23:39:19","type":"sell","rate":"3393.59","amount":0.032,"total":108.59488},{"tradeID":"38622166","date":"2019-01-28 + 23:39:07","type":"sell","rate":"3397.71","amount":0.2584,"total":877.968264},{"tradeID":"38622121","date":"2019-01-28 + 23:38:48","type":"sell","rate":"3403.48","amount":0.0068,"total":23.143664},{"tradeID":"38622078","date":"2019-01-28 + 23:38:34","type":"buy","rate":"3394.22","amount":0.0154,"total":52.270988},{"tradeID":"38622041","date":"2019-01-28 + 23:38:18","type":"buy","rate":"3391.66","amount":0.1114,"total":377.830924},{"tradeID":"38622015","date":"2019-01-28 + 23:38:07","type":"buy","rate":"3396.80","amount":0.1489,"total":505.78352},{"tradeID":"38621991","date":"2019-01-28 + 23:37:56","type":"sell","rate":"3399.61","amount":0.0009,"total":3.059649},{"tradeID":"38621949","date":"2019-01-28 + 23:37:30","type":"buy","rate":"3396.99","amount":0.0055,"total":18.683445},{"tradeID":"38621911","date":"2019-01-28 + 23:37:18","type":"buy","rate":"3399.44","amount":0.115,"total":390.9356},{"tradeID":"38621876","date":"2019-01-28 + 23:37:04","type":"sell","rate":"3400.66","amount":0.0022,"total":7.481452},{"tradeID":"38621832","date":"2019-01-28 + 23:36:51","type":"buy","rate":"3402.71","amount":0.0293,"total":99.699403},{"tradeID":"38621787","date":"2019-01-28 + 23:36:33","type":"buy","rate":"3398.44","amount":0.1158,"total":393.539352},{"tradeID":"38621740","date":"2019-01-28 + 23:36:10","type":"buy","rate":"3403.41","amount":0.001,"total":3.40341},{"tradeID":"38621646","date":"2019-01-28 + 23:35:42","type":"buy","rate":"3400.86","amount":0.0049,"total":16.664214},{"tradeID":"38621597","date":"2019-01-28 + 23:35:17","type":"sell","rate":"3396.87","amount":0.0213,"total":72.353331},{"tradeID":"38621590","date":"2019-01-28 + 23:35:10","type":"buy","rate":"3406.59","amount":0.0009,"total":3.065931},{"tradeID":"38621534","date":"2019-01-28 + 23:34:48","type":"buy","rate":"3401.18","amount":0.0433,"total":147.271094},{"tradeID":"38621480","date":"2019-01-28 + 23:34:24","type":"sell","rate":"3400.66","amount":0.0843,"total":286.675638},{"tradeID":"38621451","date":"2019-01-28 + 23:34:08","type":"buy","rate":"3400.52","amount":0.0542,"total":184.308184},{"tradeID":"38621383","date":"2019-01-28 + 23:33:46","type":"buy","rate":"3402.56","amount":2.0958,"total":7131.085248},{"tradeID":"38621376","date":"2019-01-28 + 23:33:41","type":"buy","rate":"3398.24","amount":0.011,"total":37.38064},{"tradeID":"38621315","date":"2019-01-28 + 23:33:09","type":"buy","rate":"3411.86","amount":2.2278,"total":7600.941708},{"tradeID":"38621307","date":"2019-01-28 + 23:33:04","type":"buy","rate":"3408.44","amount":0.02,"total":68.1688},{"tradeID":"38621270","date":"2019-01-28 + 23:32:46","type":"sell","rate":"3415.55","amount":0.0143,"total":48.842365},{"tradeID":"38621218","date":"2019-01-28 + 23:32:27","type":"buy","rate":"3417.73","amount":0.0009,"total":3.075957},{"tradeID":"38621210","date":"2019-01-28 + 23:32:22","type":"sell","rate":"3406.67","amount":0.85,"total":2895.6695},{"tradeID":"38621179","date":"2019-01-28 + 23:32:07","type":"buy","rate":"3418.28","amount":0.4614,"total":1577.194392},{"tradeID":"38621175","date":"2019-01-28 + 23:32:04","type":"sell","rate":"3405.58","amount":0.046,"total":156.65668},{"tradeID":"38621172","date":"2019-01-28 + 23:32:03","type":"buy","rate":"3407.85","amount":0.4,"total":1363.14},{"tradeID":"38621116","date":"2019-01-28 + 23:31:42","type":"sell","rate":"3410.34","amount":0.1213,"total":413.674242}],"elapsed":"0.0296ms"}' + http_version: + recorded_at: Mon, 28 Jan 2019 15:55:09 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/exchanges/bitalong/integration/market_spec.rb b/spec/exchanges/bitalong/integration/market_spec.rb new file mode 100644 index 000000000..db0842941 --- /dev/null +++ b/spec/exchanges/bitalong/integration/market_spec.rb @@ -0,0 +1,72 @@ +require 'spec_helper' + +RSpec.describe 'Bitalong integration specs' do + let(:client) { Cryptoexchange::Client.new } + let(:btc_usdt_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'USDT', market: 'bitalong') } + + it 'has trade_page_url' do + trade_page_url = client.trade_page_url btc_usdt_pair.market, base: btc_usdt_pair.base, target: btc_usdt_pair.target + expect(trade_page_url).to eq "https://www.bitalong.com/trade/index/market/btc_usdt" + end + + it 'fetch pairs' do + pairs = client.pairs('bitalong') + expect(pairs).not_to be_empty + + pair = pairs.first + expect(pair.base).to_not be nil + expect(pair.target).to_not be nil + expect(pair.market).to eq 'bitalong' + end + + it 'fetch ticker' do + ticker = client.ticker(btc_usdt_pair) + + expect(ticker.base).to eq 'BTC' + expect(ticker.target).to eq 'USDT' + expect(ticker.market).to eq 'bitalong' + expect(ticker.last).to be_a Numeric + expect(ticker.low).to be_a Numeric + expect(ticker.high).to be_a Numeric + expect(ticker.bid).to be_a Numeric + expect(ticker.ask).to be_a Numeric + expect(ticker.change).to be_a Numeric + expect(ticker.volume).to be_a Numeric + expect(ticker.timestamp).to be nil + expect(ticker.payload).to_not be nil + end + + it 'fetch order book' do + order_book = client.order_book(btc_usdt_pair) + + expect(order_book.base).to eq 'BTC' + expect(order_book.target).to eq 'USDT' + expect(order_book.market).to eq 'bitalong' + expect(order_book.asks).to_not be_empty + expect(order_book.bids).to_not be_empty + expect(order_book.asks.first.price).to_not be_nil + expect(order_book.bids.first.amount).to_not be_nil + expect(order_book.bids.first.timestamp).to be_nil + expect(order_book.asks.count).to be > 5 + expect(order_book.bids.count).to be > 5 + expect(order_book.timestamp).to be nil + expect(order_book.payload).to_not be nil + end + + it 'fetch trade' do + trades = client.trades(btc_usdt_pair) + trade = trades.sample + + expect(trades).to_not be_empty + expect(trade.base).to eq 'BTC' + expect(trade.target).to eq 'USDT' + expect(trade.market).to eq 'bitalong' + expect(trade.trade_id).to_not be_nil + expect(['buy', 'sell']).to include trade.type + expect(trade.price).to_not be_nil + expect(trade.amount).to_not be_nil + expect(trade.timestamp).to be_a Numeric + expect(2000..Date.today.year).to include(Time.at(trade.timestamp).year) + expect(trade.payload).to_not be nil + end +end diff --git a/spec/exchanges/bitalong/market_spec.rb b/spec/exchanges/bitalong/market_spec.rb new file mode 100644 index 000000000..771cf30cd --- /dev/null +++ b/spec/exchanges/bitalong/market_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' + +RSpec.describe Cryptoexchange::Exchanges::Bitalong::Market do + it { expect(described_class::NAME).to eq 'bitalong' } + it { expect(described_class::API_URL).to eq 'https://www.bitalong.com/api' } +end From e033a9c983b82c700fcc0310c10c69e3e07716a1 Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 2 May 2019 11:46:36 +0800 Subject: [PATCH 5/7] update kuna exchange pair --- lib/cryptoexchange/exchanges/kuna/kuna.yml | 4 ++++ lib/cryptoexchange/exchanges/kuna/services/market.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/cryptoexchange/exchanges/kuna/kuna.yml b/lib/cryptoexchange/exchanges/kuna/kuna.yml index 3b4231494..79c0d2edf 100644 --- a/lib/cryptoexchange/exchanges/kuna/kuna.yml +++ b/lib/cryptoexchange/exchanges/kuna/kuna.yml @@ -67,3 +67,7 @@ :target: ARUB - :base: BTC :target: USDT + - :base: BTC + :target: RUB + - :base: USDT + :target: RUB diff --git a/lib/cryptoexchange/exchanges/kuna/services/market.rb b/lib/cryptoexchange/exchanges/kuna/services/market.rb index 9615bd243..0923954ad 100644 --- a/lib/cryptoexchange/exchanges/kuna/services/market.rb +++ b/lib/cryptoexchange/exchanges/kuna/services/market.rb @@ -1,3 +1,4 @@ +require 'pry' module Cryptoexchange::Exchanges module Kuna module Services @@ -9,6 +10,7 @@ def supports_individual_ticker_query? end def fetch(market_pair) + binding.pry output = super(ticker_url(market_pair)) adapt(output, market_pair) end From d7eac887f8646a90c5fec4aa81907ab65d3c64e3 Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 2 May 2019 11:48:10 +0800 Subject: [PATCH 6/7] remove pry --- lib/cryptoexchange/exchanges/kuna/services/market.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/cryptoexchange/exchanges/kuna/services/market.rb b/lib/cryptoexchange/exchanges/kuna/services/market.rb index 0923954ad..9615bd243 100644 --- a/lib/cryptoexchange/exchanges/kuna/services/market.rb +++ b/lib/cryptoexchange/exchanges/kuna/services/market.rb @@ -1,4 +1,3 @@ -require 'pry' module Cryptoexchange::Exchanges module Kuna module Services @@ -10,7 +9,6 @@ def supports_individual_ticker_query? end def fetch(market_pair) - binding.pry output = super(ticker_url(market_pair)) adapt(output, market_pair) end From c69abfa4c8801e8e8e04a56201a2ae260efdc7ff Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 2 May 2019 12:22:25 +0800 Subject: [PATCH 7/7] omgfin exchange implementation --- lib/cryptoexchange/exchanges/omgfin/market.rb | 12 ++++ .../exchanges/omgfin/services/market.rb | 50 +++++++++++++++++ .../exchanges/omgfin/services/pairs.rb | 28 ++++++++++ .../Omgfin/integration_specs_fetch_pairs.yml | 56 +++++++++++++++++++ .../Omgfin/integration_specs_fetch_ticker.yml | 56 +++++++++++++++++++ .../omgfin/integration/market_spec.rb | 39 +++++++++++++ spec/exchanges/omgfin/market_spec.rb | 6 ++ 7 files changed, 247 insertions(+) create mode 100644 lib/cryptoexchange/exchanges/omgfin/market.rb create mode 100644 lib/cryptoexchange/exchanges/omgfin/services/market.rb create mode 100644 lib/cryptoexchange/exchanges/omgfin/services/pairs.rb create mode 100644 spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_pairs.yml create mode 100644 spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_ticker.yml create mode 100644 spec/exchanges/omgfin/integration/market_spec.rb create mode 100644 spec/exchanges/omgfin/market_spec.rb diff --git a/lib/cryptoexchange/exchanges/omgfin/market.rb b/lib/cryptoexchange/exchanges/omgfin/market.rb new file mode 100644 index 000000000..d70787224 --- /dev/null +++ b/lib/cryptoexchange/exchanges/omgfin/market.rb @@ -0,0 +1,12 @@ +module Cryptoexchange::Exchanges + module Omgfin + class Market < Cryptoexchange::Models::Market + NAME = 'omgfin' + API_URL = 'https://omgfin.com/api/v1/ticker/24hr' + + def self.trade_page_url(args={}) + "https://omgfin.com/exchange/trade/market/#{args[:base]}#{args[:target]}" + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/omgfin/services/market.rb b/lib/cryptoexchange/exchanges/omgfin/services/market.rb new file mode 100644 index 000000000..355462721 --- /dev/null +++ b/lib/cryptoexchange/exchanges/omgfin/services/market.rb @@ -0,0 +1,50 @@ +module Cryptoexchange::Exchanges + module Omgfin + module Services + class Market < Cryptoexchange::Services::Market + class << self + def supports_individual_ticker_query? + false + end + end + + def fetch + output = super(ticker_url) + adapt_all(output) + end + + def ticker_url + "#{Cryptoexchange::Exchanges::Omgfin::Market::API_URL}" + end + + def adapt_all(output) + output.map do |pair| + base, target = pair['symbol'].split('_') + market_pair = Cryptoexchange::Models::MarketPair.new( + base: base, + target: target, + market: Omgfin::Market::NAME + ) + adapt(market_pair, pair) + end + end + + def adapt(market_pair, output) + ticker = Cryptoexchange::Models::Ticker.new + ticker.base = market_pair.base + ticker.target = market_pair.target + ticker.market = Omgfin::Market::NAME + ticker.last = NumericHelper.to_d(output['lastPrice'].to_f) + ticker.bid = NumericHelper.to_d(output['bidPrice'].to_f) + ticker.ask = NumericHelper.to_d(output['askPrice'].to_f) + ticker.high = NumericHelper.to_d(output['highPrice'].to_f) + ticker.low = NumericHelper.to_d(output['lowPrice'].to_f) + ticker.volume = NumericHelper.to_d(output['volume']).to_f + ticker.timestamp = nil + ticker.payload = output + ticker + end + end + end + end +end diff --git a/lib/cryptoexchange/exchanges/omgfin/services/pairs.rb b/lib/cryptoexchange/exchanges/omgfin/services/pairs.rb new file mode 100644 index 000000000..4aa4d2346 --- /dev/null +++ b/lib/cryptoexchange/exchanges/omgfin/services/pairs.rb @@ -0,0 +1,28 @@ +module Cryptoexchange::Exchanges + module Omgfin + module Services + class Pairs < Cryptoexchange::Services::Pairs + PAIRS_URL = "#{Cryptoexchange::Exchanges::Omgfin::Market::API_URL}" + + def fetch + output = super + adapt(output) + end + + def adapt(output) + market_pairs = [] + output.each do |pair| + base, target = pair["symbol"].split('_') + market_pairs << + Cryptoexchange::Models::MarketPair.new( + base: base, + target: target, + market: Omgfin::Market::NAME + ) + end + market_pairs + end + end + end + end +end diff --git a/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_pairs.yml b/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_pairs.yml new file mode 100644 index 000000000..d290697a1 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_pairs.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://omgfin.com/api/v1/ticker/24hr + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - omgfin.com + User-Agent: + - http.rb/5.0.0.pre + response: + status: + code: 200 + message: OK + headers: + Server: + - Sucuri/Cloudproxy + Date: + - Thu, 02 May 2019 04:21:55 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + X-Sucuri-Id: + - '18014' + Vary: + - Accept-Encoding + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Nginx-Cache-Status: + - BYPASS + X-Server-Powered-By: + - Omgfin + Referrer-Policy: + - no-referrer-when-downgrade + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Sucuri-Cache: + - HIT + body: + encoding: UTF-8 + string: '[{"symbol":"BAT_BTC","openPrice":"0.000072760000000000","lastPrice":"0.000072040000000000","priceChange":"-0.000000720000000000","priceChangePercent":"-0.9994447529150471960022","bidPrice":"0.000070620000000000","askPrice":"0.000072630000000000","highPrice":"0.000073250000000000","lowPrice":"0.000070390000000000","volume":"52109.400000000000000000","quoteVolume":"3.728623386000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"50"},{"symbol":"BAT_ETH","openPrice":"0.002402150000000000","lastPrice":"0.002376200000000000","priceChange":"-0.000025950000000000","priceChangePercent":"-1.0920797912633616698931","bidPrice":"0.002359310000000000","askPrice":"0.002400570000000000","highPrice":"0.002450570000000000","lowPrice":"0.002352070000000000","volume":"336788.600000000000000000","quoteVolume":"807.198930048000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"76"},{"symbol":"BAT_UQC","openPrice":"2.858744110000000000","lastPrice":"3.120178670000000000","priceChange":"0.261434560000000000","priceChangePercent":"8.3788329980475124522276","bidPrice":"3.130417720000000000","askPrice":"3.245076620000000000","highPrice":"3.325063010000000000","lowPrice":"2.767457230000000000","volume":"181273.320000000000000000","quoteVolume":"558416.297470947100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"48"},{"symbol":"BAT_USDT","openPrice":"0.384846400000000000","lastPrice":"0.379940300000000000","priceChange":"-0.004906100000000000","priceChangePercent":"-1.2912818145377050026017","bidPrice":"0.377842900000000000","askPrice":"0.387287000000000000","highPrice":"0.394116520000000000","lowPrice":"0.376830520000000000","volume":"159897.400000000000000000","quoteVolume":"61370.982117944900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"48"},{"symbol":"BCH_BTC","openPrice":"0.041507280000000000","lastPrice":"0.041588410000000000","priceChange":"0.000081130000000000","priceChangePercent":"0.1950783884260061877816","bidPrice":"0.041490050000000000","askPrice":"0.041594210000000000","highPrice":"0.041594030000000000","lowPrice":"0.041503290000000000","volume":"232.490000000000000000","quoteVolume":"9.660271964400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"95"},{"symbol":"BCH_ETH","openPrice":"1.208488310000000000","lastPrice":"1.208475680000000000","priceChange":"-0.000012630000000000","priceChangePercent":"-0.0010451182600546831029","bidPrice":"1.208409700000000000","askPrice":"1.208530560000000000","highPrice":"1.208517350000000000","lowPrice":"1.208422180000000000","volume":"375.270000000000000000","quoteVolume":"453.503565795300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"116"},{"symbol":"BCH_UQC","openPrice":"2053.216370360000000000","lastPrice":"2148.559652950000000000","priceChange":"95.343282590000000000","priceChangePercent":"4.4375441221328180670749","bidPrice":"2143.742326990000000000","askPrice":"2178.900217020000000000","highPrice":"2175.883112950000000000","lowPrice":"2009.708645510000000000","volume":"2.032000000000000000","quoteVolume":"4247.925196118300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"17"},{"symbol":"BCH_USDT","openPrice":"164.885828280000000000","lastPrice":"164.922999890000000000","priceChange":"0.037171610000000000","priceChangePercent":"0.0225387665909501059586","bidPrice":"164.837531970000000000","askPrice":"164.974029380000000000","highPrice":"164.973229770000000000","lowPrice":"164.850110930000000000","volume":"321.810000000000000000","quoteVolume":"53068.861083005500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"130"},{"symbol":"BTC_USDC","openPrice":"5292.288873980000000000","lastPrice":"5323.850892110000000000","priceChange":"31.562018130000000000","priceChangePercent":"0.5928418877541297210972","bidPrice":"5313.276909650000000000","askPrice":"5343.260266770000000000","highPrice":"5341.348446140000000000","lowPrice":"5282.426575880000000000","volume":"457.200000000000000000","quoteVolume":"2431411.233519534000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"110"},{"symbol":"BTC_USDT","openPrice":"5354.508148280000000000","lastPrice":"5383.380529240000000000","priceChange":"28.872380960000000000","priceChangePercent":"0.5363243561026154156407","bidPrice":"5372.418174460000000000","askPrice":"5387.801090620000000000","highPrice":"5387.793160660000000000","lowPrice":"5335.795812960000000000","volume":"966.660000000000000000","quoteVolume":"5180350.915283456800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"790"},{"symbol":"BTT_BTC","openPrice":"0.000000120000000000","lastPrice":"0.000000120000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000002250000000000","askPrice":"0.000002240000000000","highPrice":"0.000000120000000000","lowPrice":"0.000000120000000000","volume":"501357.528000000000000000","quoteVolume":"0.060162903360000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"86"},{"symbol":"BTT_ETH","openPrice":"0.000004040000000000","lastPrice":"0.000004040000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000003990000000000","askPrice":"0.000004160000000000","highPrice":"0.000004130000000000","lowPrice":"0.000003910000000000","volume":"284285.520000000000000000","quoteVolume":"1.142843277400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"BTT_UQC","openPrice":"0.005156020000000000","lastPrice":"0.005273600000000000","priceChange":"0.000117580000000000","priceChangePercent":"2.2295964805825242718447","bidPrice":"0.005235150000000000","askPrice":"0.005639460000000000","highPrice":"0.005603440000000000","lowPrice":"0.004527810000000000","volume":"49609.668000000000000000","quoteVolume":"255.272890081640000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"47"},{"symbol":"BTT_USDT","openPrice":"0.000643950000000000","lastPrice":"0.000649320000000000","priceChange":"0.000005370000000000","priceChangePercent":"0.8270190352984660875993","bidPrice":"0.000647820000000000","askPrice":"0.000665520000000000","highPrice":"0.000657070000000000","lowPrice":"0.000631060000000000","volume":"117495.034000000000000000","quoteVolume":"76.078868691370000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"77"},{"symbol":"ENJ_BTC","openPrice":"0.000028050000000000","lastPrice":"0.000027490000000000","priceChange":"-0.000000560000000000","priceChangePercent":"-2.0371044016005820298290","bidPrice":"0.000027210000000000","askPrice":"0.000027820000000000","highPrice":"0.000028920000000000","lowPrice":"0.000027230000000000","volume":"160514.100000000000000000","quoteVolume":"4.486329366000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"45"},{"symbol":"ENJ_ETH","openPrice":"0.000949590000000000","lastPrice":"0.000913280000000000","priceChange":"-0.000036310000000000","priceChangePercent":"-3.9757796075683251576734","bidPrice":"0.000910550000000000","askPrice":"0.000942700000000000","highPrice":"0.000957200000000000","lowPrice":"0.000913160000000000","volume":"86739.000000000000000000","quoteVolume":"81.262393754000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"33"},{"symbol":"ENJ_UQC","openPrice":"1.142171110000000000","lastPrice":"1.207426580000000000","priceChange":"0.065255470000000000","priceChangePercent":"5.4045083221540476606039","bidPrice":"1.192817230000000000","askPrice":"1.274576110000000000","highPrice":"1.255720400000000000","lowPrice":"1.086065510000000000","volume":"211128.770000000000000000","quoteVolume":"251696.507392010400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"61"},{"symbol":"ENJ_USDT","openPrice":"0.151205510000000000","lastPrice":"0.147961660000000000","priceChange":"-0.003243850000000000","priceChangePercent":"-2.1923584798926965269246","bidPrice":"0.147399250000000000","askPrice":"0.150139020000000000","highPrice":"0.152843350000000000","lowPrice":"0.147049170000000000","volume":"183872.980000000000000000","quoteVolume":"27508.745979431000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"92"},{"symbol":"EOS_BTC","openPrice":"0.000886290000000000","lastPrice":"0.000878020000000000","priceChange":"-0.000008270000000000","priceChangePercent":"-0.9418919842372611102253","bidPrice":"0.000876490000000000","askPrice":"0.000888050000000000","highPrice":"0.000899600000000000","lowPrice":"0.000877140000000000","volume":"243747.190000000000000000","quoteVolume":"215.849263742000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"103"},{"symbol":"EOS_ETH","openPrice":"0.029283270000000000","lastPrice":"0.029619200000000000","priceChange":"0.000335930000000000","priceChangePercent":"1.1341629753673292999136","bidPrice":"0.029381130000000000","askPrice":"0.029892480000000000","highPrice":"0.029861450000000000","lowPrice":"0.029240550000000000","volume":"58671.500000000000000000","quoteVolume":"1735.520560512200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"105"},{"symbol":"EOS_UQC","openPrice":"34.803596950000000000","lastPrice":"38.929148610000000000","priceChange":"4.125551660000000000","priceChangePercent":"10.5975902564184025703510","bidPrice":"38.736793750000000000","askPrice":"40.328940610000000000","highPrice":"40.327096610000000000","lowPrice":"34.174715890000000000","volume":"2400.550000000000000000","quoteVolume":"89410.437100917010000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"79"},{"symbol":"EOS_USDT","openPrice":"4.773775000000000000","lastPrice":"4.763767720000000000","priceChange":"-0.010007280000000000","priceChangePercent":"-0.2100706958902689739037","bidPrice":"4.680250100000000000","askPrice":"4.786044180000000000","highPrice":"4.785723780000000000","lowPrice":"4.686193430000000000","volume":"25796.121000000000000000","quoteVolume":"122368.576576956090000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"89"},{"symbol":"ETH_BTC","openPrice":"0.034309040000000000","lastPrice":"0.034276020000000000","priceChange":"-0.000033020000000000","priceChangePercent":"-0.0963355722163775140754","bidPrice":"0.034251850000000000","askPrice":"0.034355270000000000","highPrice":"0.034354640000000000","lowPrice":"0.034264500000000000","volume":"506.420000000000000000","quoteVolume":"17.372745152200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"151"},{"symbol":"ETH_USDT","openPrice":"161.110142210000000000","lastPrice":"160.341049950000000000","priceChange":"-0.769092260000000000","priceChangePercent":"-0.4796602368762273406829","bidPrice":"160.387549770000000000","askPrice":"160.417904540000000000","highPrice":"161.530263420000000000","lowPrice":"140.083098420000000000","volume":"122.240000000000000000","quoteVolume":"19470.690474931600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"73"},{"symbol":"GAS_BTC","openPrice":"0.000668860000000000","lastPrice":"0.000675140000000000","priceChange":"0.000006280000000000","priceChangePercent":"0.9301774446781408300501","bidPrice":"0.000668820000000000","askPrice":"0.000678880000000000","highPrice":"0.000678570000000000","lowPrice":"0.000668820000000000","volume":"1663.240000000000000000","quoteVolume":"1.117149552700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"GAS_ETH","openPrice":"0.019802650000000000","lastPrice":"0.019801240000000000","priceChange":"-0.000001410000000000","priceChangePercent":"-0.0071207661742395930760","bidPrice":"0.019800700000000000","askPrice":"0.019802680000000000","highPrice":"0.019802670000000000","lowPrice":"0.019800850000000000","volume":"1243.520000000000000000","quoteVolume":"24.623977236100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"84"},{"symbol":"GAS_UQC","openPrice":"34.452479180000000000","lastPrice":"34.487660100000000000","priceChange":"0.035180920000000000","priceChangePercent":"0.1020101679788939928691","bidPrice":"34.434533320000000000","askPrice":"34.537976770000000000","highPrice":"34.537188290000000000","lowPrice":"34.448517880000000000","volume":"194.220000000000000000","quoteVolume":"6698.738707596700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"75"},{"symbol":"GAS_USDT","openPrice":"2.686399590000000000","lastPrice":"2.686379320000000000","priceChange":"-0.000020270000000000","priceChangePercent":"-0.0007545472022171463113","bidPrice":"2.684520050000000000","askPrice":"2.694788500000000000","highPrice":"2.694393590000000000","lowPrice":"2.685813690000000000","volume":"4235.542000000000000000","quoteVolume":"11393.641511874840000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"104"},{"symbol":"LTC_BTC","openPrice":"0.013922140000000000","lastPrice":"0.013537170000000000","priceChange":"-0.000384970000000000","priceChangePercent":"-2.8437997011192147250866","bidPrice":"0.013502520000000000","askPrice":"0.013637650000000000","highPrice":"0.014015240000000000","lowPrice":"0.013434830000000000","volume":"265.900000000000000000","quoteVolume":"3.651276218000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"LTC_ETH","openPrice":"0.454392520000000000","lastPrice":"0.456000640000000000","priceChange":"0.001608120000000000","priceChangePercent":"0.3526573997790880293501","bidPrice":"0.452810160000000000","askPrice":"0.458555190000000000","highPrice":"0.458191650000000000","lowPrice":"0.449023290000000000","volume":"147.150000000000000000","quoteVolume":"66.889915266600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"44"},{"symbol":"LTC_UQC","openPrice":"560.615410200000000000","lastPrice":"616.690554720000000000","priceChange":"56.075144520000000000","priceChangePercent":"9.0929144432024194761612","bidPrice":"589.816540770000000000","askPrice":"624.693517680000000000","highPrice":"630.505870610000000000","lowPrice":"528.120568650000000000","volume":"95.620000000000000000","quoteVolume":"55173.026874441200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"58"},{"symbol":"LTC_USDT","openPrice":"72.649067450000000000","lastPrice":"73.607015060000000000","priceChange":"0.957947610000000000","priceChangePercent":"1.3014352086131177508450","bidPrice":"72.954836570000000000","askPrice":"74.132989610000000000","highPrice":"74.088250320000000000","lowPrice":"72.049439380000000000","volume":"663.270000000000000000","quoteVolume":"48628.547384412100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"63"},{"symbol":"NEO_BTC","openPrice":"0.002255730000000000","lastPrice":"0.002261240000000000","priceChange":"0.000005510000000000","priceChangePercent":"0.2436716138048150572252","bidPrice":"0.002254390000000000","askPrice":"0.002264610000000000","highPrice":"0.002264220000000000","lowPrice":"0.002255660000000000","volume":"128.170000000000000000","quoteVolume":"0.289706501000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"60"},{"symbol":"NEO_ETH","openPrice":"0.065896820000000000","lastPrice":"0.065860660000000000","priceChange":"-0.000036160000000000","priceChangePercent":"-0.0549037923397670172148","bidPrice":"0.065814900000000000","askPrice":"0.065961480000000000","highPrice":"0.065957500000000000","lowPrice":"0.065827570000000000","volume":"192.132000000000000000","quoteVolume":"12.657715318470000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"NEO_UQC","openPrice":"111.529726600000000000","lastPrice":"111.534345900000000000","priceChange":"0.004619300000000000","priceChangePercent":"0.0041415941992806361184","bidPrice":"110.948003200000000000","askPrice":"112.218898000000000000","highPrice":"112.197741700000000000","lowPrice":"111.074787100000000000","volume":"454.570000000000000000","quoteVolume":"50709.333065858000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"32"},{"symbol":"NEO_USDT","openPrice":"9.074888890000000000","lastPrice":"9.136717650000000000","priceChange":"0.061828760000000000","priceChangePercent":"0.6767064756564957438517","bidPrice":"9.031290270000000000","askPrice":"9.156505930000000000","highPrice":"9.154965310000000000","lowPrice":"9.046162860000000000","volume":"481.440000000000000000","quoteVolume":"4381.393715458600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"ONG_BTC","openPrice":"0.000147730000000000","lastPrice":"0.000147730000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000147720000000000","askPrice":"0.000150560000000000","highPrice":"0.000150450000000000","lowPrice":"0.000147720000000000","volume":"282815.480000000000000000","quoteVolume":"41.873439868200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"53"},{"symbol":"ONG_ETH","openPrice":"0.002608280000000000","lastPrice":"0.002628610000000000","priceChange":"0.000020330000000000","priceChangePercent":"0.7734125640547665876642","bidPrice":"0.002574060000000000","askPrice":"0.002666950000000000","highPrice":"0.002687830000000000","lowPrice":"0.002584420000000000","volume":"139878.060000000000000000","quoteVolume":"367.392162832200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"45"},{"symbol":"ONG_UQC","openPrice":"7.342185060000000000","lastPrice":"7.347003560000000000","priceChange":"0.004818500000000000","priceChangePercent":"0.0655845605715209426141","bidPrice":"7.336567640000000000","askPrice":"7.350201290000000000","highPrice":"7.350074610000000000","lowPrice":"7.337816390000000000","volume":"216097.620000000000000000","quoteVolume":"1586892.939473894800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"43"},{"symbol":"ONG_USDT","openPrice":"0.585903270000000000","lastPrice":"0.585895900000000000","priceChange":"-0.000007370000000000","priceChangePercent":"-0.0012579026410664420079","bidPrice":"0.585306140000000000","askPrice":"0.586364670000000000","highPrice":"0.586355490000000000","lowPrice":"0.585452410000000000","volume":"203024.180000000000000000","quoteVolume":"118949.336619600000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"ONT_BTC","openPrice":"0.000300950000000000","lastPrice":"0.000301600000000000","priceChange":"0.000000650000000000","priceChangePercent":"0.2155172413793103448276","bidPrice":"0.000300640000000000","askPrice":"0.000301670000000000","highPrice":"0.000301660000000000","lowPrice":"0.000300760000000000","volume":"249466.980000000000000000","quoteVolume":"75.145075090200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"ONT_ETH","openPrice":"0.006810790000000000","lastPrice":"0.006961110000000000","priceChange":"0.000150320000000000","priceChangePercent":"2.1594257237710652467782","bidPrice":"0.006839510000000000","askPrice":"0.006972510000000000","highPrice":"0.006991250000000000","lowPrice":"0.006772150000000000","volume":"60787.240000000000000000","quoteVolume":"419.215997150000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"60"},{"symbol":"ONT_UQC","openPrice":"14.473114090000000000","lastPrice":"14.471995960000000000","priceChange":"-0.001118130000000000","priceChangePercent":"-0.0077261630191886814208","bidPrice":"14.468738270000000000","askPrice":"14.482885140000000000","highPrice":"14.486135090000000000","lowPrice":"14.470277550000000000","volume":"30024.300000000000000000","quoteVolume":"434674.182909716000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"32"},{"symbol":"ONT_USDT","openPrice":"1.111275730000000000","lastPrice":"1.116220580000000000","priceChange":"0.004944850000000000","priceChangePercent":"0.4429993577075957513702","bidPrice":"1.109379380000000000","askPrice":"1.117862760000000000","highPrice":"1.125729100000000000","lowPrice":"1.109564330000000000","volume":"102608.200000000000000000","quoteVolume":"114274.827031752000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"46"},{"symbol":"REP_BTC","openPrice":"0.003920810000000000","lastPrice":"0.003825620000000000","priceChange":"-0.000095190000000000","priceChangePercent":"-2.4882241309905322535955","bidPrice":"0.003790500000000000","askPrice":"0.003856560000000000","highPrice":"0.003968500000000000","lowPrice":"0.003781800000000000","volume":"22478.230000000000000000","quoteVolume":"85.985037358900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"98"},{"symbol":"REP_ETH","openPrice":"0.129430830000000000","lastPrice":"0.127820190000000000","priceChange":"-0.001610640000000000","priceChangePercent":"-1.2600826207502899189870","bidPrice":"0.126437400000000000","askPrice":"0.129280610000000000","highPrice":"0.133051700000000000","lowPrice":"0.126268270000000000","volume":"180361.690000000000000000","quoteVolume":"23024.917860845400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"101"},{"symbol":"REP_UQC","openPrice":"149.989585500000000000","lastPrice":"173.208668780000000000","priceChange":"23.219083280000000000","priceChangePercent":"13.4052662857720971394905","bidPrice":"167.283885180000000000","askPrice":"174.177490770000000000","highPrice":"174.720817350000000000","lowPrice":"149.718260400000000000","volume":"2016.197000000000000000","quoteVolume":"333511.641851367960000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"114"},{"symbol":"REP_USDT","openPrice":"20.958850360000000000","lastPrice":"20.596457690000000000","priceChange":"-0.362392670000000000","priceChangePercent":"-1.7594902747570473124401","bidPrice":"20.397695640000000000","askPrice":"20.743536680000000000","highPrice":"21.065636370000000000","lowPrice":"20.240354820000000000","volume":"4387.125000000000000000","quoteVolume":"89761.520379799010000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"138"},{"symbol":"TRX_BTC","openPrice":"0.000006550000000000","lastPrice":"0.000006470000000000","priceChange":"-0.000000080000000000","priceChangePercent":"-1.2364760432766615146832","bidPrice":"0.000006470000000000","askPrice":"0.000006530000000000","highPrice":"0.000006550000000000","lowPrice":"0.000006470000000000","volume":"13815.446000000000000000","quoteVolume":"0.089983677270000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"57"},{"symbol":"TRX_ETH","openPrice":"0.000148730000000000","lastPrice":"0.000146960000000000","priceChange":"-0.000001770000000000","priceChangePercent":"-1.2044093630919978225367","bidPrice":"0.000145920000000000","askPrice":"0.000148870000000000","highPrice":"0.000149590000000000","lowPrice":"0.000146180000000000","volume":"65389.720000000000000000","quoteVolume":"9.671445145700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"66"},{"symbol":"TRX_UQC","openPrice":"0.284171040000000000","lastPrice":"0.283743710000000000","priceChange":"-0.000427330000000000","priceChangePercent":"-0.1506042195613781183026","bidPrice":"0.283377900000000000","askPrice":"0.284406230000000000","highPrice":"0.284403590000000000","lowPrice":"0.283506390000000000","volume":"17770.330000000000000000","quoteVolume":"5046.940217611200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"44"},{"symbol":"TRX_USDT","openPrice":"0.022890550000000000","lastPrice":"0.022876350000000000","priceChange":"-0.000014200000000000","priceChangePercent":"-0.0620728394171272952197","bidPrice":"0.022811150000000000","askPrice":"0.022913450000000000","highPrice":"0.022909450000000000","lowPrice":"0.022823850000000000","volume":"4476.820000000000000000","quoteVolume":"102.365686928000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"77"},{"symbol":"UQC_BTC","openPrice":"0.000020140000000000","lastPrice":"0.000020180000000000","priceChange":"0.000000040000000000","priceChangePercent":"0.1982160555004955401388","bidPrice":"0.000020090000000000","askPrice":"0.000020240000000000","highPrice":"0.000020240000000000","lowPrice":"0.000020100000000000","volume":"326198.360000000000000000","quoteVolume":"6.580920711000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"70"},{"symbol":"UQC_ETH","openPrice":"0.000589960000000000","lastPrice":"0.000590240000000000","priceChange":"0.000000280000000000","priceChangePercent":"0.0474383301707779886148","bidPrice":"0.000589550000000000","askPrice":"0.000590610000000000","highPrice":"0.000590600000000000","lowPrice":"0.000589670000000000","volume":"220.330000000000000000","quoteVolume":"0.130010624900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"57"},{"symbol":"UQC_USDT","openPrice":"0.080612040000000000","lastPrice":"0.080957880000000000","priceChange":"0.000345840000000000","priceChangePercent":"0.4271850992145545313192","bidPrice":"0.079863650000000000","askPrice":"0.081101770000000000","highPrice":"0.081071290000000000","lowPrice":"0.079991300000000000","volume":"1098.300000000000000000","quoteVolume":"88.420009705000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"31"},{"symbol":"USDC_ETH","openPrice":"0.006267560000000000","lastPrice":"0.006347560000000000","priceChange":"0.000080000000000000","priceChangePercent":"1.2603268027399504691567","bidPrice":"0.006287560000000000","askPrice":"0.006397560000000000","highPrice":"0.006387560000000000","lowPrice":"0.006237560000000000","volume":"205.100000000000000000","quoteVolume":"1.292004556000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"56"},{"symbol":"USDC_UQC","openPrice":"6.000837510000000000","lastPrice":"5.997837510000000000","priceChange":"-0.003000000000000000","priceChangePercent":"-0.0500180272472903321451","bidPrice":"5.973837510000000000","askPrice":"6.002837510000000000","highPrice":"6.005837510000000000","lowPrice":"5.974837510000000000","volume":"93103.120000000000000000","quoteVolume":"557597.534094031200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"49"},{"symbol":"USDC_USDT","openPrice":"0.999067030000000000","lastPrice":"0.999065660000000000","priceChange":"-0.000001370000000000","priceChangePercent":"-0.0001371281242916506609","bidPrice":"0.998999950000000000","askPrice":"0.999099840000000000","highPrice":"0.999096370000000000","lowPrice":"0.999001380000000000","volume":"243883.850000000000000000","quoteVolume":"243653.262038073900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"58"},{"symbol":"XLM_BTC","openPrice":"0.000018510000000000","lastPrice":"0.000019020000000000","priceChange":"0.000000510000000000","priceChangePercent":"2.6813880126182965299685","bidPrice":"0.000018590000000000","askPrice":"0.000019060000000000","highPrice":"0.000019040000000000","lowPrice":"0.000018510000000000","volume":"203241.300000000000000000","quoteVolume":"3.812449842000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"56"},{"symbol":"XLM_ETH","openPrice":"0.000618910000000000","lastPrice":"0.000629360000000000","priceChange":"0.000010450000000000","priceChangePercent":"1.6604169314859539850006","bidPrice":"0.000627050000000000","askPrice":"0.000634080000000000","highPrice":"0.000633770000000000","lowPrice":"0.000618910000000000","volume":"294.830000000000000000","quoteVolume":"0.184968729100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"XLM_UQC","openPrice":"0.766574880000000000","lastPrice":"0.826669050000000000","priceChange":"0.060094170000000000","priceChangePercent":"7.2694350901367360977165","bidPrice":"0.812600660000000000","askPrice":"0.860723720000000000","highPrice":"0.864695470000000000","lowPrice":"0.726710470000000000","volume":"31753.810000000000000000","quoteVolume":"25423.974998000800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"XLM_USDT","openPrice":"0.098701460000000000","lastPrice":"0.100622090000000000","priceChange":"0.001920630000000000","priceChangePercent":"1.9087558209136780999083","bidPrice":"0.099194410000000000","askPrice":"0.101508920000000000","highPrice":"0.101470320000000000","lowPrice":"0.098292500000000000","volume":"117491.230000000000000000","quoteVolume":"11777.934380603100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"XRP_BTC","openPrice":"0.000057700000000000","lastPrice":"0.000056310000000000","priceChange":"-0.000001390000000000","priceChangePercent":"-2.4684780678387497780146","bidPrice":"0.000055850000000000","askPrice":"0.000057500000000000","highPrice":"0.000057990000000000","lowPrice":"0.000056290000000000","volume":"278168.200000000000000000","quoteVolume":"15.888703190000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"XRP_ETH","openPrice":"0.001911870000000000","lastPrice":"0.001885910000000000","priceChange":"-0.000025960000000000","priceChangePercent":"-1.3765238001813448149700","bidPrice":"0.001879710000000000","askPrice":"0.001902810000000000","highPrice":"0.001914700000000000","lowPrice":"0.001881110000000000","volume":"210686.830000000000000000","quoteVolume":"399.083032200700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"43"},{"symbol":"XRP_UQC","openPrice":"2.300558350000000000","lastPrice":"2.559390690000000000","priceChange":"0.258832340000000000","priceChangePercent":"10.1130453045447313086850","bidPrice":"2.460823350000000000","askPrice":"2.587203820000000000","highPrice":"2.601792880000000000","lowPrice":"2.181902860000000000","volume":"183650.600000000000000000","quoteVolume":"442405.889968511500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"61"},{"symbol":"XRP_USDT","openPrice":"0.307466600000000000","lastPrice":"0.303869790000000000","priceChange":"-0.003596810000000000","priceChangePercent":"-1.1836681757669954621024","bidPrice":"0.301434080000000000","askPrice":"0.304972540000000000","highPrice":"0.307466600000000000","lowPrice":"0.301573040000000000","volume":"237454.910000000000000000","quoteVolume":"72227.719204347400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"66"},{"symbol":"XVG_BTC","openPrice":"0.000001940000000000","lastPrice":"0.000001940000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000001940000000000","askPrice":"0.000001950000000000","highPrice":"0.000001970000000000","lowPrice":"0.000001940000000000","volume":"1980.100000000000000000","quoteVolume":"0.003863940300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"XVG_ETH","openPrice":"0.000049340000000000","lastPrice":"0.000049830000000000","priceChange":"0.000000490000000000","priceChangePercent":"0.9833433674493277142284","bidPrice":"0.000049140000000000","askPrice":"0.000049540000000000","highPrice":"0.000050090000000000","lowPrice":"0.000049140000000000","volume":"4400.832000000000000000","quoteVolume":"0.218119639420000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"78"},{"symbol":"XVG_UQC","openPrice":"0.084111350000000000","lastPrice":"0.084101520000000000","priceChange":"-0.000009830000000000","priceChangePercent":"-0.0116882548615054757631","bidPrice":"0.084015170000000000","askPrice":"0.084149350000000000","highPrice":"0.084145990000000000","lowPrice":"0.084028000000000000","volume":"14450.010000000000000000","quoteVolume":"1214.980552120200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"40"},{"symbol":"XVG_USDT","openPrice":"0.007356320000000000","lastPrice":"0.007380550000000000","priceChange":"0.000024230000000000","priceChangePercent":"0.3282953167446870490682","bidPrice":"0.007330930000000000","askPrice":"0.007455580000000000","highPrice":"0.007440620000000000","lowPrice":"0.007211790000000000","volume":"31785.000000000000000000","quoteVolume":"233.096229737500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"41"},{"symbol":"ZRX_BTC","openPrice":"0.000052500000000000","lastPrice":"0.000051490000000000","priceChange":"-0.000001010000000000","priceChangePercent":"-1.9615459312487861720722","bidPrice":"0.000051170000000000","askPrice":"0.000052280000000000","highPrice":"0.000052820000000000","lowPrice":"0.000051430000000000","volume":"220321.360000000000000000","quoteVolume":"11.482029587000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"97"},{"symbol":"ZRX_ETH","openPrice":"0.001728910000000000","lastPrice":"0.001728540000000000","priceChange":"-0.000000370000000000","priceChangePercent":"-0.0214053478658289654853","bidPrice":"0.001722810000000000","askPrice":"0.001737300000000000","highPrice":"0.001758520000000000","lowPrice":"0.001667390000000000","volume":"55476.980000000000000000","quoteVolume":"96.307105104000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"89"},{"symbol":"ZRX_UQC","openPrice":"2.066082910000000000","lastPrice":"2.287221730000000000","priceChange":"0.221138820000000000","priceChangePercent":"9.6684469677541932062704","bidPrice":"2.287381910000000000","askPrice":"2.295811250000000000","highPrice":"2.358511300000000000","lowPrice":"2.006237760000000000","volume":"386109.930000000000000000","quoteVolume":"857947.396909737400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"121"},{"symbol":"ZRX_USDT","openPrice":"0.276862260000000000","lastPrice":"0.275064160000000000","priceChange":"-0.001798100000000000","priceChangePercent":"-0.6537020308280075455850","bidPrice":"0.274891470000000000","askPrice":"0.277108940000000000","highPrice":"0.281159970000000000","lowPrice":"0.275064160000000000","volume":"334765.360000000000000000","quoteVolume":"93135.434232088000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"81"}]' + http_version: + recorded_at: Thu, 02 May 2019 04:21:56 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_ticker.yml b/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_ticker.yml new file mode 100644 index 000000000..d26207af5 --- /dev/null +++ b/spec/cassettes/vcr_cassettes/Omgfin/integration_specs_fetch_ticker.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://omgfin.com/api/v1/ticker/24hr + body: + encoding: UTF-8 + string: '' + headers: + Connection: + - close + Host: + - omgfin.com + User-Agent: + - http.rb/5.0.0.pre + response: + status: + code: 200 + message: OK + headers: + Server: + - Sucuri/Cloudproxy + Date: + - Thu, 02 May 2019 04:21:56 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - close + X-Sucuri-Id: + - '18014' + Vary: + - Accept-Encoding + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Nginx-Cache-Status: + - BYPASS + X-Server-Powered-By: + - Omgfin + Referrer-Policy: + - no-referrer-when-downgrade + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Sucuri-Cache: + - HIT + body: + encoding: UTF-8 + string: '[{"symbol":"BAT_BTC","openPrice":"0.000072760000000000","lastPrice":"0.000072040000000000","priceChange":"-0.000000720000000000","priceChangePercent":"-0.9994447529150471960022","bidPrice":"0.000070620000000000","askPrice":"0.000072630000000000","highPrice":"0.000073250000000000","lowPrice":"0.000070390000000000","volume":"52109.400000000000000000","quoteVolume":"3.728623386000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"50"},{"symbol":"BAT_ETH","openPrice":"0.002402150000000000","lastPrice":"0.002376200000000000","priceChange":"-0.000025950000000000","priceChangePercent":"-1.0920797912633616698931","bidPrice":"0.002359310000000000","askPrice":"0.002400570000000000","highPrice":"0.002450570000000000","lowPrice":"0.002352070000000000","volume":"336788.600000000000000000","quoteVolume":"807.198930048000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"76"},{"symbol":"BAT_UQC","openPrice":"2.858744110000000000","lastPrice":"3.120178670000000000","priceChange":"0.261434560000000000","priceChangePercent":"8.3788329980475124522276","bidPrice":"3.130417720000000000","askPrice":"3.245076620000000000","highPrice":"3.325063010000000000","lowPrice":"2.767457230000000000","volume":"181273.320000000000000000","quoteVolume":"558416.297470947100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"48"},{"symbol":"BAT_USDT","openPrice":"0.384846400000000000","lastPrice":"0.379940300000000000","priceChange":"-0.004906100000000000","priceChangePercent":"-1.2912818145377050026017","bidPrice":"0.377842900000000000","askPrice":"0.387287000000000000","highPrice":"0.394116520000000000","lowPrice":"0.376830520000000000","volume":"159897.400000000000000000","quoteVolume":"61370.982117944900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"48"},{"symbol":"BCH_BTC","openPrice":"0.041507280000000000","lastPrice":"0.041588410000000000","priceChange":"0.000081130000000000","priceChangePercent":"0.1950783884260061877816","bidPrice":"0.041490050000000000","askPrice":"0.041594210000000000","highPrice":"0.041594030000000000","lowPrice":"0.041503290000000000","volume":"232.490000000000000000","quoteVolume":"9.660271964400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"95"},{"symbol":"BCH_ETH","openPrice":"1.208488310000000000","lastPrice":"1.208475680000000000","priceChange":"-0.000012630000000000","priceChangePercent":"-0.0010451182600546831029","bidPrice":"1.208409700000000000","askPrice":"1.208530560000000000","highPrice":"1.208517350000000000","lowPrice":"1.208422180000000000","volume":"375.270000000000000000","quoteVolume":"453.503565795300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"116"},{"symbol":"BCH_UQC","openPrice":"2053.216370360000000000","lastPrice":"2148.559652950000000000","priceChange":"95.343282590000000000","priceChangePercent":"4.4375441221328180670749","bidPrice":"2143.742326990000000000","askPrice":"2178.900217020000000000","highPrice":"2175.883112950000000000","lowPrice":"2009.708645510000000000","volume":"2.032000000000000000","quoteVolume":"4247.925196118300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"17"},{"symbol":"BCH_USDT","openPrice":"164.885828280000000000","lastPrice":"164.922999890000000000","priceChange":"0.037171610000000000","priceChangePercent":"0.0225387665909501059586","bidPrice":"164.837531970000000000","askPrice":"164.974029380000000000","highPrice":"164.973229770000000000","lowPrice":"164.850110930000000000","volume":"321.810000000000000000","quoteVolume":"53068.861083005500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"130"},{"symbol":"BTC_USDC","openPrice":"5292.288873980000000000","lastPrice":"5323.850892110000000000","priceChange":"31.562018130000000000","priceChangePercent":"0.5928418877541297210972","bidPrice":"5313.276909650000000000","askPrice":"5343.260266770000000000","highPrice":"5341.348446140000000000","lowPrice":"5282.426575880000000000","volume":"457.200000000000000000","quoteVolume":"2431411.233519534000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"110"},{"symbol":"BTC_USDT","openPrice":"5354.508148280000000000","lastPrice":"5383.380529240000000000","priceChange":"28.872380960000000000","priceChangePercent":"0.5363243561026154156407","bidPrice":"5372.418174460000000000","askPrice":"5387.801090620000000000","highPrice":"5387.793160660000000000","lowPrice":"5335.795812960000000000","volume":"966.660000000000000000","quoteVolume":"5180350.915283456800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"790"},{"symbol":"BTT_BTC","openPrice":"0.000000120000000000","lastPrice":"0.000000120000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000002250000000000","askPrice":"0.000002240000000000","highPrice":"0.000000120000000000","lowPrice":"0.000000120000000000","volume":"501357.528000000000000000","quoteVolume":"0.060162903360000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"86"},{"symbol":"BTT_ETH","openPrice":"0.000004040000000000","lastPrice":"0.000004040000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000003990000000000","askPrice":"0.000004160000000000","highPrice":"0.000004130000000000","lowPrice":"0.000003910000000000","volume":"284285.520000000000000000","quoteVolume":"1.142843277400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"BTT_UQC","openPrice":"0.005156020000000000","lastPrice":"0.005273600000000000","priceChange":"0.000117580000000000","priceChangePercent":"2.2295964805825242718447","bidPrice":"0.005235150000000000","askPrice":"0.005639460000000000","highPrice":"0.005603440000000000","lowPrice":"0.004527810000000000","volume":"49609.668000000000000000","quoteVolume":"255.272890081640000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"47"},{"symbol":"BTT_USDT","openPrice":"0.000643950000000000","lastPrice":"0.000649320000000000","priceChange":"0.000005370000000000","priceChangePercent":"0.8270190352984660875993","bidPrice":"0.000647820000000000","askPrice":"0.000665520000000000","highPrice":"0.000657070000000000","lowPrice":"0.000631060000000000","volume":"117495.034000000000000000","quoteVolume":"76.078868691370000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"77"},{"symbol":"ENJ_BTC","openPrice":"0.000028050000000000","lastPrice":"0.000027490000000000","priceChange":"-0.000000560000000000","priceChangePercent":"-2.0371044016005820298290","bidPrice":"0.000027210000000000","askPrice":"0.000027820000000000","highPrice":"0.000028920000000000","lowPrice":"0.000027230000000000","volume":"160514.100000000000000000","quoteVolume":"4.486329366000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"45"},{"symbol":"ENJ_ETH","openPrice":"0.000949590000000000","lastPrice":"0.000913280000000000","priceChange":"-0.000036310000000000","priceChangePercent":"-3.9757796075683251576734","bidPrice":"0.000910550000000000","askPrice":"0.000942700000000000","highPrice":"0.000957200000000000","lowPrice":"0.000913160000000000","volume":"86739.000000000000000000","quoteVolume":"81.262393754000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"33"},{"symbol":"ENJ_UQC","openPrice":"1.142171110000000000","lastPrice":"1.207426580000000000","priceChange":"0.065255470000000000","priceChangePercent":"5.4045083221540476606039","bidPrice":"1.192817230000000000","askPrice":"1.274576110000000000","highPrice":"1.255720400000000000","lowPrice":"1.086065510000000000","volume":"211128.770000000000000000","quoteVolume":"251696.507392010400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"61"},{"symbol":"ENJ_USDT","openPrice":"0.151205510000000000","lastPrice":"0.147961660000000000","priceChange":"-0.003243850000000000","priceChangePercent":"-2.1923584798926965269246","bidPrice":"0.147399250000000000","askPrice":"0.150139020000000000","highPrice":"0.152843350000000000","lowPrice":"0.147049170000000000","volume":"183872.980000000000000000","quoteVolume":"27508.745979431000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"92"},{"symbol":"EOS_BTC","openPrice":"0.000886290000000000","lastPrice":"0.000878020000000000","priceChange":"-0.000008270000000000","priceChangePercent":"-0.9418919842372611102253","bidPrice":"0.000876490000000000","askPrice":"0.000888050000000000","highPrice":"0.000899600000000000","lowPrice":"0.000877140000000000","volume":"243747.190000000000000000","quoteVolume":"215.849263742000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"103"},{"symbol":"EOS_ETH","openPrice":"0.029283270000000000","lastPrice":"0.029619200000000000","priceChange":"0.000335930000000000","priceChangePercent":"1.1341629753673292999136","bidPrice":"0.029381130000000000","askPrice":"0.029892480000000000","highPrice":"0.029861450000000000","lowPrice":"0.029240550000000000","volume":"58671.500000000000000000","quoteVolume":"1735.520560512200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"105"},{"symbol":"EOS_UQC","openPrice":"34.803596950000000000","lastPrice":"38.929148610000000000","priceChange":"4.125551660000000000","priceChangePercent":"10.5975902564184025703510","bidPrice":"38.736793750000000000","askPrice":"40.328940610000000000","highPrice":"40.327096610000000000","lowPrice":"34.174715890000000000","volume":"2400.550000000000000000","quoteVolume":"89410.437100917010000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"79"},{"symbol":"EOS_USDT","openPrice":"4.773775000000000000","lastPrice":"4.763767720000000000","priceChange":"-0.010007280000000000","priceChangePercent":"-0.2100706958902689739037","bidPrice":"4.680250100000000000","askPrice":"4.786044180000000000","highPrice":"4.785723780000000000","lowPrice":"4.686193430000000000","volume":"25796.121000000000000000","quoteVolume":"122368.576576956090000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"89"},{"symbol":"ETH_BTC","openPrice":"0.034309040000000000","lastPrice":"0.034276020000000000","priceChange":"-0.000033020000000000","priceChangePercent":"-0.0963355722163775140754","bidPrice":"0.034251850000000000","askPrice":"0.034355270000000000","highPrice":"0.034354640000000000","lowPrice":"0.034264500000000000","volume":"506.420000000000000000","quoteVolume":"17.372745152200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"151"},{"symbol":"ETH_USDT","openPrice":"161.110142210000000000","lastPrice":"160.341049950000000000","priceChange":"-0.769092260000000000","priceChangePercent":"-0.4796602368762273406829","bidPrice":"160.387549770000000000","askPrice":"160.417904540000000000","highPrice":"161.530263420000000000","lowPrice":"140.083098420000000000","volume":"122.240000000000000000","quoteVolume":"19470.690474931600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"73"},{"symbol":"GAS_BTC","openPrice":"0.000668860000000000","lastPrice":"0.000675140000000000","priceChange":"0.000006280000000000","priceChangePercent":"0.9301774446781408300501","bidPrice":"0.000668820000000000","askPrice":"0.000678880000000000","highPrice":"0.000678570000000000","lowPrice":"0.000668820000000000","volume":"1663.240000000000000000","quoteVolume":"1.117149552700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"GAS_ETH","openPrice":"0.019802650000000000","lastPrice":"0.019801240000000000","priceChange":"-0.000001410000000000","priceChangePercent":"-0.0071207661742395930760","bidPrice":"0.019800700000000000","askPrice":"0.019802680000000000","highPrice":"0.019802670000000000","lowPrice":"0.019800850000000000","volume":"1243.520000000000000000","quoteVolume":"24.623977236100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"84"},{"symbol":"GAS_UQC","openPrice":"34.452479180000000000","lastPrice":"34.487660100000000000","priceChange":"0.035180920000000000","priceChangePercent":"0.1020101679788939928691","bidPrice":"34.434533320000000000","askPrice":"34.537976770000000000","highPrice":"34.537188290000000000","lowPrice":"34.448517880000000000","volume":"194.220000000000000000","quoteVolume":"6698.738707596700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"75"},{"symbol":"GAS_USDT","openPrice":"2.686399590000000000","lastPrice":"2.686379320000000000","priceChange":"-0.000020270000000000","priceChangePercent":"-0.0007545472022171463113","bidPrice":"2.684520050000000000","askPrice":"2.694788500000000000","highPrice":"2.694393590000000000","lowPrice":"2.685813690000000000","volume":"4235.542000000000000000","quoteVolume":"11393.641511874840000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"104"},{"symbol":"LTC_BTC","openPrice":"0.013922140000000000","lastPrice":"0.013537170000000000","priceChange":"-0.000384970000000000","priceChangePercent":"-2.8437997011192147250866","bidPrice":"0.013502520000000000","askPrice":"0.013637650000000000","highPrice":"0.014015240000000000","lowPrice":"0.013434830000000000","volume":"265.900000000000000000","quoteVolume":"3.651276218000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"LTC_ETH","openPrice":"0.454392520000000000","lastPrice":"0.456000640000000000","priceChange":"0.001608120000000000","priceChangePercent":"0.3526573997790880293501","bidPrice":"0.452810160000000000","askPrice":"0.458555190000000000","highPrice":"0.458191650000000000","lowPrice":"0.449023290000000000","volume":"147.150000000000000000","quoteVolume":"66.889915266600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"44"},{"symbol":"LTC_UQC","openPrice":"560.615410200000000000","lastPrice":"616.690554720000000000","priceChange":"56.075144520000000000","priceChangePercent":"9.0929144432024194761612","bidPrice":"589.816540770000000000","askPrice":"624.693517680000000000","highPrice":"630.505870610000000000","lowPrice":"528.120568650000000000","volume":"95.620000000000000000","quoteVolume":"55173.026874441200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"58"},{"symbol":"LTC_USDT","openPrice":"72.649067450000000000","lastPrice":"73.607015060000000000","priceChange":"0.957947610000000000","priceChangePercent":"1.3014352086131177508450","bidPrice":"72.954836570000000000","askPrice":"74.132989610000000000","highPrice":"74.088250320000000000","lowPrice":"72.049439380000000000","volume":"663.270000000000000000","quoteVolume":"48628.547384412100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"63"},{"symbol":"NEO_BTC","openPrice":"0.002255730000000000","lastPrice":"0.002261240000000000","priceChange":"0.000005510000000000","priceChangePercent":"0.2436716138048150572252","bidPrice":"0.002254390000000000","askPrice":"0.002264610000000000","highPrice":"0.002264220000000000","lowPrice":"0.002255660000000000","volume":"128.170000000000000000","quoteVolume":"0.289706501000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"60"},{"symbol":"NEO_ETH","openPrice":"0.065896820000000000","lastPrice":"0.065860660000000000","priceChange":"-0.000036160000000000","priceChangePercent":"-0.0549037923397670172148","bidPrice":"0.065814900000000000","askPrice":"0.065961480000000000","highPrice":"0.065957500000000000","lowPrice":"0.065827570000000000","volume":"192.132000000000000000","quoteVolume":"12.657715318470000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"NEO_UQC","openPrice":"111.529726600000000000","lastPrice":"111.534345900000000000","priceChange":"0.004619300000000000","priceChangePercent":"0.0041415941992806361184","bidPrice":"110.948003200000000000","askPrice":"112.218898000000000000","highPrice":"112.197741700000000000","lowPrice":"111.074787100000000000","volume":"454.570000000000000000","quoteVolume":"50709.333065858000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"32"},{"symbol":"NEO_USDT","openPrice":"9.074888890000000000","lastPrice":"9.136717650000000000","priceChange":"0.061828760000000000","priceChangePercent":"0.6767064756564957438517","bidPrice":"9.031290270000000000","askPrice":"9.156505930000000000","highPrice":"9.154965310000000000","lowPrice":"9.046162860000000000","volume":"481.440000000000000000","quoteVolume":"4381.393715458600000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"ONG_BTC","openPrice":"0.000147730000000000","lastPrice":"0.000147730000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000147720000000000","askPrice":"0.000150560000000000","highPrice":"0.000150450000000000","lowPrice":"0.000147720000000000","volume":"282815.480000000000000000","quoteVolume":"41.873439868200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"53"},{"symbol":"ONG_ETH","openPrice":"0.002608280000000000","lastPrice":"0.002628610000000000","priceChange":"0.000020330000000000","priceChangePercent":"0.7734125640547665876642","bidPrice":"0.002574060000000000","askPrice":"0.002666950000000000","highPrice":"0.002687830000000000","lowPrice":"0.002584420000000000","volume":"139878.060000000000000000","quoteVolume":"367.392162832200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"45"},{"symbol":"ONG_UQC","openPrice":"7.342185060000000000","lastPrice":"7.347003560000000000","priceChange":"0.004818500000000000","priceChangePercent":"0.0655845605715209426141","bidPrice":"7.336567640000000000","askPrice":"7.350201290000000000","highPrice":"7.350074610000000000","lowPrice":"7.337816390000000000","volume":"216097.620000000000000000","quoteVolume":"1586892.939473894800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"43"},{"symbol":"ONG_USDT","openPrice":"0.585903270000000000","lastPrice":"0.585895900000000000","priceChange":"-0.000007370000000000","priceChangePercent":"-0.0012579026410664420079","bidPrice":"0.585306140000000000","askPrice":"0.586364670000000000","highPrice":"0.586355490000000000","lowPrice":"0.585452410000000000","volume":"203024.180000000000000000","quoteVolume":"118949.336619600000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"ONT_BTC","openPrice":"0.000300950000000000","lastPrice":"0.000301600000000000","priceChange":"0.000000650000000000","priceChangePercent":"0.2155172413793103448276","bidPrice":"0.000300640000000000","askPrice":"0.000301670000000000","highPrice":"0.000301660000000000","lowPrice":"0.000300760000000000","volume":"249466.980000000000000000","quoteVolume":"75.145075090200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"ONT_ETH","openPrice":"0.006810790000000000","lastPrice":"0.006961110000000000","priceChange":"0.000150320000000000","priceChangePercent":"2.1594257237710652467782","bidPrice":"0.006839510000000000","askPrice":"0.006972510000000000","highPrice":"0.006991250000000000","lowPrice":"0.006772150000000000","volume":"60787.240000000000000000","quoteVolume":"419.215997150000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"60"},{"symbol":"ONT_UQC","openPrice":"14.473114090000000000","lastPrice":"14.471995960000000000","priceChange":"-0.001118130000000000","priceChangePercent":"-0.0077261630191886814208","bidPrice":"14.468738270000000000","askPrice":"14.482885140000000000","highPrice":"14.486135090000000000","lowPrice":"14.470277550000000000","volume":"30024.300000000000000000","quoteVolume":"434674.182909716000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"32"},{"symbol":"ONT_USDT","openPrice":"1.111275730000000000","lastPrice":"1.116220580000000000","priceChange":"0.004944850000000000","priceChangePercent":"0.4429993577075957513702","bidPrice":"1.109379380000000000","askPrice":"1.117862760000000000","highPrice":"1.125729100000000000","lowPrice":"1.109564330000000000","volume":"102608.200000000000000000","quoteVolume":"114274.827031752000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"46"},{"symbol":"REP_BTC","openPrice":"0.003920810000000000","lastPrice":"0.003825620000000000","priceChange":"-0.000095190000000000","priceChangePercent":"-2.4882241309905322535955","bidPrice":"0.003790500000000000","askPrice":"0.003856560000000000","highPrice":"0.003968500000000000","lowPrice":"0.003781800000000000","volume":"22478.230000000000000000","quoteVolume":"85.985037358900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"98"},{"symbol":"REP_ETH","openPrice":"0.129430830000000000","lastPrice":"0.127820190000000000","priceChange":"-0.001610640000000000","priceChangePercent":"-1.2600826207502899189870","bidPrice":"0.126437400000000000","askPrice":"0.129280610000000000","highPrice":"0.133051700000000000","lowPrice":"0.126268270000000000","volume":"180361.690000000000000000","quoteVolume":"23024.917860845400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"101"},{"symbol":"REP_UQC","openPrice":"149.989585500000000000","lastPrice":"173.208668780000000000","priceChange":"23.219083280000000000","priceChangePercent":"13.4052662857720971394905","bidPrice":"167.283885180000000000","askPrice":"174.177490770000000000","highPrice":"174.720817350000000000","lowPrice":"149.718260400000000000","volume":"2016.197000000000000000","quoteVolume":"333511.641851367960000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"114"},{"symbol":"REP_USDT","openPrice":"20.958850360000000000","lastPrice":"20.596457690000000000","priceChange":"-0.362392670000000000","priceChangePercent":"-1.7594902747570473124401","bidPrice":"20.397695640000000000","askPrice":"20.743536680000000000","highPrice":"21.065636370000000000","lowPrice":"20.240354820000000000","volume":"4387.125000000000000000","quoteVolume":"89761.520379799010000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"138"},{"symbol":"TRX_BTC","openPrice":"0.000006550000000000","lastPrice":"0.000006470000000000","priceChange":"-0.000000080000000000","priceChangePercent":"-1.2364760432766615146832","bidPrice":"0.000006470000000000","askPrice":"0.000006530000000000","highPrice":"0.000006550000000000","lowPrice":"0.000006470000000000","volume":"13815.446000000000000000","quoteVolume":"0.089983677270000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"57"},{"symbol":"TRX_ETH","openPrice":"0.000148730000000000","lastPrice":"0.000146960000000000","priceChange":"-0.000001770000000000","priceChangePercent":"-1.2044093630919978225367","bidPrice":"0.000145920000000000","askPrice":"0.000148870000000000","highPrice":"0.000149590000000000","lowPrice":"0.000146180000000000","volume":"65389.720000000000000000","quoteVolume":"9.671445145700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"66"},{"symbol":"TRX_UQC","openPrice":"0.284171040000000000","lastPrice":"0.283743710000000000","priceChange":"-0.000427330000000000","priceChangePercent":"-0.1506042195613781183026","bidPrice":"0.283377900000000000","askPrice":"0.284406230000000000","highPrice":"0.284403590000000000","lowPrice":"0.283506390000000000","volume":"17770.330000000000000000","quoteVolume":"5046.940217611200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"44"},{"symbol":"TRX_USDT","openPrice":"0.022890550000000000","lastPrice":"0.022876350000000000","priceChange":"-0.000014200000000000","priceChangePercent":"-0.0620728394171272952197","bidPrice":"0.022811150000000000","askPrice":"0.022913450000000000","highPrice":"0.022909450000000000","lowPrice":"0.022823850000000000","volume":"4476.820000000000000000","quoteVolume":"102.365686928000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"77"},{"symbol":"UQC_BTC","openPrice":"0.000020140000000000","lastPrice":"0.000020180000000000","priceChange":"0.000000040000000000","priceChangePercent":"0.1982160555004955401388","bidPrice":"0.000020090000000000","askPrice":"0.000020240000000000","highPrice":"0.000020240000000000","lowPrice":"0.000020100000000000","volume":"326198.360000000000000000","quoteVolume":"6.580920711000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"70"},{"symbol":"UQC_ETH","openPrice":"0.000589960000000000","lastPrice":"0.000590240000000000","priceChange":"0.000000280000000000","priceChangePercent":"0.0474383301707779886148","bidPrice":"0.000589550000000000","askPrice":"0.000590610000000000","highPrice":"0.000590600000000000","lowPrice":"0.000589670000000000","volume":"220.330000000000000000","quoteVolume":"0.130010624900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"57"},{"symbol":"UQC_USDT","openPrice":"0.080612040000000000","lastPrice":"0.080957880000000000","priceChange":"0.000345840000000000","priceChangePercent":"0.4271850992145545313192","bidPrice":"0.079863650000000000","askPrice":"0.081101770000000000","highPrice":"0.081071290000000000","lowPrice":"0.079991300000000000","volume":"1098.300000000000000000","quoteVolume":"88.420009705000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"31"},{"symbol":"USDC_ETH","openPrice":"0.006267560000000000","lastPrice":"0.006347560000000000","priceChange":"0.000080000000000000","priceChangePercent":"1.2603268027399504691567","bidPrice":"0.006287560000000000","askPrice":"0.006397560000000000","highPrice":"0.006387560000000000","lowPrice":"0.006237560000000000","volume":"205.100000000000000000","quoteVolume":"1.292004556000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"56"},{"symbol":"USDC_UQC","openPrice":"6.000837510000000000","lastPrice":"5.997837510000000000","priceChange":"-0.003000000000000000","priceChangePercent":"-0.0500180272472903321451","bidPrice":"5.973837510000000000","askPrice":"6.002837510000000000","highPrice":"6.005837510000000000","lowPrice":"5.974837510000000000","volume":"93103.120000000000000000","quoteVolume":"557597.534094031200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"49"},{"symbol":"USDC_USDT","openPrice":"0.999067030000000000","lastPrice":"0.999065660000000000","priceChange":"-0.000001370000000000","priceChangePercent":"-0.0001371281242916506609","bidPrice":"0.998999950000000000","askPrice":"0.999099840000000000","highPrice":"0.999096370000000000","lowPrice":"0.999001380000000000","volume":"243883.850000000000000000","quoteVolume":"243653.262038073900000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"58"},{"symbol":"XLM_BTC","openPrice":"0.000018510000000000","lastPrice":"0.000019020000000000","priceChange":"0.000000510000000000","priceChangePercent":"2.6813880126182965299685","bidPrice":"0.000018590000000000","askPrice":"0.000019060000000000","highPrice":"0.000019040000000000","lowPrice":"0.000018510000000000","volume":"203241.300000000000000000","quoteVolume":"3.812449842000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"56"},{"symbol":"XLM_ETH","openPrice":"0.000618910000000000","lastPrice":"0.000629360000000000","priceChange":"0.000010450000000000","priceChangePercent":"1.6604169314859539850006","bidPrice":"0.000627050000000000","askPrice":"0.000634080000000000","highPrice":"0.000633770000000000","lowPrice":"0.000618910000000000","volume":"294.830000000000000000","quoteVolume":"0.184968729100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"62"},{"symbol":"XLM_UQC","openPrice":"0.766574880000000000","lastPrice":"0.826669050000000000","priceChange":"0.060094170000000000","priceChangePercent":"7.2694350901367360977165","bidPrice":"0.812600660000000000","askPrice":"0.860723720000000000","highPrice":"0.864695470000000000","lowPrice":"0.726710470000000000","volume":"31753.810000000000000000","quoteVolume":"25423.974998000800000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"XLM_USDT","openPrice":"0.098701460000000000","lastPrice":"0.100622090000000000","priceChange":"0.001920630000000000","priceChangePercent":"1.9087558209136780999083","bidPrice":"0.099194410000000000","askPrice":"0.101508920000000000","highPrice":"0.101470320000000000","lowPrice":"0.098292500000000000","volume":"117491.230000000000000000","quoteVolume":"11777.934380603100000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"52"},{"symbol":"XRP_BTC","openPrice":"0.000057700000000000","lastPrice":"0.000056310000000000","priceChange":"-0.000001390000000000","priceChangePercent":"-2.4684780678387497780146","bidPrice":"0.000055850000000000","askPrice":"0.000057500000000000","highPrice":"0.000057990000000000","lowPrice":"0.000056290000000000","volume":"278168.200000000000000000","quoteVolume":"15.888703190000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"XRP_ETH","openPrice":"0.001911870000000000","lastPrice":"0.001885910000000000","priceChange":"-0.000025960000000000","priceChangePercent":"-1.3765238001813448149700","bidPrice":"0.001879710000000000","askPrice":"0.001902810000000000","highPrice":"0.001914700000000000","lowPrice":"0.001881110000000000","volume":"210686.830000000000000000","quoteVolume":"399.083032200700000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"43"},{"symbol":"XRP_UQC","openPrice":"2.300558350000000000","lastPrice":"2.559390690000000000","priceChange":"0.258832340000000000","priceChangePercent":"10.1130453045447313086850","bidPrice":"2.460823350000000000","askPrice":"2.587203820000000000","highPrice":"2.601792880000000000","lowPrice":"2.181902860000000000","volume":"183650.600000000000000000","quoteVolume":"442405.889968511500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"61"},{"symbol":"XRP_USDT","openPrice":"0.307466600000000000","lastPrice":"0.303869790000000000","priceChange":"-0.003596810000000000","priceChangePercent":"-1.1836681757669954621024","bidPrice":"0.301434080000000000","askPrice":"0.304972540000000000","highPrice":"0.307466600000000000","lowPrice":"0.301573040000000000","volume":"237454.910000000000000000","quoteVolume":"72227.719204347400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"66"},{"symbol":"XVG_BTC","openPrice":"0.000001940000000000","lastPrice":"0.000001940000000000","priceChange":"0.000000000000000000","priceChangePercent":"0.0000000000000000000000","bidPrice":"0.000001940000000000","askPrice":"0.000001950000000000","highPrice":"0.000001970000000000","lowPrice":"0.000001940000000000","volume":"1980.100000000000000000","quoteVolume":"0.003863940300000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"51"},{"symbol":"XVG_ETH","openPrice":"0.000049340000000000","lastPrice":"0.000049830000000000","priceChange":"0.000000490000000000","priceChangePercent":"0.9833433674493277142284","bidPrice":"0.000049140000000000","askPrice":"0.000049540000000000","highPrice":"0.000050090000000000","lowPrice":"0.000049140000000000","volume":"4400.832000000000000000","quoteVolume":"0.218119639420000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"78"},{"symbol":"XVG_UQC","openPrice":"0.084111350000000000","lastPrice":"0.084101520000000000","priceChange":"-0.000009830000000000","priceChangePercent":"-0.0116882548615054757631","bidPrice":"0.084015170000000000","askPrice":"0.084149350000000000","highPrice":"0.084145990000000000","lowPrice":"0.084028000000000000","volume":"14450.010000000000000000","quoteVolume":"1214.980552120200000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"40"},{"symbol":"XVG_USDT","openPrice":"0.007356320000000000","lastPrice":"0.007380550000000000","priceChange":"0.000024230000000000","priceChangePercent":"0.3282953167446870490682","bidPrice":"0.007330930000000000","askPrice":"0.007455580000000000","highPrice":"0.007440620000000000","lowPrice":"0.007211790000000000","volume":"31785.000000000000000000","quoteVolume":"233.096229737500000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"41"},{"symbol":"ZRX_BTC","openPrice":"0.000052500000000000","lastPrice":"0.000051490000000000","priceChange":"-0.000001010000000000","priceChangePercent":"-1.9615459312487861720722","bidPrice":"0.000051170000000000","askPrice":"0.000052280000000000","highPrice":"0.000052820000000000","lowPrice":"0.000051430000000000","volume":"220321.360000000000000000","quoteVolume":"11.482029587000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"97"},{"symbol":"ZRX_ETH","openPrice":"0.001728910000000000","lastPrice":"0.001728540000000000","priceChange":"-0.000000370000000000","priceChangePercent":"-0.0214053478658289654853","bidPrice":"0.001722810000000000","askPrice":"0.001737300000000000","highPrice":"0.001758520000000000","lowPrice":"0.001667390000000000","volume":"55476.980000000000000000","quoteVolume":"96.307105104000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"89"},{"symbol":"ZRX_UQC","openPrice":"2.066082910000000000","lastPrice":"2.287221730000000000","priceChange":"0.221138820000000000","priceChangePercent":"9.6684469677541932062704","bidPrice":"2.287381910000000000","askPrice":"2.295811250000000000","highPrice":"2.358511300000000000","lowPrice":"2.006237760000000000","volume":"386109.930000000000000000","quoteVolume":"857947.396909737400000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"121"},{"symbol":"ZRX_USDT","openPrice":"0.276862260000000000","lastPrice":"0.275064160000000000","priceChange":"-0.001798100000000000","priceChangePercent":"-0.6537020308280075455850","bidPrice":"0.274891470000000000","askPrice":"0.277108940000000000","highPrice":"0.281159970000000000","lowPrice":"0.275064160000000000","volume":"334765.360000000000000000","quoteVolume":"93135.434232088000000000000000000000","openTime":"1556683728134","closeTime":"1556770128134","numberOfTrades":"81"}]' + http_version: + recorded_at: Thu, 02 May 2019 04:21:56 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/exchanges/omgfin/integration/market_spec.rb b/spec/exchanges/omgfin/integration/market_spec.rb new file mode 100644 index 000000000..e00bb6081 --- /dev/null +++ b/spec/exchanges/omgfin/integration/market_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +RSpec.describe 'Omgfin integration specs' do + let(:client) { Cryptoexchange::Client.new } + let(:market) { 'omgfin' } + let(:bat_btc_pair) { Cryptoexchange::Models::MarketPair.new(base: 'bat', target: 'eth', market: 'omgfin') } + + it 'fetch pairs' do + pairs = client.pairs('omgfin') + expect(pairs).not_to be_empty + + pair = pairs.first + expect(pair.base).to_not be nil + expect(pair.target).to_not be nil + expect(pair.market).to eq 'omgfin' + end + + it 'give trade url' do + trade_page_url = client.trade_page_url market, base: bat_btc_pair.base, target: bat_btc_pair.target + expect(trade_page_url).to eq "https://omgfin.com/exchange/trade/market/BATETH" + end + + it 'fetch ticker' do + ticker = client.ticker(bat_btc_pair) + + expect(ticker.base).to eq 'BAT' + expect(ticker.target).to eq 'ETH' + expect(ticker.market).to eq 'omgfin' + expect(ticker.last).to be_a Numeric + expect(ticker.high).to be_a Numeric + expect(ticker.low).to be_a Numeric + expect(ticker.bid).to be_a Numeric + expect(ticker.ask).to be_a Numeric + expect(ticker.volume).to be_a Numeric + expect(ticker.timestamp).to be nil + + expect(ticker.payload).to_not be nil + end +end diff --git a/spec/exchanges/omgfin/market_spec.rb b/spec/exchanges/omgfin/market_spec.rb new file mode 100644 index 000000000..b30a0b435 --- /dev/null +++ b/spec/exchanges/omgfin/market_spec.rb @@ -0,0 +1,6 @@ +require 'spec_helper' + +RSpec.describe Cryptoexchange::Exchanges::Omgfin::Market do + it { expect(described_class::NAME).to eq 'omgfin' } + it { expect(described_class::API_URL).to eq 'https://omgfin.com/api/v1/ticker/24hr' } +end