cryptum 0.0.431 → 0.0.433

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: efc9ac08fc48ca7aa7674359ea95d662af6cade3fc2a0249b19ce03bc996f3fb
4
- data.tar.gz: 3b6ddc0e658f076ee6f80f2f4a399d9192292c2ce090a7056b26c51a0cb7fd2a
3
+ metadata.gz: e3b61b5a0ebe81eecdb43a7cf7bca4e49cc090006cfab007590462626fb28239
4
+ data.tar.gz: 8fbf942b045ba03aa7021c9fe5be167050b96e83ee90e30db248213120285d69
5
5
  SHA512:
6
- metadata.gz: aff4e41fe11057b9d0b401c78b27dae432a8756ec6a02b265b5b1eb580999954d0ae8ace3390804544920f89eeed141467d240f346603582a100ba6b1885ed61
7
- data.tar.gz: da014125c73aba67a997bb76b2a9476a1074b35ae51973b4b6a44833ab3bc5c410c572d249ddfae3116f1e75581c18ec74daf6254a2610c56bdd4b632322fe43
6
+ metadata.gz: f2886a045b617888b7267d51e36d175b6de159fbe3b6519be95e9a63925e1b6792f2768437602f00268d8bc7888e9fc2f6a48bc0b4202266a71829de9fd99316
7
+ data.tar.gz: 293067aee8934616b86f89d7825e9a48a1842654003a640b3377875154b5c67c3f6def7aba724e0787b6f9fb19b64da23dfa48e4f9d0fbf709a50f2be33d7ee3
data/Gemfile CHANGED
@@ -12,11 +12,12 @@ gemspec
12
12
  # to build appropriately. Defer to ./reinstall_coinbot_gemset.sh
13
13
  # to review these custom flags
14
14
  gem 'addressable', '2.8.4'
15
- gem 'bundler', '>=2.4.12'
15
+ gem 'bundler', '>=2.4.14'
16
16
  gem 'bundler-audit', '0.9.1'
17
17
  gem 'curses', '1.4.4'
18
18
  gem 'eventmachine', '1.2.7'
19
19
  gem 'faye-websocket', '0.11.2'
20
+ gem 'neovim', '0.9.0'
20
21
  gem 'permessage_deflate', '0.1.4'
21
22
  gem 'pry', '0.14.2'
22
23
  gem 'pry-doc', '1.4.0'
@@ -26,9 +27,9 @@ gem 'rdoc', '6.5.0'
26
27
  gem 'require_all', '3.0.0'
27
28
  gem 'rest-client', '2.1.0'
28
29
  gem 'rspec', '3.12.0'
29
- gem 'rubocop', '1.50.2'
30
+ gem 'rubocop', '1.53.0'
30
31
  gem 'rubocop-rake', '0.6.0'
31
- gem 'rubocop-rspec', '2.20.0'
32
+ gem 'rubocop-rspec', '2.22.0'
32
33
  gem 'ruby-prof', '1.6.3'
33
34
  gem 'rvm', '1.11.3.9'
34
35
  gem 'sinatra', '3.0.6'
@@ -78,118 +78,120 @@ module Cryptum
78
78
 
79
79
  # -------------------------------------------------- #
80
80
  # SAUCE 3 (SAUCE 4 RELATES TO SAUCE 3)
81
- # TODO: Consider --reset-trend-countdown
81
+ # TODO: Divide current values by 6 and rely
82
+ # upon the last order value to mitigate
83
+ # portfolio exhaustion.
82
84
  case option_choice.market_trend_reset_label
83
85
  when '1W'
84
- # SLOW BUY = 1 day
85
- self.time_between_orders_max = 86_400
86
+ # SLOW BUY = 4 hours
87
+ self.time_between_orders_max = 14_400
86
88
 
87
- # FAST BUY = 4 hours
88
- self.time_between_orders = 14_400
89
+ # FAST BUY = 40 minutes
90
+ self.time_between_orders = 2_400
89
91
  self.time_between_orders_reset = time_between_orders
90
92
 
91
- # 1 hour
92
- self.time_between_orders_min = 3_600
93
+ # 10 minutes
94
+ self.time_between_orders_min = 600
93
95
  when '1D'
94
- # SLOW BUY = 4 hours
95
- self.time_between_orders_max = 14_400
96
+ # SLOW BUY = 40 minutes
97
+ self.time_between_orders_max = 2_400
96
98
 
97
- # FAST BUY = 3 hours
98
- self.time_between_orders = 10_800
99
+ # FAST BUY = 30 minutes
100
+ self.time_between_orders = 1_800
99
101
  self.time_between_orders_reset = time_between_orders
100
102
 
101
- # 45 minutes
102
- self.time_between_orders_min = 2_700
103
+ # 7.5 minutes
104
+ self.time_between_orders_min = 450
103
105
  when '4h'
104
- # SLOW BUY = 3 hours
105
- self.time_between_orders_max = 10_800
106
+ # SLOW BUY = 30 minutes
107
+ self.time_between_orders_max = 1_800
106
108
 
