cryptum 0.0.243 → 0.0.245
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +9 -9
- data/Gemfile +6 -6
- data/lib/cryptum/option.rb +2 -2
- data/lib/cryptum/ui/order_execution.rb +15 -8
- data/lib/cryptum/ui/order_plan.rb +1 -2
- data/lib/cryptum/version.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c5b9a16f71a7dcc971f918677943e02e0dfceeb55ecb40342ba5f18fdd85ac9
|
4
|
+
data.tar.gz: 43856d1136a6436b09f99d3a65cd2d2f4d74f80f7034b9455ce410490e7d2a86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17dd882e79f5fbb8d2230bdb079579c981bbe6aa730abd804cbdc53a5ed851f3fc87c211f1e3f3288160228882d4b8e3ec5789a1f8a8bb4a45a508210f29805
|
7
|
+
data.tar.gz: 8a11adb77f1ce42b72ce217a3c2618de30150166df6539455254c34c9490c4a9c1e0cf885bd71e459046a68e73f1131c5b747a2654f87b60c220e32c2d1a342e
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2022-07-
|
3
|
+
# on 2022-07-06 00:27:10 UTC using RuboCop version 1.31.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -20,12 +20,13 @@ Layout/ClosingParenthesisIndentation:
|
|
20
20
|
Exclude:
|
21
21
|
- 'lib/cryptum/ui/order_execution.rb'
|
22
22
|
|
23
|
-
# Offense count:
|
23
|
+
# Offense count: 2
|
24
24
|
# This cop supports safe autocorrection (--autocorrect).
|
25
25
|
# Configuration parameters: AllowForAlignment.
|
26
26
|
Layout/CommentIndentation:
|
27
27
|
Exclude:
|
28
28
|
- 'lib/cryptum/api.rb'
|
29
|
+
- 'lib/cryptum/ui/order_execution.rb'
|
29
30
|
|
30
31
|
# Offense count: 4
|
31
32
|
# This cop supports safe autocorrection (--autocorrect).
|
@@ -48,7 +49,7 @@ Layout/ExtraSpacing:
|
|
48
49
|
Exclude:
|
49
50
|
- 'lib/cryptum/ui/order_plan.rb'
|
50
51
|
|
51
|
-
# Offense count:
|
52
|
+
# Offense count: 1
|
52
53
|
# This cop supports safe autocorrection (--autocorrect).
|
53
54
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
54
55
|
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
|
@@ -56,14 +57,13 @@ Layout/FirstArgumentIndentation:
|
|
56
57
|
Exclude:
|
57
58
|
- 'lib/cryptum/ui/order_execution.rb'
|
58
59
|
|
59
|
-
# Offense count:
|
60
|
+
# Offense count: 1
|
60
61
|
# This cop supports safe autocorrection (--autocorrect).
|
61
62
|
# Configuration parameters: EnforcedStyle.
|
62
63
|
# SupportedStyles: normal, indented_internal_methods
|
63
64
|
Layout/IndentationConsistency:
|
64
65
|
Exclude:
|
65
66
|
- 'lib/cryptum/api.rb'
|
66
|
-
- 'lib/cryptum/ui/order_execution.rb'
|
67
67
|
|
68
68
|
# Offense count: 1
|
69
69
|
# This cop supports safe autocorrection (--autocorrect).
|
@@ -123,7 +123,7 @@ Lint/UselessAssignment:
|
|
123
123
|
# Offense count: 38
|
124
124
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
125
125
|
Metrics/AbcSize:
|
126
|
-
Max:
|
126
|
+
Max: 371
|
127
127
|
|
128
128
|
# Offense count: 7
|
129
129
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
@@ -131,7 +131,7 @@ Metrics/AbcSize:
|
|
131
131
|
Metrics/BlockLength:
|
132
132
|
Max: 84
|
133
133
|
|
134
|
-
# Offense count:
|
134
|
+
# Offense count: 4
|
135
135
|
# Configuration parameters: CountBlocks.
|
136
136
|
Metrics/BlockNesting:
|
137
137
|
Max: 4
|
@@ -139,7 +139,7 @@ Metrics/BlockNesting:
|
|
139
139
|
# Offense count: 15
|
140
140
|
# Configuration parameters: IgnoredMethods.
|
141
141
|
Metrics/CyclomaticComplexity:
|
142
|
-
Max:
|
142
|
+
Max: 70
|
143
143
|
|
144
144
|
# Offense count: 56
|
145
145
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
@@ -154,7 +154,7 @@ Metrics/ModuleLength:
|
|
154
154
|
# Offense count: 16
|
155
155
|
# Configuration parameters: IgnoredMethods.
|
156
156
|
Metrics/PerceivedComplexity:
|
157
|
-
Max:
|
157
|
+
Max: 73
|
158
158
|
|
159
159
|
# Offense count: 1
|
160
160
|
# Configuration parameters: AllowedConstants.
|
data/Gemfile
CHANGED
@@ -11,8 +11,8 @@ gemspec
|
|
11
11
|
# In some circumstances custom flags are passed to gems in order
|
12
12
|
# to build appropriately. Defer to ./reinstall_coinbot_gemset.sh
|
13
13
|
# to review these custom flags
|
14
|
-
gem 'addressable', '2.8.
|
15
|
-
gem 'bundler', '>=2.3.
|
14
|
+
gem 'addressable', '2.8.1'
|
15
|
+
gem 'bundler', '>=2.3.26'
|
16
16
|
gem 'bundler-audit', '0.9.1'
|
17
17
|
gem 'curses', '1.4.4'
|
18
18
|
gem 'eventmachine', '1.2.7'
|
@@ -24,13 +24,13 @@ gem 'rbtrace', '0.4.14'
|
|
24
24
|
gem 'rdoc', '6.4.0'
|
25
25
|
gem 'require_all', '3.0.0'
|
26
26
|
gem 'rest-client', '2.1.0'
|
27
|
-
gem 'rspec', '3.
|
28
|
-
gem 'rubocop', '1.
|
27
|
+
gem 'rspec', '3.12.0'
|
28
|
+
gem 'rubocop', '1.39.0'
|
29
29
|
gem 'rubocop-rake', '0.6.0'
|
30
|
-
gem 'rubocop-rspec', '2.
|
30
|
+
gem 'rubocop-rspec', '2.15.0'
|
31
31
|
gem 'ruby-prof', '1.4.3'
|
32
32
|
gem 'rvm', '1.11.3.9'
|
33
|
-
gem 'sinatra', '
|
33
|
+
gem 'sinatra', '3.0.3'
|
34
34
|
gem 'thin', '1.8.1'
|
35
35
|
gem 'tty-prompt', '0.23.1'
|
36
36
|
gem 'tty-spinner', '0.9.3'
|
data/lib/cryptum/option.rb
CHANGED
@@ -57,7 +57,7 @@ module Cryptum
|
|
57
57
|
'-tSECONDS',
|
58
58
|
'--time-between-orders=SECONDS',
|
59
59
|
'<Optional - Seconds Between Market Trend Reset (Default 60)>'
|
60
|
-
) { |t| option_choice.market_trend_reset = t }
|
60
|
+
) { |t| option_choice.market_trend_reset = t.to_i }
|
61
61
|
end.parse!
|
62
62
|
|
63
63
|
input_validation(option_choice: option_choice)
|
@@ -89,7 +89,7 @@ module Cryptum
|
|
89
89
|
reason = :repo_root
|
90
90
|
end
|
91
91
|
|
92
|
-
option_choice.market_trend_reset =
|
92
|
+
option_choice.market_trend_reset = 86_400 if option_choice.market_trend_reset.zero?
|
93
93
|
unless option_choice.market_trend_reset.to_f.positive?
|
94
94
|
usage = true
|
95
95
|
reason = :market_trend_reset
|
@@ -36,11 +36,11 @@ module Cryptum
|
|
36
36
|
# crypto_smallest_size_to_buy = base_min_size.to_s.split('.')[-1].length
|
37
37
|
crypto_smallest_decimal = base_increment.to_s.split('.')[-1].length
|
38
38
|
fiat_smallest_decimal = quote_increment.to_s.split('.')[-1].length
|
39
|
-
crypto_smallest_size_to_buy = format(
|
40
|
-
|
41
|
-
|
42
|
-
)
|
43
|
-
crypto_smallest_size_to_buy = crypto_smallest_size_to_buy.to_s.split('.')[-1].length
|
39
|
+
# crypto_smallest_size_to_buy = format(
|
40
|
+
# "%0.#{crypto_smallest_decimal}f",
|
41
|
+
# min_market_funds.to_f / ticker_price
|
42
|
+
# )
|
43
|
+
# crypto_smallest_size_to_buy = crypto_smallest_size_to_buy.to_s.split('.')[-1].length
|
44
44
|
|
45
45
|
last_three_prices_arr = []
|
46
46
|
last_ticker_price = event_history.order_book[:ticker_price].to_f
|
@@ -95,9 +95,16 @@ module Cryptum
|
|
95
95
|
limit_price
|
96
96
|
)
|
97
97
|
|
98
|
+
size = this_order[:invest].to_f / limit_price
|
99
|
+
|
100
|
+
loop do
|
101
|
+
size = size.to_f + base_increment.to_f
|
102
|
+
break if (size.to_f * price.to_f) > min_market_funds.to_f
|
103
|
+
end
|
104
|
+
|
98
105
|
size = format(
|
99
|
-
"%0.#{
|
100
|
-
|
106
|
+
"%0.#{crypto_smallest_decimal}f",
|
107
|
+
size
|
101
108
|
)
|
102
109
|
|
103
110
|
# size = size.to_i.floor if base_increment.to_i >= 1
|
@@ -135,7 +142,7 @@ module Cryptum
|
|
135
142
|
|
136
143
|
this_order[:price] = limit_price.to_s
|
137
144
|
this_order[:size] = format(
|
138
|
-
"%0.#{
|
145
|
+
"%0.#{crypto_smallest_decimal}f",
|
139
146
|
this_order[:invest].to_f / limit_price
|
140
147
|
)
|
141
148
|
|
@@ -104,10 +104,9 @@ module Cryptum
|
|
104
104
|
loop do
|
105
105
|
# Calculate min order size
|
106
106
|
allocation_decimal += 0.0001
|
107
|
-
# allocation_decimal += base_increment.to_f
|
108
107
|
fiat_investing = risk_alloc * allocation_decimal
|
109
108
|
|
110
|
-
next unless fiat_investing
|
109
|
+
next unless fiat_investing > min_market_funds.to_f
|
111
110
|
|
112
111
|
# fiat_investing = min_market_funds.to_f
|
113
112
|
# allocation_decimal = fiat_investing / ticker_price
|
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.245
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.8.
|
19
|
+
version: 2.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.8.
|
26
|
+
version: 2.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.3.
|
33
|
+
version: 2.3.26
|
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.3.
|
40
|
+
version: 2.3.26
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler-audit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,28 +198,28 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - '='
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 3.
|
201
|
+
version: 3.12.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - '='
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 3.
|
208
|
+
version: 3.12.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: rubocop
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - '='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 1.
|
215
|
+
version: 1.39.0
|
216
216
|
type: :runtime
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - '='
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 1.
|
222
|
+
version: 1.39.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rubocop-rake
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,14 +240,14 @@ dependencies:
|
|
240
240
|
requirements:
|
241
241
|
- - '='
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 2.
|
243
|
+
version: 2.15.0
|
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: 2.
|
250
|
+
version: 2.15.0
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: ruby-prof
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,14 +282,14 @@ dependencies:
|
|
282
282
|
requirements:
|
283
283
|
- - '='
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version:
|
285
|
+
version: 3.0.3
|
286
286
|
type: :runtime
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
290
|
- - '='
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version:
|
292
|
+
version: 3.0.3
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: thin
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -437,7 +437,7 @@ licenses:
|
|
437
437
|
- GPL
|
438
438
|
metadata:
|
439
439
|
rubygems_mfa_required: 'true'
|
440
|
-
post_install_message:
|
440
|
+
post_install_message:
|
441
441
|
rdoc_options: []
|
442
442
|
require_paths:
|
443
443
|
- lib
|
@@ -452,8 +452,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
452
452
|
- !ruby/object:Gem::Version
|
453
453
|
version: '0'
|
454
454
|
requirements: []
|
455
|
-
rubygems_version: 3.3.
|
456
|
-
signing_key:
|
455
|
+
rubygems_version: 3.3.25
|
456
|
+
signing_key:
|
457
457
|
specification_version: 4
|
458
458
|
summary: Coinbase Pro High-Frequency Trading Bot
|
459
459
|
test_files: []
|