cryptum 0.0.355 → 0.0.357

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. metadata +13 -116
  3. data/.github/workflows/main.yml +0 -16
  4. data/.gitignore +0 -30
  5. data/.rspec +0 -3
  6. data/.rspec_status +0 -0
  7. data/.rubocop.yml +0 -31
  8. data/.rubocop_todo.yml +0 -32
  9. data/.ruby-gemset +0 -1
  10. data/.ruby-version +0 -1
  11. data/CODE_OF_CONDUCT.md +0 -84
  12. data/Gemfile +0 -38
  13. data/LICENSE +0 -674
  14. data/README.md +0 -87
  15. data/Rakefile +0 -19
  16. data/bin/cryptum +0 -73
  17. data/bin/cryptum-forecast +0 -200
  18. data/bin/cryptum-repl +0 -73
  19. data/bin/cryptum_autoinc_version +0 -38
  20. data/build_cryptum_gem.sh +0 -58
  21. data/cryptum.gemspec +0 -52
  22. data/cryptum_container.sh +0 -1
  23. data/docker/cryptum.json +0 -60
  24. data/docker/cryptum_container.sh +0 -59
  25. data/docker/packer_secrets.json.EXAMPLE +0 -7
  26. data/docker/provisioners/cryptum.sh +0 -11
  27. data/docker/provisioners/docker_bashrc.sh +0 -2
  28. data/docker/provisioners/docker_rvm.sh +0 -22
  29. data/docker/provisioners/init_image.sh +0 -28
  30. data/docker/provisioners/post_install.sh +0 -6
  31. data/docker/provisioners/ruby.sh +0 -16
  32. data/docker/provisioners/upload_globals.sh +0 -49
  33. data/etc/bot_confs/.gitkeep +0 -0
  34. data/etc/bot_confs/BOT_CONF.TEMPLATE +0 -10
  35. data/etc/coinbase_pro.yaml.EXAMPLE +0 -8
  36. data/etc/open_ai.yaml.EXAMPLE +0 -1
  37. data/git_commit.sh +0 -22
  38. data/lib/cryptum/api.rb +0 -688
  39. data/lib/cryptum/bot_conf.rb +0 -197
  40. data/lib/cryptum/event/bot_conf.rb +0 -34
  41. data/lib/cryptum/event/buy.rb +0 -145
  42. data/lib/cryptum/event/cancel.rb +0 -35
  43. data/lib/cryptum/event/exit.rb +0 -35
  44. data/lib/cryptum/event/gtfo.rb +0 -36
  45. data/lib/cryptum/event/history.rb +0 -105
  46. data/lib/cryptum/event/key_press.rb +0 -64
  47. data/lib/cryptum/event/order_book.rb +0 -34
  48. data/lib/cryptum/event/pane.rb +0 -65
  49. data/lib/cryptum/event/parse.rb +0 -181
  50. data/lib/cryptum/event/scroll.rb +0 -200
  51. data/lib/cryptum/event/sell.rb +0 -124
  52. data/lib/cryptum/event.rb +0 -27
  53. data/lib/cryptum/log.rb +0 -34
  54. data/lib/cryptum/matrix.rb +0 -181
  55. data/lib/cryptum/open_ai.rb +0 -156
  56. data/lib/cryptum/option/choice.rb +0 -28
  57. data/lib/cryptum/option.rb +0 -206
  58. data/lib/cryptum/order_book/generate.rb +0 -114
  59. data/lib/cryptum/order_book/indicator.rb +0 -15
  60. data/lib/cryptum/order_book/market_trend.rb +0 -137
  61. data/lib/cryptum/order_book/profit_margin.rb +0 -55
  62. data/lib/cryptum/order_book.rb +0 -19
  63. data/lib/cryptum/portfolio/balance.rb +0 -123
  64. data/lib/cryptum/portfolio.rb +0 -15
  65. data/lib/cryptum/ui/command.rb +0 -314
  66. data/lib/cryptum/ui/key_press_event.rb +0 -33
  67. data/lib/cryptum/ui/market_trend.rb +0 -74
  68. data/lib/cryptum/ui/order_execute_details.rb +0 -297
  69. data/lib/cryptum/ui/order_execution.rb +0 -573
  70. data/lib/cryptum/ui/order_plan.rb +0 -503
  71. data/lib/cryptum/ui/order_plan_details.rb +0 -240
  72. data/lib/cryptum/ui/order_timer.rb +0 -121
  73. data/lib/cryptum/ui/portfolio.rb +0 -221
  74. data/lib/cryptum/ui/signal_engine.rb +0 -109
  75. data/lib/cryptum/ui/terminal_window.rb +0 -111
  76. data/lib/cryptum/ui/ticker.rb +0 -319
  77. data/lib/cryptum/ui.rb +0 -343
  78. data/lib/cryptum/version.rb +0 -5
  79. data/lib/cryptum/web_sock/coinbase.rb +0 -102
  80. data/lib/cryptum/web_sock/event_machine.rb +0 -274
  81. data/lib/cryptum/web_sock.rb +0 -16
  82. data/lib/cryptum.rb +0 -120
  83. data/order_books/.gitkeep +0 -0
  84. data/reinstall_cryptum_gemset.sh +0 -29
  85. data/spec/lib/cryptum/api_spec.rb +0 -10
  86. data/spec/lib/cryptum/event_spec.rb +0 -10
  87. data/spec/lib/cryptum/log_spec.rb +0 -10
  88. data/spec/lib/cryptum/option_spec.rb +0 -10
  89. data/spec/lib/cryptum/order_book/generate_spec.rb +0 -10
  90. data/spec/lib/cryptum/order_book/market_trend_spec.rb +0 -10
  91. data/spec/lib/cryptum/order_book_spec.rb +0 -10
  92. data/spec/lib/cryptum/ui/command_spec.rb +0 -10
  93. data/spec/lib/cryptum/ui/ticker_spec.rb +0 -10
  94. data/spec/lib/cryptum/ui_spec.rb +0 -10
  95. data/spec/lib/cryptum/web_sock_spec.rb +0 -10
  96. data/spec/lib/cryptum_spec.rb +0 -10
  97. data/spec/spec_helper.rb +0 -3
  98. data/upgrade_Gemfile_gems.sh +0 -20
  99. data/upgrade_cryptum.sh +0 -13
  100. data/upgrade_gem.sh +0 -4
  101. data/upgrade_ruby.sh +0 -45
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'logger'
4
-
5
- module Cryptum
6
- # This plugin is used to Refresh the Cryptum console UI
7
- module UI
8
- module MarketTrend
9
- # Supported Method Parameters::
10
- # Cryptum::UI::Candle.refresh(
11
- # order_book: 'required - Order Book Data Structure',
12
- # event: 'required - Event from Coinbase Web Socket'
13
- # )
14
-
15
- public_class_method def self.refresh(opts = {})
16
- market_trend_win = opts[:market_trend_win]
17
- event_history = opts[:event_history]
18
- event = opts[:event]
19
- indicator_status = opts[:indicator_status]
20
-
21
- indicator_hash = Cryptum::OrderBook::MarketTrend.status(
22
- event_history: event_history,
23
- event: event,
24
- indicator_status: indicator_status
25
- )
26
-
27
- market_trend_color = indicator_hash[:color]
28
- market_trend_out = indicator_hash[:ui]
29
-
30
- # UI
31
- # ROW 1
32
- out_line_no = 0
33
- Cryptum::UI.line(
34
- ui_win: market_trend_win,
35
- out_line_no: out_line_no
36
- )
37
-
38
- # ROW 2
39
- out_line_no += 1
40
- market_trend_win.setpos(
41
- out_line_no,
42
- Cryptum::UI.col_center(str: market_trend_out)
43
- )
44
- market_trend_win.clrtoeol
45
- Cryptum::UI.colorize(
46
- ui_win: market_trend_win,
47
- color: market_trend_color,
48
- style: :bold,
49
- string: market_trend_out
50
- )
51
-
52
- market_trend_win.refresh
53
-
54
- event_history
55
- rescue Interrupt
56
- # Exit Gracefully if CTRL+C is Pressed During Session
57
- Cryptum.exit_gracefully(which_self: self)
58
- rescue StandardError => e
59
- raise e
60
- end
61
-
62
- # Display Usage for this Module
63
-
64
- public_class_method def self.help
65
- puts "USAGE:
66
- #{self}.refresh(
67
- order_book: 'required - Order Book Data Structure',
68
- event: 'required - Event from Coinbase Web Socket'
69
- )
70
- "
71
- end
72
- end
73
- end
74
- end
@@ -1,297 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'logger'
4
-
5
- module Cryptum
6
- module UI
7
- # This plugin is used to Display Order Execute Details
8
- # selected from the Order Execute Window Pane.
9
- module OrderExecuteDetails
10
- # Supported Method Parameters::
11
- # Cryptum::UI::OrderExecuteDetails.refresh(
12
- # )
13
-
14
- public_class_method def self.refresh(opts = {})
15
- event_history = opts[:event_history]
16
- order_execute_details_win = opts[:order_execute_details_win]
17
-
18
- order_meta_data = event_history.order_execute_selected_data
19
-
20
- order_color = order_meta_data[:color].to_sym
21
- case order_color
22
- when :cyan, :red
23
- order_id = order_meta_data[:buy_order_id]
24
- when :green, :magenta, :yellow
25
- order_id = order_meta_data[:sell_order_id]
26
- when :white
27
- order_id = 'Expired'
28
- else
29
- order_id = 'N/A'
30
- end
31
-
32
- order_id_details = "- ID: #{order_id}"
33
-
34
- order_history_arr = event_history.order_book[:order_history].select do |order|
35
- order if order[:id] == order_id
36
- end
37
-
38
- if order_history_arr.empty? && order_color == :yellow
39
- order_meta_data.delete(:sell_order_id)
40
- order_id = order_meta_data[:buy_order_id]
41
- order_meta_data[:color] = :cyan
42
- order_history_arr = event_history.order_book[:order_history].select do |order|
43
- order if order[:id] == order_id
44
- end
45
- end
46
-
47
- order_type_ln = '- Type: N/A'
48
- order_status_ln = '- Status: N/A'
49
- fill_fees = 'N/A'
50
- fill_size = 'N/A'
51
- executed_value = 'N/A'
52
- market_type = 'N/A'
53
- settled = 'N/A'
54
- unless order_history_arr.empty?
55
- order_history = order_history_arr.first
56
- order_type = order_history[:type].capitalize
57
- time_in_force = order_history[:time_in_force].upcase
58
- order_status = order_history[:status].upcase
59
- created_at = order_history[:created_at]
60
- fill_fees = order_history[:fill_fees]
61
- fill_size = order_history[:filled_size]
62
- executed_value = order_history[:executed_value]
63
- market_type = order_history[:market_type]
64
- settled = order_history[:settled]
65
-
66
- order_side = order_history[:side].capitalize
67
- case order_side.to_sym
68
- when :Buy
69
- expire_time = order_history[:expire_time]
70
- done_at = order_history[:done_at]
71
- order_meta_data[:color] = :cyan if done_at
72
- when :Sell
73
- done_at = order_history[:done_at]
74
- end
75
-
76
- order_type_ln = "- Type: #{order_type} #{order_side} #{time_in_force}"
77
- order_type_ln = "- Type: #{order_type} #{order_side} #{time_in_force} 1m" if time_in_force == 'GTT'
78
- order_status_ln = "- Status: #{order_status}"
79
- end
80
-
81
- if created_at && (!expire_time || !done_at)
82
- order_hist_created_finished_ln = "- Creation Date: #{created_at} | Finished Date: N/A"
83
- elsif created_at && expire_time && !done_at
84
- order_hist_created_finished_ln = "- Creation Date: #{created_at} | Expiring Date: #{expire_time}"
85
- elsif created_at && done_at
86
- order_hist_created_finished_ln = "- Creation Date: #{created_at} | Finished Date: #{done_at}"
87
- else
88
- order_hist_created_finished_ln = '- Creation Date: N/A | Finished Date: N/A'
89
- end
90
-
91
- invest_out = Cryptum.beautify_large_number(
92
- value: order_meta_data[:invest]
93
- )
94
- price_out = Cryptum.beautify_large_number(
95
- value: order_meta_data[:price]
96
- )
97
- size_out = Cryptum.beautify_large_number(
98
- value: order_meta_data[:size]
99
- )
100
- target_price_out = Cryptum.beautify_large_number(
101
- value: order_meta_data[:target_price]
102
- )
103
-
104
- invest = "$#{invest_out} @ "
105
- tick = "$#{price_out} = "
106
- size = "*#{size_out} + "
107
- tpm_out = "#{order_meta_data[:tpm]}% = "
108
- targ_tick = "$#{target_price_out}"
109
- profit = " | Profit: $#{order_meta_data[:profit]}"
110
-
111
- details_ln1 = "- Slice Plan: #{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
112
- details_ln2 = "- Fees: $#{fill_fees} | Fill Size: *#{fill_size}"
113
- details_ln3 = "- Executed Value: $#{executed_value} | Market Type: #{market_type} | Settled: #{settled}"
114
-
115
- # UI
116
- col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
117
-
118
- # ROW 1
119
- out_line_no = 0
120
- line_color = order_color
121
- header_color = order_color
122
- header_style = :bold
123
- style = :bold
124
- header_style = :reverse if event_history.order_execute_details_win_active
125
-
126
- Cryptum::UI.line(
127
- ui_win: order_execute_details_win,
128
- out_line_no: out_line_no,
129
- color: line_color
130
- )
131
-
132
- # ROW 2
133
- out_line_no += 1
134
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
135
- order_execute_details_win.clrtoeol
136
- Cryptum::UI.colorize(
137
- ui_win: order_execute_details_win,
138
- color: header_color,
139
- style: header_style,
140
- string: ''.ljust(col_just1, ' ')
141
- )
142
-
143
- header_str = "- ORDER ##{order_meta_data[:plan_no]} DETAILS -"
144
- order_execute_details_win.setpos(
145
- out_line_no,
146
- Cryptum::UI.col_center(str: header_str)
147
- )
148
-
149
- Cryptum::UI.colorize(
150
- ui_win: order_execute_details_win,
151
- color: order_color,
152
- style: header_style,
153
- string: header_str
154
- )
155
-
156
- # ROW 3
157
- out_line_no += 1
158
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
159
- order_execute_details_win.clrtoeol
160
-
161
- Cryptum::UI.colorize(
162
- ui_win: order_execute_details_win,
163
- color: order_color,
164
- style: style,
165
- string: order_id_details.ljust(col_just1, ' ')
166
- )
167
-
168
- # ROW 4
169
- out_line_no += 1
170
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
171
- order_execute_details_win.clrtoeol
172
-
173
- Cryptum::UI.colorize(
174
- ui_win: order_execute_details_win,
175
- color: order_color,
176
- style: style,
177
- string: order_type_ln.ljust(col_just1, ' ')
178
- )
179
-
180
- # ROW 5
181
- out_line_no += 1
182
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
183
- order_execute_details_win.clrtoeol
184
-
185
- Cryptum::UI.colorize(
186
- ui_win: order_execute_details_win,
187
- color: order_color,
188
- style: style,
189
- string: order_status_ln.ljust(col_just1, ' ')
190
- )
191
-
192
- # ROW 6
193
- out_line_no += 1
194
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
195
- order_execute_details_win.clrtoeol
196
-
197
- Cryptum::UI.colorize(
198
- ui_win: order_execute_details_win,
199
- color: order_color,
200
- style: style,
201
- string: order_hist_created_finished_ln.ljust(col_just1, ' ')
202
- )
203
-
204
- # ROW 7
205
- out_line_no += 1
206
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
207
- order_execute_details_win.clrtoeol
208
-
209
- Cryptum::UI.colorize(
210
- ui_win: order_execute_details_win,
211
- color: order_color,
212
- style: style,
213
- string: details_ln1.ljust(col_just1, ' ')
214
- )
215
-
216
- # ROW 8
217
- out_line_no += 1
218
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
219
- order_execute_details_win.clrtoeol
220
-
221
- Cryptum::UI.colorize(
222
- ui_win: order_execute_details_win,
223
- color: order_color,
224
- style: style,
225
- string: details_ln2.ljust(col_just1, ' ')
226
- )
227
-
228
- # ROW 9
229
- out_line_no += 1
230
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
231
- order_execute_details_win.clrtoeol
232
-
233
- Cryptum::UI.colorize(
234
- ui_win: order_execute_details_win,
235
- color: order_color,
236
- style: style,
237
- string: details_ln3.ljust(col_just1, ' ')
238
- )
239
-
240
- # Clear to OK ROW
241
- ok_row = 9
242
- out_line_no += 1
243
- to_ok_row = ok_row - 1
244
- (out_line_no..to_ok_row).each do |clr_line|
245
- order_execute_details_win.setpos(clr_line, Cryptum::UI.col_first)
246
- Cryptum::UI.colorize(
247
- ui_win: order_execute_details_win,
248
- color: order_color,
249
- style: :normal,
250
- string: ''.ljust(col_just1, ' ')
251
- )
252
- end
253
-
254
- # OK ROW
255
- out_line_no = ok_row
256
- order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
257
- order_execute_details_win.clrtoeol
258
- Cryptum::UI.colorize(
259
- ui_win: order_execute_details_win,
260
- color: order_color,
261
- string: ''.ljust(col_just1, ' ')
262
- )
263
-
264
- header_str = '- OK -'
265
- order_execute_details_win.setpos(
266
- out_line_no,
267
- Cryptum::UI.col_center(str: header_str)
268
- )
269
-
270
- Cryptum::UI.colorize(
271
- ui_win: order_execute_details_win,
272
- color: order_color,
273
- style: :reverse,
274
- string: header_str
275
- )
276
-
277
- order_execute_details_win.refresh
278
-
279
- event_history
280
- rescue Interrupt
281
- # Exit Gracefully if CTRL+C is Pressed During Session
282
- Cryptum.exit_gracefully(which_self: self)
283
- rescue StandardError => e
284
- raise e
285
- end
286
-
287
- # Display Usage for this Module
288
-
289
- public_class_method def self.help
290
- puts "USAGE:
291
- #{self}.refresh(
292
- )
293
- "
294
- end
295
- end
296
- end
297
- end