107
- # FAST BUY = 2 hours
108
- self.time_between_orders = 7_200
109
+ # FAST BUY = 20 minutes
110
+ self.time_between_orders = 1_200
109
111
  self.time_between_orders_reset = time_between_orders
110
112
 
111
- # 30 minutes
112
- self.time_between_orders_min = 1_800
113
+ # 10 minutes
114
+ self.time_between_orders_min = 300
113
115
  when '3h'
114
- # SLOW BUY = 2 hours
115
- self.time_between_orders_max = 7_200
116
+ # SLOW BUY = 20 minutes
117
+ self.time_between_orders_max = 1_200
116
118
 
117
- # FAST BUY = 1 hour
118
- self.time_between_orders = 3_600
119
+ # FAST BUY = 10 minutes
120
+ self.time_between_orders = 600
119
121
  self.time_between_orders_reset = time_between_orders
120
122
 
121
- # 15 minutes
122
- self.time_between_orders_min = 900
123
+ # 2.5 minutes
124
+ self.time_between_orders_min = 150
123
125
  when '2h'
124
- # SLOW BUY = 1 hour
125
- self.time_between_orders_max = 3_600
126
+ # SLOW BUY = 10 minutes
127
+ self.time_between_orders_max = 600
126
128
 
127
- # FAST BUY = 45 minutes
128
- self.time_between_orders = 2_700
129
+ # FAST BUY = 7.5 minutes
130
+ self.time_between_orders = 450
129
131
  self.time_between_orders_reset = time_between_orders
130
132
 
131
- # 5 minutes
132
- self.time_between_orders_min = 300
133
+ # 50 seconds
134
+ self.time_between_orders_min = 50
133
135
  when '1h'
134
- # SLOW BUY = 45 minutes
135
- self.time_between_orders_max = 2_700
136
+ # SLOW BUY = 7.5 minutes
137
+ self.time_between_orders_max = 450
136
138
 
137
- # FAST BUY = 30 minutes
138
- self.time_between_orders = 1_800
139
+ # FAST BUY = 5 minutes
140
+ self.time_between_orders = 300
139
141
  self.time_between_orders_reset = time_between_orders
140
142
 
141
- # 3 minutes
142
- self.time_between_orders_min = 180
143
+ # 30 seconds
144
+ self.time_between_orders_min = 30
143
145
  when '45m'
144
- # SLOW BUY = 30 minutes
145
- self.time_between_orders_max = 1_800
146
+ # SLOW BUY = 5 minutes
147
+ self.time_between_orders_max = 300
146
148
 
147
- # FAST BUY = 15 minutes
148
- self.time_between_orders = 900
149
+ # FAST BUY = 2.5 minutes
150
+ self.time_between_orders = 150
149
151
  self.time_between_orders_reset = time_between_orders
150
152
 
151
153
  # 1 minute
152
- self.time_between_orders_min = 60
154
+ self.time_between_orders_min = 10
153
155
  when '30m'
154
156
  # SLOW BUY = 15 minutes
155
- self.time_between_orders_max = 900
157
+ self.time_between_orders_max = 150
156
158
 
157
- # FAST BUY = 5 minutes
158
- self.time_between_orders = 300
159
+ # FAST BUY = 50 seconds
160
+ self.time_between_orders = 50
159
161
  self.time_between_orders_reset = time_between_orders
160
162
 
161
- # 1 minute
162
- self.time_between_orders_min = 60
163
+ # 10 seconds
164
+ self.time_between_orders_min = 10
163
165
  when '15m'
164
- # SLOW BUY = 5 minutes
165
- self.time_between_orders_max = 300
166
+ # SLOW BUY = 50 seconds
167
+ self.time_between_orders_max = 50
166
168
 
167
- # FAST BUY = 3 minutes
168
- self.time_between_orders = 180
169
+ # FAST BUY = 30 seconds
170
+ self.time_between_orders = 30
169
171
  self.time_between_orders_reset = time_between_orders
170
172
 
171
- # 1 minute
172
- self.time_between_orders_min = 60
173
+ # 10 seconds
174
+ self.time_between_orders_min = 10
173
175
  when '5m'
174
- # SLOW BUY = 3 minutes
175
- self.time_between_orders_max = 180
176
+ # SLOW BUY = 30 seconds
177
+ self.time_between_orders_max = 30
176
178
 
177
- # FAST BUY = 1 minute
178
- self.time_between_orders = 60
179
+ # FAST BUY = 10 seconds
180
+ self.time_between_orders = 10
179
181
  self.time_between_orders_reset = time_between_orders
180
182
 
181
183
  # 1 minute
182
- self.time_between_orders_min = 60
184
+ self.time_between_orders_min = 10
183
185
  when '3m', '1m'
184
- # SLOW BUY = 1 minute
185
- self.time_between_orders_max = 60
186
+ # SLOW BUY = 10 seconds
187
+ self.time_between_orders_max = 10
186
188
 
187
- # FAST BUY = 1 minute
188
- self.time_between_orders = 60
189
+ # FAST BUY = 10 seconds
190
+ self.time_between_orders = 10
189
191
  self.time_between_orders_reset = time_between_orders
