cryptum 0.0.463 → 0.0.464
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/cryptum/ui/order/execute.rb +31 -31
- data/lib/cryptum/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a73360dc5d7f4c6a420e078a1dfa22a8ffdd14bce66f8ab5c341e373f0265c5d
|
4
|
+
data.tar.gz: a403cfe52a227bd4691729d4c0976c141ad64569c6057d72f0d6b61d56d21ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eeaf361bcddb2ccec7a487ac65c6dbeced78ad2f9087f1d5938fd8722919cf911c50ca81a5a925a10d7d518607af863a97d7c2eab6d0e5f326b4a16b619e967
|
7
|
+
data.tar.gz: b8f3e154d3e41e6b30503ca0b949a7451434ad9b3fb81981e69b0d25fe74835ad0d4b5339f279d778b2605ecb67de94670760605a5ebd2df6ebcdcc74fe87d02
|
data/Gemfile
CHANGED
@@ -12,7 +12,7 @@ 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.18'
|
16
16
|
gem 'bundler-audit', '0.9.1'
|
17
17
|
gem 'curses', '1.4.4'
|
18
18
|
gem 'eventmachine', '1.2.7'
|
@@ -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.55.
|
30
|
+
gem 'rubocop', '1.55.1'
|
31
31
|
gem 'rubocop-rake', '0.6.0'
|
32
32
|
gem 'rubocop-rspec', '2.23.0'
|
33
33
|
gem 'ruby-prof', '1.6.3'
|
@@ -180,7 +180,7 @@ module Cryptum
|
|
180
180
|
event_reason == :canceled
|
181
181
|
|
182
182
|
# Remove all white hashes from order_history_meta
|
183
|
-
order_history_meta
|
183
|
+
order_history_meta.reject! do |ohm|
|
184
184
|
ohm[:color].to_sym == :white
|
185
185
|
end
|
186
186
|
|
@@ -226,7 +226,7 @@ module Cryptum
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
-
# Update Canceled Sell Orders w/
|
229
|
+
# Update Canceled Sell Orders w/ White &&
|
230
230
|
# Include done_at Timestamp for 24h gain calc
|
231
231
|
if event_type == :done &&
|
232
232
|
event_side == :sell &&
|
@@ -245,14 +245,14 @@ module Cryptum
|
|
245
245
|
end
|
246
246
|
|
247
247
|
# Snag all orders bought YTD
|
248
|
-
oh_buy_ytd_arr = order_history.select do |oh|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
end
|
253
|
-
order_hist_buy_usd_tot = oh_buy_ytd_arr.map do |oh|
|
254
|
-
|
255
|
-
end.sum
|
248
|
+
# oh_buy_ytd_arr = order_history.select do |oh|
|
249
|
+
# oh[:side] == 'buy' &&
|
250
|
+
# oh.key?(:done_at) &&
|
251
|
+
# Time.now.strftime('%Y') == Time.parse(oh[:done_at]).strftime('%Y')
|
252
|
+
# end
|
253
|
+
# order_hist_buy_usd_tot = oh_buy_ytd_arr.map do |oh|
|
254
|
+
# oh[:executed_value].to_f
|
255
|
+
# end.sum
|
256
256
|
|
257
257
|
# Snag all orders sold YTD
|
258
258
|
oh_sold_ytd_arr = order_history.select do |oh|
|
@@ -263,11 +263,11 @@ module Cryptum
|
|
263
263
|
# TODO: ensure oh_buy_ytd_arr && oh_sold_ytd_arr are same length
|
264
264
|
# otherwise it throws off the profit calculations
|
265
265
|
order_hist_sold_ytd = oh_sold_ytd_arr.length
|
266
|
-
order_hist_sold_usd_tot = oh_sold_ytd_arr.map do |oh|
|
267
|
-
|
268
|
-
end.sum
|
269
|
-
order_hist_profit_usd_ytd = order_hist_sold_usd_tot - order_hist_buy_usd_tot
|
270
|
-
order_hist_profit_usd_ytd_out = format('%0.2f', order_hist_profit_usd_ytd)
|
266
|
+
# order_hist_sold_usd_tot = oh_sold_ytd_arr.map do |oh|
|
267
|
+
# oh[:executed_value].to_f
|
268
|
+
# end.sum
|
269
|
+
# order_hist_profit_usd_ytd = order_hist_sold_usd_tot - order_hist_buy_usd_tot
|
270
|
+
# order_hist_profit_usd_ytd_out = format('%0.2f', order_hist_profit_usd_ytd)
|
271
271
|
|
272
272
|
# Snag all session orders sold YTD
|
273
273
|
oh_meta_sold_arr = order_history_meta.select do |ohm|
|
@@ -337,12 +337,12 @@ module Cryptum
|
|
337
337
|
twenty_four_hrs_ago = Time.now - 86_400
|
338
338
|
|
339
339
|
# Snag all orders bought within past 24 hrs
|
340
|
-
oh_buy_twenty_four_arr = []
|
341
|
-
unless oh_buy_ytd_arr.empty?
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
end
|
340
|
+
# oh_buy_twenty_four_arr = []
|
341
|
+
# unless oh_buy_ytd_arr.empty?
|
342
|
+
# oh_buy_twenty_four_arr = oh_buy_ytd_arr.select do |o|
|
343
|
+
# Time.parse(o[:done_at]) >= twenty_four_hrs_ago
|
344
|
+
# end
|
345
|
+
# end
|
346
346
|
# order_hist_buy_twenty_four = oh_buy_twenty_four_arr.length
|
347
347
|
|
348
348
|
# Snag all orders sold within past 24 hrs
|
@@ -355,15 +355,15 @@ module Cryptum
|
|
355
355
|
order_hist_sold_twenty_four = oh_sold_twenty_four_arr.length
|
356
356
|
|
357
357
|
# Calculate 24h gain
|
358
|
-
order_hist_buy_usd_24h = oh_buy_twenty_four_arr.map do |oh|
|
359
|
-
|
360
|
-
end.sum
|
358
|
+
# order_hist_buy_usd_24h = oh_buy_twenty_four_arr.map do |oh|
|
359
|
+
# oh[:excuted_value].to_f
|
360
|
+
# end.sum
|
361
361
|
|
362
|
-
order_hist_sold_usd_24h = oh_sold_twenty_four_arr.map do |oh|
|
363
|
-
|
364
|
-
end.sum
|
365
|
-
order_hist_profit_usd_24h = order_hist_sold_usd_24h - order_hist_buy_usd_24h
|
366
|
-
order_hist_profit_usd_24h_out = format('%0.2f', order_hist_profit_usd_24h)
|
362
|
+
# order_hist_sold_usd_24h = oh_sold_twenty_four_arr.map do |oh|
|
363
|
+
# oh[:executed_value].to_f
|
364
|
+
# end.sum
|
365
|
+
# order_hist_profit_usd_24h = order_hist_sold_usd_24h - order_hist_buy_usd_24h
|
366
|
+
# order_hist_profit_usd_24h_out = format('%0.2f', order_hist_profit_usd_24h)
|
367
367
|
|
368
368
|
# Snag all session orders sold within past 24 hrs
|
369
369
|
ohm_sold_twenty_four_arr = []
|
@@ -646,8 +646,8 @@ module Cryptum
|
|
646
646
|
)
|
647
647
|
|
648
648
|
tot_header_str = "TOTAL OPEN: #{total_to_sell} | "
|
649
|
-
tot_header_str += "SOLD 24h: #{order_hist_sold_twenty_four} YTD: #{order_hist_sold_ytd}
|
650
|
-
tot_header_str += "PROF 24h: $#{order_hist_profit_usd_24h_out} YTD: $#{order_hist_profit_usd_ytd_out}"
|
649
|
+
tot_header_str += "SOLD 24h: #{order_hist_sold_twenty_four} YTD: #{order_hist_sold_ytd}"
|
650
|
+
# tot_header_str += "PROF 24h: $#{order_hist_profit_usd_24h_out} YTD: $#{order_hist_profit_usd_ytd_out}"
|
651
651
|
order_execute_win.setpos(
|
652
652
|
out_line_no,
|
653
653
|
Cryptum::UI.col_center(str: tot_header_str)
|
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.464
|
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-08-02 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.18
|
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.18
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler-audit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,14 +240,14 @@ dependencies:
|
|
240
240
|
requirements:
|
241
241
|
- - '='
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 1.55.
|
243
|
+
version: 1.55.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.55.
|
250
|
+
version: 1.55.1
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: rubocop-rake
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|