cryptum 0.0.312 → 0.0.314

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: 0adc69cdbbde0908575f0c4696b09be24b0fc67a7457bf99da92f2391ce46e2f
4
- data.tar.gz: 3aaf362ef9a5d4863ea279224afff4d4f07669f5954ceb0f9dde6d56bce2469d
3
+ metadata.gz: 2ab9f5b8899b906bfb3513dc4fc3fad39607dc52a62f067703fec47fd82f59e1
4
+ data.tar.gz: 8de5152998ff10668b8b871e97d8b60e19add14f4f67ff5f2a05ade3b1e1684a
5
5
  SHA512:
6
- metadata.gz: 6317706ccad3922075e7d3f3cdec208f8b5f34c5a7cc78eb3fcd5dde6d987d3847112cf96892c8965e063d9062ce5bf9c56c424174ea907448c0b3dd7b86dc08
7
- data.tar.gz: bd6df428c60303db065011915fb94351131cd04c6f510c2ec3c0c4e8bdfd0ef7287d042b595a3f925484fbfa16b81b6e9b10e04e2eed0a1843b1f07300ef74d7
6
+ metadata.gz: dc5f8b121978b119733c2df5f08bdc782a2a65a9de75cea7236645ab03ccff3adca327cc844be54aaa2956e2cebf4a24af78305be77b161d75a908b99f2f8495
7
+ data.tar.gz: 37d87a451bd6cbc10adeabaa41e68474e264b87e34b05346770ac41f805b91b5e993b04c60f95cd533673ce8f00e862505f3d496ab6cc7920ca13bf694de6655
@@ -122,7 +122,8 @@ module Cryptum
122
122
  when 60
123
123
  option_choice.market_trend_reset_label = '1m'
124
124
  else
125
- option_choice.market_trend_reset_label = option_choice.market_trend_reset
125
+ usage = true
126
+ reason = :market_trend_reset
126
127
  end
127
128
 
128
129
  if usage
@@ -132,7 +133,7 @@ module Cryptum
132
133
  when :repo_root
133
134
  puts "ERROR: #{option_choice.repo_root} does not exist.\n\n"
134
135
  when :market_trend_reset
135
- puts "ERROR: #{option_choice.market_trend_reset} Must be a positive integer between 60-86_400.\n\n"
136
+ puts "ERROR: #{option_choice.market_trend_reset} - Possible values are: 604_800 || 86_400 || 14_400 || 10_800 || 7_200 || 3_600 || 2_700 || 1_800 || 900 || 300 || 180 || 60\n\n"
136
137
  end
137
138
 
138
139
  puts `#{option_choice.driver_name} --help`
@@ -112,21 +112,68 @@ module Cryptum
112
112
  # Refactor TPM to be 0.01 > than fee tier,
113
113
  # particularly as fee tier goes up or down
114
114
  fees = event_history.order_book[:fees]
115
- taker_rate = 0.5
115
+ maker_rate = 0.4
116
+ maker_rate = fees[:maker_fee_rate].to_f unless fees.empty?
117
+ maker_fee = format('%0.2f', maker_rate * 100)
118
+
119
+ taker_rate = 0.6
116
120
  taker_rate = fees[:taker_fee_rate].to_f unless fees.empty?
117
121
  taker_fee = format('%0.2f', taker_rate * 100)
118
- default_net_tpm = 3
122
+ # BE EXTREMELY CAREFUL CHANGING THIS VALUE AS IT DICTATES
123
+ # THE TARGET PRICE AND SUBSEQUENT TIME IT TAKES FOR AN OPEN
124
+ # SELL ORDER TO BE TRIGGERED!!! SHOULD NEVER BE > 1
125
+ default_net_tpm = 1
119
126
 
120
127
  if ai_enabled
128
+ # Set default_net_tpm if AI is true in bot_conf.
121
129
  low_24h = event_history.order_book[:low_24h].to_f
122
130
  high_24h = event_history.order_book[:high_24h].to_f
123
- ai_net_tpm = (1 - (low_24h / high_24h)) * 100
131
+
132
+ case option_choice.market_trend_reset
133
+ when 604_800
134
+ # 1W Chart
135
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) * 7
136
+ when 86_400
137
+ # 1D Chart
138
+ ai_net_tpm = (1 - (low_24h / high_24h)) * 100
139
+ when 14_400
140
+ # 4H Chart
141
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 6
142
+ when 10_800
143
+ # 3H Chart
144
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 8
145
+ when 7_200
146
+ # 2H Chart
147
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 12
148
+ when 3_600
149
+ # 1H Chart
150
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 24
151
+ when 2_700
152
+ # 45m Chart
153
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.75
154
+ when 1_800
155
+ # 30m Chart
156
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.5
157
+ when 900
158
+ # 15m Chart
159
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.25
160
+ when 300
161
+ # 5m Chart
162
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.083
163
+ when 180
164
+ # 3m Chart
165
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.05
166
+ when 60
167
+ # 1m Chart
168
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.017
169
+ end
170
+
124
171
  default_net_tpm = ai_net_tpm if ai_net_tpm > default_net_tpm
125
172
  end
126
173
 
127
174
  min_gross_tpm = format(
128
175
  '%0.2f',
129
- (taker_fee.to_f * 2) + default_net_tpm
176
+ (maker_fee.to_f + taker_fee.to_f) + default_net_tpm
130
177
  )
131
178
 
132
179
  if ai_enabled && min_gross_tpm != gross_tpm.to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.312'
4
+ VERSION = '0.0.314'
5
5
  end
@@ -241,7 +241,8 @@ module Cryptum
241
241
  end
242
242
  rescue Faye::WebSocket::API::ErrorEvent,
243
243
  Errno::ECONNREFUSED,
244
- Errno::ECONNRESET => e
244
+ Errno::ECONNRESET,
245
+ LoadError => e
245
246
 
246
247
  File.open('/tmp/cryptum-errors.txt', 'a') do |f|
247
248
  f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S.%N %z')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.312
4
+ version: 0.0.314
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.