cryptum 0.0.433 → 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: e3b61b5a0ebe81eecdb43a7cf7bca4e49cc090006cfab007590462626fb28239
4
- data.tar.gz: 8fbf942b045ba03aa7021c9fe5be167050b96e83ee90e30db248213120285d69
3
+ metadata.gz: 7b81370975378882cf9d11b55666c23eaea3a61cff3f08d1956972a5e095f159
4
+ data.tar.gz: e3743593d07506caecb9e2fafbca28ac5202d0c31a5058e2aa5add17b983c25e
5
5
  SHA512:
6
- metadata.gz: f2886a045b617888b7267d51e36d175b6de159fbe3b6519be95e9a63925e1b6792f2768437602f00268d8bc7888e9fc2f6a48bc0b4202266a71829de9fd99316
7
- data.tar.gz: 293067aee8934616b86f89d7825e9a48a1842654003a640b3377875154b5c67c3f6def7aba724e0787b6f9fb19b64da23dfa48e4f9d0fbf709a50f2be33d7ee3
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
@@ -27,7 +27,7 @@ gem 'rdoc', '6.5.0'
27
27
  gem 'require_all', '3.0.0'
28
28
  gem 'rest-client', '2.1.0'
29
29
  gem 'rspec', '3.12.0'
30
- gem 'rubocop', '1.53.0'
30
+ gem 'rubocop', '1.53.1'
31
31
  gem 'rubocop-rake', '0.6.0'
32
32
  gem 'rubocop-rspec', '2.22.0'
33
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
@@ -90,7 +94,7 @@ module Cryptum
90
94
  self.time_between_orders = 2_400
91
95
  self.time_between_orders_reset = time_between_orders
92
96
 
93
- # 10 minutes
97
+ # FASTEST BUY = 10 minutes
94
98
  self.time_between_orders_min = 600
95
99
  when '1D'
96
100
  # SLOW BUY = 40 minutes
@@ -100,7 +104,7 @@ module Cryptum
100
104
  self.time_between_orders = 1_800
101
105
  self.time_between_orders_reset = time_between_orders
102
106
 
103
- # 7.5 minutes
107
+ # FASTEST BUY = 7.5 minutes
104
108
  self.time_between_orders_min = 450
105
109
  when '4h'
106
110
  # SLOW BUY = 30 minutes
@@ -110,7 +114,7 @@ module Cryptum
110
114
  self.time_between_orders = 1_200
111
115
  self.time_between_orders_reset = time_between_orders
112
116
 
113
- # 10 minutes
117
+ # FASTEST BUY = 5 minutes
114
118
  self.time_between_orders_min = 300
115
119
  when '3h'
116
120
  # SLOW BUY = 20 minutes
@@ -120,7 +124,7 @@ module Cryptum
120
124
  self.time_between_orders = 600
121
125
  self.time_between_orders_reset = time_between_orders
122
126
 
123
- # 2.5 minutes
127
+ # FASTEST BUY = 2.5 minutes
124
128
  self.time_between_orders_min = 150
125
129
  when '2h'
126
130
  # SLOW BUY = 10 minutes
@@ -130,7 +134,7 @@ module Cryptum
130
134
  self.time_between_orders = 450
131
135
  self.time_between_orders_reset = time_between_orders
132
136
 
133
- # 50 seconds
137
+ # FASTEST BUY = 50 seconds
134
138
  self.time_between_orders_min = 50
135
139
  when '1h'
136
140
  # SLOW BUY = 7.5 minutes
@@ -140,7 +144,7 @@ module Cryptum
140
144
  self.time_between_orders = 300
141
145
  self.time_between_orders_reset = time_between_orders
142
146
 
143
- # 30 seconds
147
+ # FASTEST BUY = 30 seconds
144
148
  self.time_between_orders_min = 30
145
149
  when '45m'
146
150
  # SLOW BUY = 5 minutes
@@ -150,17 +154,17 @@ module Cryptum
150
154
  self.time_between_orders = 150
151
155
  self.time_between_orders_reset = time_between_orders
152
156
 
153
- # 1 minute
157
+ # FASTEST BUY = 1 minute
154
158
  self.time_between_orders_min = 10
155
159
  when '30m'
156
- # SLOW BUY = 15 minutes
160
+ # SLOW BUY = 2.5 minutes
157
161
  self.time_between_orders_max = 150
158
162
 
159
163
  # FAST BUY = 50 seconds
160
164
  self.time_between_orders = 50
161
165
  self.time_between_orders_reset = time_between_orders
162
166
 
163
- # 10 seconds
167
+ # FASTEST BUY = 10 seconds
164
168
  self.time_between_orders_min = 10
165
169
  when '15m'
166
170
  # SLOW BUY = 50 seconds
@@ -170,7 +174,7 @@ module Cryptum
170
174
  self.time_between_orders = 30
171
175
  self.time_between_orders_reset = time_between_orders
172
176
 
173
- # 10 seconds
177
+ # FASTEST BUY = 10 seconds
174
178
  self.time_between_orders_min = 10
175
179
  when '5m'
176
180
  # SLOW BUY = 30 seconds
@@ -180,7 +184,7 @@ module Cryptum
180
184
  self.time_between_orders = 10
181
185
  self.time_between_orders_reset = time_between_orders
182
186
 
183
- # 1 minute
187
+ # FASTEST BUY = 10 seconds
184
188
  self.time_between_orders_min = 10
185
189
  when '3m', '1m'
186
190
  # SLOW BUY = 10 seconds
@@ -190,7 +194,7 @@ module Cryptum
190
194
  self.time_between_orders = 10
191
195
  self.time_between_orders_reset = time_between_orders
192
196
 
193
- # 10 seconds
197
+ # FASTEST BUY = 10 seconds
194
198
  self.time_between_orders_min = 10
195
199
  end
196
200
  # -------------------------------------------------- #
@@ -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.433'
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.433
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-06-23 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
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 1.53.0
243
+ version: 1.53.1
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 1.53.0
250
+ version: 1.53.1
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: rubocop-rake
253
253
  requirement: !ruby/object:Gem::Requirement