cryptum 0.0.278 → 0.0.281

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: 60041b70d1546198473f4cfef476cd56635ffa6d0de8581a6f051c48e837b2ef
4
- data.tar.gz: 3c89c5fd826431cc5ee95ce5368238875fb5be4df2de38cc5cd7a9dc4d7b6e85
3
+ metadata.gz: 99b8305a25439dced16901f0569fa4dd9a2cac394be0757f01796cb461ff3c63
4
+ data.tar.gz: 489296de373d30ff837f4a67ef1059a13f1b2646482f55db44a365dfb7c82145
5
5
  SHA512:
6
- metadata.gz: d412ba56bd5bc779f923c921007730d4733adbb43c9ff8d5b94093c79e6a7538760e26c4dc7af03d753b39daca070448754d8e059d7a211e2caa9629a129a877
7
- data.tar.gz: 39395c647bb87925cd64d74143e04c3e7b252922f7e06517692596c2945cc20d418800628204eb1bffc25774cfbc98067eceb5d373a257f30ad957230acddf8c
6
+ metadata.gz: f37bb82b77e23f4341898a5dc4c629ad1517b281bcdb56ccd8eb4c34230de0fc5ec786054142ed8280c7782239c780ed0693fae3a88196b78c4605c9937c347d
7
+ data.tar.gz: 24a53cf5141f675308efca558149fbdbaea99587de3ae701ab063cfff5c21f16e4ccd9d10928e592c8e337fc033de2d08f78d12d14d507c0809f7a37d8b537dd
@@ -15,27 +15,6 @@ module Cryptum
15
15
  # order_type = opts[:order_type]
16
16
  # order_action = opts[:order_action]
17
17
 
18
- # Consume Latest Order History Justification from
19
- # Order Book & cancel orders tagged as pie
20
- # event_history = Cryptum::API.cancel_synced_oj_and_oh(
21
- # option_choice: option_choice,
22
- # env: env,
23
- # event_history: event_history,
24
- # order_type: order_type,
25
- # order_action: order_action
26
- # )
27
-
28
- # event_history
29
- # event_history.order_canceled = true
30
- # event_history.event_notes = "{ \"event_type\": \"#{event_history.event_type}\", \"cancel\": \"#{event_history.order_canceled}\", \"submitted\": \"#{event_history.order_submitted}\" }" if option_choice.proxy
31
-
32
- # Cryptum::API.cancel_all_open_orders(
33
- # env: env,
34
- # option_choice: option_choice,
35
- # order_type: order_type,
36
- # event_notes: event_history.event_notes
37
- # )
38
-
39
18
  terminal_win.key_press_event.key_c = false
40
19
  Cryptum::API.cancel_all_open_orders(
41
20
  env: env,
@@ -70,33 +70,40 @@ module Cryptum
70
70
 
71
71
  ai_enabled = bot_conf[:artifical_intelligence]
72
72
  gross_tpm = bot_conf[:target_profit_margin_percent].to_f
73
+ order_history = event_history.order_book[:order_history]
74
+ order_history_meta = event_history.order_book[:order_history_meta]
73
75
 
76
+ # VERY EXPENSIVE
74
77
  # Only retain past 24 hours of
75
78
  # order history meta for bought, sold, and expired
76
79
  # keep open limit sell orders indefintely
77
- order_history = event_history.order_book[:order_history]
78
- order_history_meta = event_history.order_book[:order_history_meta]
79
- before_twenty_four_hrs_ago = Time.now - 86_400
80
- order_history_meta.delete_if do |ohm|
81
- next unless ohm[:done_at]
82
- Time.parse(ohm[:done_at]) < before_twenty_four_hrs_ago &&
83
- (
84
- ohm[:color].to_sym == :white ||
85
- ohm[:color].to_sym == :green ||
86
- ohm[:color].to_sym == :cyan ||
87
- ohm[:color].to_sym == :red
88
- )
89
- end
80
+ # before_twenty_four_hrs_ago = Time.now - 86_400
81
+ # order_history_meta.delete_if do |ohm|
82
+ # order_history.find do |oh|
83
+ # next unless oh[:done_at]
84
+
85
+ # Time.parse(oh[:done_at]) < before_twenty_four_hrs_ago && (
86
+ # oh[:id] == ohm[:buy_order_id] ||
87
+ # oh[:id] == ohm[:sell_order_id]
88
+ # ) && (
89
+ # ohm[:color].to_sym == :white ||
90
+ # ohm[:color].to_sym == :green ||
91
+ # ohm[:color].to_sym == :cyan ||
92
+ # ohm[:color].to_sym == :red
93
+ # )
94
+ # end
95
+ # end
90
96
 
91
97
  # Only keep order history meta for those
92
98
  # hashes that exist in the last order history
93
99
  # response
94
100
  order_history_meta.keep_if do |ohm|
95
101
  order_history.find do |oh|
96
- oh[:id] == ohm[:buy_order_id] ||
97
- oh[:id] == ohm[:sell_order_id] ||
98
- ohm[:color].to_sym == :white ||
99
- ohm[:color].to_sym == :green
102
+ (oh[:id] == ohm[:buy_order_id] || oh[:id] == ohm[:sell_order_id]) && (
103
+ ohm[:color].to_sym == :white ||
104
+ ohm[:color].to_sym == :green ||
105
+ ohm[:color].to_sym == :yellow
106
+ )
100
107
  end
101
108
  end
102
109
  event_history.order_book[:order_history_meta] = order_history_meta
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.278'
4
+ VERSION = '0.0.281'
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.278
4
+ version: 0.0.281
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.