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 +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +3 -2
- data/lib/cryptum/event/history.rb +73 -67
- data/lib/cryptum/ui/order/execute.rb +3 -6
- data/lib/cryptum/ui/ticker.rb +6 -2
- data/lib/cryptum/version.rb +1 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b81370975378882cf9d11b55666c23eaea3a61cff3f08d1956972a5e095f159
|
4
|
+
data.tar.gz: e3743593d07506caecb9e2fafbca28ac5202d0c31a5058e2aa5add17b983c25e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b7cf20d9c9709a11efcac82ec138b303552f8fd1e9b5fb5784a768eda511fe97bf8253180cf1d5c3aa49e407eecc481cd367aec318a506748986a10d9c2ac97
|
7
|
+
data.tar.gz: 32a5579e81be9bb4daedf9075a07afe2d25940a87497f05e28fcba4b5dc9433bfd8ca87e5838bf99d1b0c7196a05f54cd7f9d4ab8349a8dd0f42bcac327d85f0
|
data/.rubocop.yml
CHANGED
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.
|
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.
|
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:
|
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 =
|
85
|
-
self.time_between_orders_max =
|
90
|
+
# SLOW BUY = 4 hours
|
91
|
+
self.time_between_orders_max = 14_400
|
86
92
|
|
87
|
-
# FAST BUY =
|
88
|
-
self.time_between_orders =
|
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
|
-
#
|
92
|
-
self.time_between_orders_min =
|
97
|
+
# FASTEST BUY = 10 minutes
|
98
|
+
self.time_between_orders_min = 600
|
93
99
|
when '1D'
|
94
|
-
# SLOW BUY =
|
95
|
-
self.time_between_orders_max =
|
100
|
+
# SLOW BUY = 40 minutes
|
101
|
+
self.time_between_orders_max = 2_400
|
96
102
|
|
97
|
-
# FAST BUY =
|
98
|
-
self.time_between_orders =
|
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
|
-
#
|
102
|
-
self.time_between_orders_min =
|
107
|
+
# FASTEST BUY = 7.5 minutes
|
108
|
+
self.time_between_orders_min = 450
|
103
109
|
when '4h'
|
104
|
-
# SLOW BUY =
|
105
|
-
self.time_between_orders_max =
|
110
|
+
# SLOW BUY = 30 minutes
|
111
|
+
self.time_between_orders_max = 1_800
|
106
112
|
|
107
|
-
# FAST BUY =
|
108
|
-
self.time_between_orders =
|
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
|
-
#
|
112
|
-
self.time_between_orders_min =
|
117
|
+
# FASTEST BUY = 5 minutes
|
118
|
+
self.time_between_orders_min = 300
|
113
119
|
when '3h'
|
114
|
-
# SLOW BUY =
|
115
|
-
self.time_between_orders_max =
|
120
|
+
# SLOW BUY = 20 minutes
|
121
|
+
self.time_between_orders_max = 1_200
|
116
122
|
|
117
|
-
# FAST BUY =
|
118
|
-
self.time_between_orders =
|
123
|
+
# FAST BUY = 10 minutes
|
124
|
+
self.time_between_orders = 600
|
119
125
|
self.time_between_orders_reset = time_between_orders
|
120
126
|
|
121
|
-
#
|
122
|
-
self.time_between_orders_min =
|
127
|
+
# FASTEST BUY = 2.5 minutes
|
128
|
+
self.time_between_orders_min = 150
|
123
129
|
when '2h'
|
124
|
-
# SLOW BUY =
|
125
|
-
self.time_between_orders_max =
|
130
|
+
# SLOW BUY = 10 minutes
|
131
|
+
self.time_between_orders_max = 600
|
126
132
|
|
127
|
-
# FAST BUY =
|
128
|
-
self.time_between_orders =
|
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
|
-
#
|
132
|
-
self.time_between_orders_min =
|
137
|
+
# FASTEST BUY = 50 seconds
|
138
|
+
self.time_between_orders_min = 50
|
133
139
|
when '1h'
|
134
|
-
# SLOW BUY =
|
135
|
-
self.time_between_orders_max =
|
140
|
+
# SLOW BUY = 7.5 minutes
|
141
|
+
self.time_between_orders_max = 450
|
136
142
|
|
137
|
-
# FAST BUY =
|
138
|
-
self.time_between_orders =
|
143
|
+
# FAST BUY = 5 minutes
|
144
|
+
self.time_between_orders = 300
|
139
145
|
self.time_between_orders_reset = time_between_orders
|
140
146
|
|
141
|
-
#
|
142
|
-
self.time_between_orders_min =
|
147
|
+
# FASTEST BUY = 30 seconds
|
148
|
+
self.time_between_orders_min = 30
|
143
149
|
when '45m'
|
144
|
-
# SLOW BUY =
|
145
|
-
self.time_between_orders_max =
|
150
|
+
# SLOW BUY = 5 minutes
|
151
|
+
self.time_between_orders_max = 300
|
146
152
|
|
147
|
-
# FAST BUY =
|
148
|
-
self.time_between_orders =
|
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 =
|
157
|
+
# FASTEST BUY = 1 minute
|
158
|
+
self.time_between_orders_min = 10
|
153
159
|
when '30m'
|
154
|
-
# SLOW BUY =
|
155
|
-
self.time_between_orders_max =
|
160
|
+
# SLOW BUY = 2.5 minutes
|
161
|
+
self.time_between_orders_max = 150
|
156
162
|
|
157
|
-
# FAST BUY =
|
158
|
-
self.time_between_orders =
|
163
|
+
# FAST BUY = 50 seconds
|
164
|
+
self.time_between_orders = 50
|
159
165
|
self.time_between_orders_reset = time_between_orders
|
160
166
|
|
161
|
-
#
|
162
|
-
self.time_between_orders_min =
|
167
|
+
# FASTEST BUY = 10 seconds
|
168
|
+
self.time_between_orders_min = 10
|
163
169
|
when '15m'
|
164
|
-
# SLOW BUY =
|
165
|
-
self.time_between_orders_max =
|
170
|
+
# SLOW BUY = 50 seconds
|
171
|
+
self.time_between_orders_max = 50
|
166
172
|
|
167
|
-
# FAST BUY =
|
168
|
-
self.time_between_orders =
|
173
|
+
# FAST BUY = 30 seconds
|
174
|
+
self.time_between_orders = 30
|
169
175
|
self.time_between_orders_reset = time_between_orders
|
170
176
|
|
171
|
-
#
|
172
|
-
self.time_between_orders_min =
|
177
|
+
# FASTEST BUY = 10 seconds
|
178
|
+
self.time_between_orders_min = 10
|
173
179
|
when '5m'
|
174
|
-
# SLOW BUY =
|
175
|
-
self.time_between_orders_max =
|
180
|
+
# SLOW BUY = 30 seconds
|
181
|
+
self.time_between_orders_max = 30
|
176
182
|
|
177
|
-
# FAST BUY =
|
178
|
-
self.time_between_orders =
|
183
|
+
# FAST BUY = 10 seconds
|
184
|
+
self.time_between_orders = 10
|
179
185
|
self.time_between_orders_reset = time_between_orders
|
180
186
|
|
181
|
-
#
|
182
|
-
self.time_between_orders_min =
|
187
|
+
# FASTEST BUY = 10 seconds
|
188
|
+
self.time_between_orders_min = 10
|
183
189
|
when '3m', '1m'
|
184
|
-
# SLOW BUY =
|
185
|
-
self.time_between_orders_max =
|
190
|
+
# SLOW BUY = 10 seconds
|
191
|
+
self.time_between_orders_max = 10
|
186
192
|
|
187
|
-
# FAST BUY =
|
188
|
-
self.time_between_orders =
|
193
|
+
# FAST BUY = 10 seconds
|
194
|
+
self.time_between_orders = 10
|
189
195
|
self.time_between_orders_reset = time_between_orders
|
190
196
|
|
191
|
-
#
|
192
|
-
self.time_between_orders_min =
|
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
|
87
|
+
# If price is greater than the lowest selling limit order,
|
88
88
|
# force it to be slightly less
|
89
|
-
|
89
|
+
lowest_selling_price = event_history.lowest_selling_price
|
90
90
|
|
91
|
-
|
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",
|
data/lib/cryptum/ui/ticker.rb
CHANGED
@@ -129,10 +129,14 @@ module Cryptum
|
|
129
129
|
order[:price].to_f
|
130
130
|
end
|
131
131
|
|
132
|
-
lowest_selling_price =
|
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",
|
data/lib/cryptum/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
554
|
+
rubygems_version: 3.4.14
|
541
555
|
signing_key:
|
542
556
|
specification_version: 4
|
543
557
|
summary: Coinbase Pro High-Frequency Trading Bot
|