190
192
 
191
- # 1 minute
192
- self.time_between_orders_min = 60
193
+ # 10 seconds
194
+ self.time_between_orders_min = 10
193
195
  end
194
196
  # -------------------------------------------------- #
195
197
  end
@@ -13,7 +13,7 @@ module Cryptum
13
13
  terminal_win = opts[:terminal_win]
14
14
  event_history = opts[:event_history]
15
15
 
16
- terminal_win.key_press_event.key_w = false
16
+ terminal_win.key_press_event.key_w = false unless terminal_win.nil?
17
17
  order_book_file = event_history.order_book[:path]
18
18
 
19
19
  File.write(
@@ -108,7 +108,7 @@ module Cryptum
108
108
  )
109
109
  recalc_op = event_history.recalculate_order_plan
110
110
  order_plan = event_history.order_book[:order_plan]
111
- terminal_win.key_press_event.key_w = true if (recalc_op || order_plan.empty?) &&
111
+ terminal_win.key_press_event.key_w = true if (event_history.order_ready || recalc_op || order_plan.empty?) &&
112
112
  !event_history.red_pill
113
113
  event_history.recalculate_order_plan = false
114
114
  end
@@ -73,10 +73,10 @@ module Cryptum
73
73
 
74
74
  # Only keep order history meta for those hashes
75
75
  # that exist in the last order history response
76
- # :white ones will be kept for 24 hrs and handled
77
- # via Cryptum::OrderBook::MarketTrend.reset
78
- # This exist primarily to clean up meta data if the
79
- # bot crashes.
76
+ # :white ones will be kept for at least 24 hrs
77
+ # and handled via Cryptum::OrderBook::MarketTrend.reset
78
+ # This exist primarily to clean up "zombie" meta
79
+ # data entries if the bot crashes for whatever reason.
80
80
  order_book[:order_history_meta].keep_if do |ohm|
81
81
  order_book[:order_history].find do |oh|
82
82
  (oh[:id] == ohm[:buy_order_id] || oh[:id] == ohm[:sell_order_id]) && (
@@ -23,13 +23,7 @@ module Cryptum
23
23
  Cryptum::Log.append(level: :fatal, msg: e, which_self: self, event_history: event_history)
24
24
  exit 1
25
25
  ensure
26
- if event_history
27
- order_book_file = event_history.order_book[:path]
28
- File.write(
29
- order_book_file,
30
- JSON.pretty_generate(event_history.order_book)
31
- )
32
- end
26
+ Cryptum::Event::OrderBook.write(event_history: event_history) if event_history
33
27
  end
34
28
 
35
29
  # Display a List of Every UI Module
@@ -86,9 +86,7 @@ module Cryptum
86
86
 
87
87
  # If price is greater than the previous order,
88
88
  # force it to be slightly less
89
- last_order = order_history_meta.select do |order|
90
- order if order[:color] == 'yellow'
91
- end.last
89
+ last_order = order_history_meta.reverse.find { |o| o[:color] == 'yellow' }
92
90
 
93
91
  last_purchase_price = 0.0
94
92
  last_purchase_price = last_order[:price].to_f if last_order
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.431'
4
+ VERSION = '0.0.433'
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.431
4
+ version: 0.0.433
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-03 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.12
33
+ version: 2.4.14
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.4.12
40
+ version: 2.4.14
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler-audit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.11.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: neovim
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.9.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.9.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: permessage_deflate
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +240,14 @@ dependencies:
226
240
  requirements:
227
241
  - - '='
228
242
  - !ruby/object:Gem::Version
229
- version: 1.50.2
243
+ version: 1.53.0
230
244
  type: :runtime
231
245
  prerelease: false
232
246
  version_requirements: !ruby/object:Gem::Requirement
233
247
  requirements:
234
248
  - - '='
235
249
  - !ruby/object:Gem::Version
236
- version: 1.50.2
250
+ version: 1.53.0
237
251
  - !ruby/object:Gem::Dependency
238
252
  name: rubocop-rake
239
253
  requirement: !ruby/object:Gem::Requirement
@@ -254,14 +268,14 @@ dependencies:
254
268
  requirements:
255
269
  - - '='
256
270
  - !ruby/object:Gem::Version
257
- version: 2.20.0
271
+ version: 2.22.0
258
272
  type: :runtime
259
273
  prerelease: false
260
274
  version_requirements: !ruby/object:Gem::Requirement
261
275
  requirements:
262
276
  - - '='
263
277
  - !ruby/object:Gem::Version
264
- version: 2.20.0
278
+ version: 2.22.0
265
279
  - !ruby/object:Gem::Dependency
266
280
  name: ruby-prof
267
281
  requirement: !ruby/object:Gem::Requirement
@@ -537,7 +551,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
537
551
  - !ruby/object:Gem::Version
538
552
  version: '0'
539
553
  requirements: []
540
- rubygems_version: 3.4.12
554
+ rubygems_version: 3.4.14
541
555
  signing_key:
542
556
  specification_version: 4
543
557
  summary: Coinbase Pro High-Frequency Trading Bot