Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Commit

Permalink
Fix last for btcturk and rfinex, divide volume for instantbitex
Browse files Browse the repository at this point in the history
  • Loading branch information
tmlee committed Aug 10, 2018
1 parent dbcef70 commit 5100e7b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/btcturk/services/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def adapt(market_pair, output)
ticker.base = market_pair.base
ticker.target = market_pair.target
ticker.market = Btcturk::Market::NAME
ticker.last = NumericHelper.to_d(output['close'].to_f)
ticker.last = NumericHelper.to_d(output['last'].to_f)
ticker.high = NumericHelper.to_d(output['high'].to_f)
ticker.low = NumericHelper.to_d(output['low'].to_f)
ticker.bid = NumericHelper.to_d(output['bid'].to_f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def adapt(market_pair, output)
ticker.ask = NumericHelper.to_d(output['lowestAsk'].to_f)
ticker.high = NumericHelper.to_d(output['high24hr'].to_f)
ticker.low = NumericHelper.to_d(output['low24hr'].to_f)
ticker.volume = NumericHelper.to_d(output['volume24hr'].to_f)
ticker.volume = NumericHelper.divide(NumericHelper.to_d(output['volume24hr'].to_f), ticker.last)
ticker.timestamp = Time.now.to_i
ticker.payload = output
ticker
Expand Down
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/rfinex/services/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def adapt(market_pair, output)
ticker.base = market_pair.base
ticker.target = market_pair.target
ticker.market = Rfinex::Market::NAME
ticker.last = NumericHelper.to_d(output['ticker']['close'].to_f)
ticker.last = NumericHelper.to_d(output['ticker']['last'].to_f)
ticker.high = NumericHelper.to_d(output['ticker']['high'].to_f)
ticker.low = NumericHelper.to_d(output['ticker']['low'].to_f)
ticker.bid = NumericHelper.to_d(output['ticker']['buy'].to_f)
Expand Down
2 changes: 1 addition & 1 deletion spec/exchanges/btcturk/integration/market_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
expect(ticker.base).to eq 'BTC'
expect(ticker.target).to eq 'TRY'
expect(ticker.market).to eq 'btcturk'
expect(ticker.last).to be_a Numeric
expect(ticker.last).to be > 0.0
expect(ticker.low).to be_a Numeric
expect(ticker.high).to be_a Numeric
expect(ticker.bid).to be_a Numeric
Expand Down
2 changes: 1 addition & 1 deletion spec/exchanges/rfinex/integration/market_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
expect(ticker.base).to eq 'EOS'
expect(ticker.target).to eq 'ETH'
expect(ticker.market).to eq 'rfinex'
expect(ticker.last).to be_a Numeric
expect(ticker.last).to be > 0.0
expect(ticker.low).to be_a Numeric
expect(ticker.high).to be_a Numeric
expect(ticker.bid).to be_a Numeric
Expand Down

0 comments on commit 5100e7b

Please sign in to comment.