cryptum 0.0.432 → 0.0.434

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: 3f84b25db89b6e6e4cf9b50130516a44e64eba480a1e567aba5619bae57b118d
4
- data.tar.gz: ea62f0ff2be5facfb7823012ed7b28a7590b8fa046d378f9836f7a0fa91e9838
3
+ metadata.gz: 7b81370975378882cf9d11b55666c23eaea3a61cff3f08d1956972a5e095f159
4
+ data.tar.gz: e3743593d07506caecb9e2fafbca28ac5202d0c31a5058e2aa5add17b983c25e
5
5
  SHA512:
6
- metadata.gz: 8976c39e002384261258f717f436a77376dbfe1af3c3173d70f9905ea9c55007988c24fc3f990b4486145e7ddbeb1c706d6414fdb1cc9be72f0e39efb8bcb68c
7
- data.tar.gz: 1966b1868954202ee6151ac1a0bf6a4e7d03915925fdb4b0da075120e2bfdd8a0fa344a8ade889cec6b95ffa6f2f25e11f31ffc57eef0c89f6ab6e2919bba4d6
6
+ metadata.gz: 2b7cf20d9c9709a11efcac82ec138b303552f8fd1e9b5fb5784a768eda511fe97bf8253180cf1d5c3aa49e407eecc481cd367aec318a506748986a10d9c2ac97
7
+ data.tar.gz: 32a5579e81be9bb4daedf9075a07afe2d25940a87497f05e28fcba4b5dc9433bfd8ca87e5838bf99d1b0c7196a05f54cd7f9d4ab8349a8dd0f42bcac327d85f0
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ Metrics/BlockLength:
12
12
  Metrics/BlockNesting:
13
13
  Max: 4
14
14
  Metrics/ClassLength:
15
- Max: 128
15
+ Max: 132
16
16
  Metrics/CyclomaticComplexity:
17
17
  Max: 86
18
18
  Metrics/MethodLength:
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.13'
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,7 +27,7 @@ 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.1'
30
31
  gem 'rubocop-rake', '0.6.0'
31
32
  gem 'rubocop-rspec', '2.22.0'
32
33
  gem 'ruby-prof', '1.6.3'
@@ -10,6 +10,8 @@ module Cryptum
10
10
  :event_notes,
11
11
  :event_type,
12
12
  :first_event,
13
+ :highest_selling_price,
14
+ :lowest_selling_price,
13
15
  :market_trend_event,
14
16
  :open_sell_orders,
15
17
  :open_sell_orders_max,
@@ -49,6 +51,8 @@ module Cryptum
49
51
 
50
52
  self.bullish_trend = true
51
53
  self.first_event = true
54
+ self.highest_selling_price = 0.00
55
+ self.lowest_selling_price = 0.00
52
56
  self.open_sell_orders = 0
53
57
  self.open_sell_orders_max = 500
54
58
  self.open_sell_orders_merge = false
@@ -78,118 +82,120 @@ module Cryptum
78
82
 
79
83
  # -------------------------------------------------- #
80
84
  # SAUCE 3 (SAUCE 4 RELATES TO SAUCE 3)
81
- # TODO: Consider --reset-trend-countdown
85
+ # TODO: Divide current values by 6 and rely
86
+ # upon the last order value to mitigate
87
+ # portfolio exhaustion.
82
88
  case option_choice.market_trend_reset_label
83
89
  when '1W'
84
- # SLOW BUY = 1 day
85
- self.time_between_orders_max = 86_400
90
+ # SLOW BUY = 4 hours
91
+ self.time_between_orders_max = 14_400
86
92
 
87
- # FAST BUY = 4 hours
88
- self.time_between_orders = 14_400
93
+ # FAST BUY = 40 minutes
94
+ self.time_between_orders = 2_400
89
95
  self.time_between_orders_reset = time_between_orders
90
96
 
91
- # 1 hour
92
- self.time_between_orders_min = 3_600
97
+ # FASTEST BUY = 10 minutes
98
+ self.time_between_orders_min = 600
93
99
  when '1D'
94
- # SLOW BUY = 4 hours
95
- self.time_between_orders_max = 14_400
100
+ # SLOW BUY = 40 minutes
101
+ self.time_between_orders_max = 2_400
96
102
 
