cryptum 0.0.339 → 0.0.342

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: 148b9f94b2254f73fc1c0c6edea7f3af776fc2c9612a018906b9135a46934962
4
- data.tar.gz: 2081df684c2c0c9d5f8ee39f38c882401f1457abaea6ac93f0a46f8f98bb5b02
3
+ metadata.gz: db5e1c987c7141702b6339e049b643f5b1db8c26e1f980324e88d553232ba7e3
4
+ data.tar.gz: cb490c80378fb97909a1546adad4916c9223cf84c9601b742611c97eeb3957c9
5
5
  SHA512:
6
- metadata.gz: 4c5c584776a420d525cd9bd8bae0d97ee494eeb2b04e8251990ad0c9eb0410799b02ebb0ddd9eb35cc91bc6b8387b0e646eeacfdf724a2ddbbcc891e756cea28
7
- data.tar.gz: '051492a90a0db7de7993f2348d2ffe067eb843720306ed5b8138331ec494673fdc9c59ebc508c107a330339f93ca519cf55574aa394395fe02dd43b020c524f2'
6
+ metadata.gz: ce8189f0d68456ea0ee95fa9989d3666de19e2c4651bb53a64402d305042e37ac69f1042598db1d12d84ce76d33ad4de2183a691cae02f193a5cbba8557d6577
7
+ data.tar.gz: 64172f28596d4caf9d3dfd5a13be6c78181f6ea5bcf8e4649661e4ddb85f55723a97a5e312d3e199e1771ab286e3b6cda0325fbd2a45c082e4bb0ba2c4adff2c
@@ -14,14 +14,28 @@ module Cryptum
14
14
  event = opts[:event]
15
15
  indicator_status = opts[:indicator_status]
16
16
 
17
- buy_or_sell = event[:changes].first[0].to_s.to_sym
18
- case buy_or_sell
19
- when :buy
20
- event_history.order_book[:market_trend][:buy] += 1
21
- when :sell
22
- event_history.order_book[:market_trend][:sell] += 1
23
- else
24
- raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
17
+ # Compatible w/ l2update websocket channel
18
+ # buy_or_sell = event[:changes].first[0].to_s.to_sym
19
+ # case buy_or_sell
20
+ # when :buy
21
+ # event_history.order_book[:market_trend][:buy] += 1
22
+ # when :sell
23
+ # event_history.order_book[:market_trend][:sell] += 1
24
+ # else
25
+ # raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
26
+ # end
27
+
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
25
39
  end
26
40
 
27
41
  indicator_hash = {}
@@ -166,6 +166,11 @@ 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
170
+ order_plan.last[:invest] = fiat_budget if order_plan.any? &&
171
+ op_last_slice_invest > fiat_budget &&
172
+ fiat_budget > min_market_funds.to_f
173
+
169
174
  event_history.order_book[:order_plan] = order_plan
170
175
  end
171
176
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.339'
4
+ VERSION = '0.0.342'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.339
4
+ version: 0.0.342
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.