cryptum 0.0.430 → 0.0.431
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cryptum/log.rb +1 -1
- data/lib/cryptum/order_book/generate.rb +18 -0
- data/lib/cryptum/order_book/market_trend.rb +1 -7
- data/lib/cryptum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efc9ac08fc48ca7aa7674359ea95d662af6cade3fc2a0249b19ce03bc996f3fb
|
4
|
+
data.tar.gz: 3b6ddc0e658f076ee6f80f2f4a399d9192292c2ce090a7056b26c51a0cb7fd2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aff4e41fe11057b9d0b401c78b27dae432a8756ec6a02b265b5b1eb580999954d0ae8ace3390804544920f89eeed141467d240f346603582a100ba6b1885ed61
|
7
|
+
data.tar.gz: da014125c73aba67a997bb76b2a9476a1074b35ae51973b4b6a44833ab3bc5c410c572d249ddfae3116f1e75581c18ec74daf6254a2610c56bdd4b632322fe43
|
data/lib/cryptum/log.rb
CHANGED
@@ -68,7 +68,7 @@ module Cryptum
|
|
68
68
|
logger.level = Logger::WARN
|
69
69
|
else
|
70
70
|
level_error = "ERROR: Invalid log level. Valid options are:\n"
|
71
|
-
level_error += ":
|
71
|
+
level_error += ":debug\n:error\n:fatal\n:info\n:learning\n:unknown\n:warn\n"
|
72
72
|
raise level_error
|
73
73
|
end
|
74
74
|
|
@@ -70,6 +70,24 @@ module Cryptum
|
|
70
70
|
File.read(order_book_file),
|
71
71
|
symbolize_names: true
|
72
72
|
)
|
73
|
+
|
74
|
+
# Only keep order history meta for those hashes
|
75
|
+
# that exist in the last order history response
|
76
|
+
# :white ones will be kept for 24 hrs and handled
|
77
|
+
# via Cryptum::OrderBook::MarketTrend.reset
|
78
|
+
# This exist primarily to clean up meta data if the
|
79
|
+
# bot crashes.
|
80
|
+
order_book[:order_history_meta].keep_if do |ohm|
|
81
|
+
order_book[:order_history].find do |oh|
|
82
|
+
(oh[:id] == ohm[:buy_order_id] || oh[:id] == ohm[:sell_order_id]) && (
|
83
|
+
ohm[:color].to_sym == :cyan ||
|
84
|
+
ohm[:color].to_sym == :green ||
|
85
|
+
ohm[:color].to_sym == :magenta ||
|
86
|
+
ohm[:color].to_sym == :red ||
|
87
|
+
ohm[:color].to_sym == :yellow
|
88
|
+
)
|
89
|
+
end
|
90
|
+
end
|
73
91
|
end
|
74
92
|
|
75
93
|
event_history = Cryptum::Event::History.new(
|
@@ -67,22 +67,16 @@ module Cryptum
|
|
67
67
|
# TO AVOID TICKER PRICE SYNCING ISSUES.
|
68
68
|
event_history = opts[:event_history]
|
69
69
|
|
70
|
-
# order_history = event_history.order_book[:order_history]
|
71
|
-
order_history_meta = event_history.order_book[:order_history_meta]
|
72
|
-
|
73
70
|
# Only retain past 24 hours of
|
74
71
|
# order history meta for expired
|
75
72
|
# keep open limit sell orders indefintely
|
76
73
|
before_twenty_four_hrs_ago = Time.now - 86_400
|
77
|
-
order_history_meta.delete_if do |ohm|
|
74
|
+
event_history.order_book[:order_history_meta].delete_if do |ohm|
|
78
75
|
next unless ohm[:color] == 'white'
|
79
76
|
|
80
77
|
Time.parse(ohm[:done_at]) < before_twenty_four_hrs_ago
|
81
78
|
end
|
82
79
|
|
83
|
-
# Write order_history_meta back to event_history object
|
84
|
-
event_history.order_book[:order_history_meta] = order_history_meta
|
85
|
-
|
86
80
|
# Reset Market Trend Counter
|
87
81
|
event_history.order_book[:market_trend][:buy] = 0
|
88
82
|
event_history.order_book[:market_trend][:sell] = 0
|
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.431
|
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-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|