97
- # FAST BUY = 3 hours
98
- self.time_between_orders = 10_800
103
+ # FAST BUY = 30 minutes
104
+ self.time_between_orders = 1_800
99
105
  self.time_between_orders_reset = time_between_orders
100
106
 
101
- # 45 minutes
102
- self.time_between_orders_min = 2_700
107
+ # FASTEST BUY = 7.5 minutes
108
+ self.time_between_orders_min = 450
103
109
  when '4h'
104
- # SLOW BUY = 3 hours
105
- self.time_between_orders_max = 10_800
110
+ # SLOW BUY = 30 minutes
111
+ self.time_between_orders_max = 1_800
106
112
 
107
- # FAST BUY = 2 hours
108
- self.time_between_orders = 7_200
113
+ # FAST BUY = 20 minutes
114
+ self.time_between_orders = 1_200
109
115
  self.time_between_orders_reset = time_between_orders
110
116
 
111
- # 30 minutes
112
- self.time_between_orders_min = 1_800
117
+ # FASTEST BUY = 5 minutes
118
+ self.time_between_orders_min = 300
113
119
  when '3h'
114
- # SLOW BUY = 2 hours
115
- self.time_between_orders_max = 7_200
120
+ # SLOW BUY = 20 minutes
121
+ self.time_between_orders_max = 1_200
116
122
 
117
- # FAST BUY = 1 hour
118
- self.time_between_orders = 3_600
123
+ # FAST BUY = 10 minutes
124
+ self.time_between_orders = 600
119
125
  self.time_between_orders_reset = time_between_orders
120
126
 
121
- # 15 minutes
122
- self.time_between_orders_min = 900
127
+ # FASTEST BUY = 2.5 minutes
128
+ self.time_between_orders_min = 150
123
129
  when '2h'
124
- # SLOW BUY = 1 hour
125
- self.time_between_orders_max = 3_600
130
+ # SLOW BUY = 10 minutes
131
+ self.time_between_orders_max = 600
126
132
 
127
- # FAST BUY = 45 minutes
128
- self.time_between_orders = 2_700
133
+ # FAST BUY = 7.5 minutes
134
+ self.time_between_orders = 450
129
135
  self.time_between_orders_reset = time_between_orders
130
136
 
131
- # 5 minutes
132
- self.time_between_orders_min = 300
137
+ # FASTEST BUY = 50 seconds
138
+ self.time_between_orders_min = 50
133
139
  when '1h'
134
- # SLOW BUY = 45 minutes
135
- self.time_between_orders_max = 2_700
140
+ # SLOW BUY = 7.5 minutes
141
+ self.time_between_orders_max = 450
136
142
 
137
- # FAST BUY = 30 minutes
138
- self.time_between_orders = 1_800
143
+ # FAST BUY = 5 minutes
144
+ self.time_between_orders = 300
139
145
  self.time_between_orders_reset = time_between_orders
140
146
 
141
- # 3 minutes
142
- self.time_between_orders_min = 180
147
+ # FASTEST BUY = 30 seconds
148
+ self.time_between_orders_min = 30
143
149
  when '45m'
144
- # SLOW BUY = 30 minutes
145
- self.time_between_orders_max = 1_800
150
+ # SLOW BUY = 5 minutes
151
+ self.time_between_orders_max = 300
146
152
 
147
- # FAST BUY = 15 minutes
148
- self.time_between_orders = 900
153
+ # FAST BUY = 2.5 minutes
154
+ self.time_between_orders = 150
149
155
  self.time_between_orders_reset = time_between_orders
150
156
 
151
- # 1 minute
152
- self.time_between_orders_min = 60
157
+ # FASTEST BUY = 1 minute
158
+ self.time_between_orders_min = 10
153
159
  when '30m'
154
- # SLOW BUY = 15 minutes
155
- self.time_between_orders_max = 900
160
+ # SLOW BUY = 2.5 minutes
161
+ self.time_between_orders_max = 150
156
162
 
157
- # FAST BUY = 5 minutes
158
- self.time_between_orders = 300
163
+ # FAST BUY = 50 seconds
164
+ self.time_between_orders = 50
159
165
  self.time_between_orders_reset = time_between_orders
160
166
 
161
- # 1 minute
162
- self.time_between_orders_min = 60
167
+ # FASTEST BUY = 10 seconds
168
+ self.time_between_orders_min = 10
163
169
  when '15m'
