cryptum 0.0.342 → 0.0.344

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db5e1c987c7141702b6339e049b643f5b1db8c26e1f980324e88d553232ba7e3
4
- data.tar.gz: cb490c80378fb97909a1546adad4916c9223cf84c9601b742611c97eeb3957c9
3
+ metadata.gz: af839b30214ff1f113a0079db70bb6a5965c5836753da812b1d62876668a64de
4
+ data.tar.gz: 4fb5d3994323c64f31eb2cd3667bf37a32441d976be614e980254d1250bc7b27
5
5
  SHA512:
6
- metadata.gz: ce8189f0d68456ea0ee95fa9989d3666de19e2c4651bb53a64402d305042e37ac69f1042598db1d12d84ce76d33ad4de2183a691cae02f193a5cbba8557d6577
7
- data.tar.gz: 64172f28596d4caf9d3dfd5a13be6c78181f6ea5bcf8e4649661e4ddb85f55723a97a5e312d3e199e1771ab286e3b6cda0325fbd2a45c082e4bb0ba2c4adff2c
6
+ metadata.gz: 702094f2a21b50f6c829a106bc487f5cc1375a4dfa7d890369e33a0ed2d8dacbf0bd286201001b31127488844f7d9c977c7c842822a572fe1e2d22ab7f95b689
7
+ data.tar.gz: 0f9d8e746d200cfca372519ebcc95f4a8db93991caddbce0512079abda9175ae2be822185599332ab759424807fcdb063aa00bba7d45946992cced98cf0b8a4b
data/Gemfile CHANGED
@@ -31,7 +31,7 @@ gem 'rubocop-rake', '0.6.0'
31
31
  gem 'rubocop-rspec', '2.16.0'
32
32
  gem 'ruby-prof', '1.4.3'
33
33
  gem 'rvm', '1.11.3.9'
34
- gem 'sinatra', '3.0.4'
34
+ gem 'sinatra', '3.0.5'
35
35
  gem 'thin', '1.8.1'
36
36
  gem 'tty-prompt', '0.23.1'
37
37
  gem 'tty-spinner', '0.9.3'
@@ -26,17 +26,10 @@ module Cryptum
26
26
  # end
27
27
 
28
28
  # Compatible w/ l2update_batch websocket channel
29
- event[:changes].each do |change|
30
- buy_or_sell = change.first.to_s.to_sym
31
- case buy_or_sell
32
- when :buy
33
- event_history.order_book[:market_trend][:buy] += 1
34
- when :sell
35
- event_history.order_book[:market_trend][:sell] += 1
36
- else
37
- raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
38
- end
39
- end
29
+ buy_count = event[:changes].select { |change| change.first == 'buy' }.length
30
+ sell_count = event[:changes].select { |change| change.first == 'sell' }.length
31
+ event_history.order_book[:market_trend][:buy] += buy_count
32
+ event_history.order_book[:market_trend][:sell] += sell_count
40
33
 
41
34
  indicator_hash = {}
42
35
  buy_total = event_history.order_book[:market_trend][:buy].to_i
@@ -166,7 +166,7 @@ module Cryptum
166
166
  plan_no_slice += 1
167
167
  end
168
168
  order_plan.last[:last_slice] = true if order_plan.any?
169
- op_last_slice_invest = order_plan.last[:invest].to_f
169
+ op_last_slice_invest = order_plan.last[:invest].to_f if order_plan.any?
170
170
  order_plan.last[:invest] = fiat_budget if order_plan.any? &&
171
171
  op_last_slice_invest > fiat_budget &&
172
172
  fiat_budget > min_market_funds.to_f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.342'
4
+ VERSION = '0.0.344'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.342
4
+ version: 0.0.344
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-16 00:00:00.000000000 Z
11
+ date: 2022-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -296,14 +296,14 @@ dependencies:
296
296
  requirements:
297
297
  - - '='
298
298
  - !ruby/object:Gem::Version
299
- version: 3.0.4
299
+ version: 3.0.5
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - '='
305
305
  - !ruby/object:Gem::Version
306
- version: 3.0.4
306
+ version: 3.0.5
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: thin
309
309
  requirement: !ruby/object:Gem::Requirement