164
- # SLOW BUY = 5 minutes
165
- self.time_between_orders_max = 300
170
+ # SLOW BUY = 50 seconds
171
+ self.time_between_orders_max = 50
166
172
 
167
- # FAST BUY = 3 minutes
168
- self.time_between_orders = 180
173
+ # FAST BUY = 30 seconds
174
+ self.time_between_orders = 30
169
175
  self.time_between_orders_reset = time_between_orders
170
176
 
171
- # 1 minute
172
- self.time_between_orders_min = 60
177
+ # FASTEST BUY = 10 seconds
178
+ self.time_between_orders_min = 10
173
179
  when '5m'
174
- # SLOW BUY = 3 minutes
175
- self.time_between_orders_max = 180
180
+ # SLOW BUY = 30 seconds
181
+ self.time_between_orders_max = 30
176
182
 
177
- # FAST BUY = 1 minute
178
- self.time_between_orders = 60
183
+ # FAST BUY = 10 seconds
184
+ self.time_between_orders = 10
179
185
  self.time_between_orders_reset = time_between_orders
180
186
 
181
- # 1 minute
182
- self.time_between_orders_min = 60
187
+ # FASTEST BUY = 10 seconds
188
+ self.time_between_orders_min = 10
183
189
  when '3m', '1m'
184
- # SLOW BUY = 1 minute
185
- self.time_between_orders_max = 60
190
+ # SLOW BUY = 10 seconds
191
+ self.time_between_orders_max = 10
186
192
 
187
- # FAST BUY = 1 minute
188
- self.time_between_orders = 60
193
+ # FAST BUY = 10 seconds
194
+ self.time_between_orders = 10
189
195
  self.time_between_orders_reset = time_between_orders
190
196
 
191
- # 1 minute
192
- self.time_between_orders_min = 60
197
+ # FASTEST BUY = 10 seconds
198
+ self.time_between_orders_min = 10
193
199
  end
194
200
  # -------------------------------------------------- #
195
201
  end
@@ -84,14 +84,11 @@ module Cryptum
84
84
 
85
85
  this_order = event_history.order_book[:order_plan].first
86
86
 
87
- # If price is greater than the previous order,
87
+ # If price is greater than the lowest selling limit order,
88
88
  # force it to be slightly less
89
- last_order = order_history_meta.reverse.find { |o| o[:color] == 'yellow' }
89
+ lowest_selling_price = event_history.lowest_selling_price
90
90
 
91
- last_purchase_price = 0.0
92
- last_purchase_price = last_order[:price].to_f if last_order
93
-
94
- limit_price = last_purchase_price - quote_increment.to_f if last_purchase_price.positive? && last_purchase_price < limit_price
91
+ limit_price = lowest_selling_price - quote_increment.to_f if lowest_selling_price.positive? && lowest_selling_price < limit_price
95
92
 
96
93
  price = format(
97
94
  "%0.#{fiat_smallest_decimal}f",
@@ -129,10 +129,14 @@ module Cryptum
129
129
  order[:price].to_f
130
130
  end
131
131
 
132
- lowest_selling_price = '0.00'
133
- highest_selling_price = '0.00'
132
+ lowest_selling_price = event_history.lowest_selling_price
134
133
  lowest_selling_price = sorted_open_sell_orders.first[:price] unless sorted_open_sell_orders.empty?
134
+ event_history.lowest_selling_price = lowest_selling_price.to_f
135
+
136
+ highest_selling_price = event_history.highest_selling_price
135
137
  highest_selling_price = sorted_open_sell_orders.last[:price] unless sorted_open_sell_orders.empty?
138
+ event_history.highest_selling_price = highest_selling_price.to_f
139
+
136
140
  lowest_selling_price_out = Cryptum.beautify_large_number(
137
141
  value: format(
138
142
  "%0.#{fiat_smallest_decimal}f",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.432'
4
+ VERSION = '0.0.434'
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.432
4
+ version: 0.0.434
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-12 00:00:00.000000000 Z
11
+ date: 2023-06-26 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.13
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.13
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.1
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.1
237
251
  - !ruby/object:Gem::Dependency
238
252
  name: rubocop-rake
239
253
  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.13
554
+ rubygems_version: 3.4.14
541
555
  signing_key:
542
556
  specification_version: 4
543
557
  summary: Coinbase Pro High-Frequency Trading Bot