SimBot 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +94 -48
- data/Gemfile.lock +1 -1
- data/lib/SimBot.rb +9 -4
- data/lib/SimBot/version.rb +1 -1
- data/lib/utils.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01dd70731141e099cae68e17fdf87af5d6a7bd4da158fd15c456a55eb90b1f7f
|
4
|
+
data.tar.gz: 0e0d7cad47197a6f63b23da623c7050fccce3750fce932373abe3690678cf22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 734441eb84345999cd91883310ae473800a8e7ed4235be90e33d0efb55f04504d724faee56e3d88856f516b664c4a7921e39a0932c2ea3dbb752611daef17a18
|
7
|
+
data.tar.gz: b4098e438ab6fb101903aba8f64d3eb8c46cdbb27c016eb3de585409c21dbd686e5f9b2c02b6fe8da6e9b4e150c4efe4c6661adacc3e6993d9a69cde13364fd1
|
data/.idea/workspace.xml
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
|
-
<list default="true" id="d905eaf2-5cab-434b-a4d1-1ccf165356a4" name="Default" comment=""
|
4
|
+
<list default="true" id="d905eaf2-5cab-434b-a4d1-1ccf165356a4" name="Default" comment="">
|
5
|
+
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6
|
+
<change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
|
7
|
+
<change beforePath="$PROJECT_DIR$/lib/SimBot.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/SimBot.rb" afterDir="false" />
|
8
|
+
<change beforePath="$PROJECT_DIR$/lib/SimBot/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/SimBot/version.rb" afterDir="false" />
|
9
|
+
<change beforePath="$PROJECT_DIR$/lib/utils.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils.rb" afterDir="false" />
|
10
|
+
</list>
|
5
11
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
6
12
|
<option name="TRACKING_ENABLED" value="true" />
|
7
13
|
<option name="SHOW_DIALOG" value="false" />
|
@@ -10,17 +16,17 @@
|
|
10
16
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
11
17
|
</component>
|
12
18
|
<component name="CoverageDataManager">
|
13
|
-
<SUITE FILE_PATH="coverage/SimBot@Install_My_Gem.rcov" NAME="Install My Gem Coverage Results" MODIFIED="
|
19
|
+
<SUITE FILE_PATH="coverage/SimBot@Install_My_Gem.rcov" NAME="Install My Gem Coverage Results" MODIFIED="1525370580105" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="SimBot" />
|
14
20
|
</component>
|
15
21
|
<component name="FileEditorManager">
|
16
22
|
<splitter split-orientation="horizontal" split-proportion="0.5">
|
17
23
|
<split-first>
|
18
24
|
<leaf>
|
19
|
-
<file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="
|
25
|
+
<file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="true">
|
20
26
|
<entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
|
21
27
|
<provider selected="true" editor-type-id="text-editor">
|
22
|
-
<state relative-caret-position="
|
23
|
-
<caret line="
|
28
|
+
<state relative-caret-position="479">
|
29
|
+
<caret line="23" column="9" lean-forward="true" selection-start-line="23" selection-start-column="9" selection-end-line="23" selection-end-column="9" />
|
24
30
|
</state>
|
25
31
|
</provider>
|
26
32
|
</entry>
|
@@ -28,40 +34,40 @@
|
|
28
34
|
<file leaf-file-name="api_controller.rb" pinned="false" current-in-tab="false">
|
29
35
|
<entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
|
30
36
|
<provider selected="true" editor-type-id="text-editor">
|
31
|
-
<state relative-caret-position="
|
32
|
-
<caret line="
|
37
|
+
<state relative-caret-position="439">
|
38
|
+
<caret line="24" column="5" lean-forward="true" selection-start-line="24" selection-start-column="5" selection-end-line="24" selection-end-column="5" />
|
33
39
|
</state>
|
34
40
|
</provider>
|
35
41
|
</entry>
|
36
42
|
</file>
|
37
|
-
<file leaf-file-name="
|
38
|
-
<entry file="file://$PROJECT_DIR$/
|
43
|
+
<file leaf-file-name="SimBot.gemspec" pinned="false" current-in-tab="false">
|
44
|
+
<entry file="file://$PROJECT_DIR$/SimBot.gemspec">
|
39
45
|
<provider selected="true" editor-type-id="text-editor">
|
40
|
-
<state relative-caret-position="
|
41
|
-
<caret line="
|
46
|
+
<state relative-caret-position="527">
|
47
|
+
<caret line="24" lean-forward="true" selection-start-line="24" selection-end-line="24" />
|
42
48
|
</state>
|
43
49
|
</provider>
|
44
50
|
</entry>
|
45
51
|
</file>
|
46
|
-
<file leaf-file-name="
|
47
|
-
<entry file="file://$PROJECT_DIR$/
|
52
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
53
|
+
<entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
|
48
54
|
<provider selected="true" editor-type-id="text-editor">
|
49
|
-
<state>
|
50
|
-
<caret line="
|
55
|
+
<state relative-caret-position="69">
|
56
|
+
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
|
51
57
|
</state>
|
52
58
|
</provider>
|
53
59
|
</entry>
|
54
60
|
</file>
|
55
|
-
<file leaf-file-name="SimBot
|
56
|
-
<entry file="file://$PROJECT_DIR$/SimBot
|
61
|
+
<file leaf-file-name="SimBot" pinned="false" current-in-tab="false">
|
62
|
+
<entry file="file://$PROJECT_DIR$/exe/SimBot">
|
57
63
|
<provider selected="true" editor-type-id="text-editor">
|
58
|
-
<state relative-caret-position="
|
59
|
-
<caret line="
|
64
|
+
<state relative-caret-position="92">
|
65
|
+
<caret line="4" column="7" lean-forward="true" selection-start-line="4" selection-start-column="7" selection-end-line="4" selection-end-column="7" />
|
60
66
|
</state>
|
61
67
|
</provider>
|
62
68
|
</entry>
|
63
69
|
</file>
|
64
|
-
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="
|
70
|
+
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
|
65
71
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
66
72
|
<provider selected="true" editor-type-id="text-editor">
|
67
73
|
<state relative-caret-position="322">
|
@@ -77,8 +83,8 @@
|
|
77
83
|
<file leaf-file-name="utils.rb" pinned="false" current-in-tab="true">
|
78
84
|
<entry file="file://$PROJECT_DIR$/lib/utils.rb">
|
79
85
|
<provider selected="true" editor-type-id="text-editor">
|
80
|
-
<state relative-caret-position="
|
81
|
-
<caret line="
|
86
|
+
<state relative-caret-position="322">
|
87
|
+
<caret line="14" column="3" lean-forward="true" selection-start-line="14" selection-start-column="3" selection-end-line="14" selection-end-column="3" />
|
82
88
|
</state>
|
83
89
|
</provider>
|
84
90
|
</entry>
|
@@ -110,9 +116,10 @@
|
|
110
116
|
<option value="$PROJECT_DIR$/lib/utilities.rb" />
|
111
117
|
<option value="$PROJECT_DIR$/SimBot.gemspec" />
|
112
118
|
<option value="$PROJECT_DIR$/lib/api_controller.rb" />
|
119
|
+
<option value="$PROJECT_DIR$/.gitignore" />
|
120
|
+
<option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
|
113
121
|
<option value="$PROJECT_DIR$/lib/SimBot.rb" />
|
114
122
|
<option value="$PROJECT_DIR$/lib/utils.rb" />
|
115
|
-
<option value="$PROJECT_DIR$/.gitignore" />
|
116
123
|
</list>
|
117
124
|
</option>
|
118
125
|
</component>
|
@@ -126,7 +133,7 @@
|
|
126
133
|
<packageJsonPaths />
|
127
134
|
</component>
|
128
135
|
<component name="ProjectFrameBounds">
|
129
|
-
<option name="x" value="
|
136
|
+
<option name="x" value="1611" />
|
130
137
|
<option name="y" value="22" />
|
131
138
|
<option name="width" value="1489" />
|
132
139
|
<option name="height" value="1058" />
|
@@ -149,6 +156,12 @@
|
|
149
156
|
<item name="SimBot" type="462c0819:PsiDirectoryNode" />
|
150
157
|
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
151
158
|
</path>
|
159
|
+
<path>
|
160
|
+
<item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
|
161
|
+
<item name="SimBot" type="462c0819:PsiDirectoryNode" />
|
162
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
163
|
+
<item name="SimBot" type="462c0819:PsiDirectoryNode" />
|
164
|
+
</path>
|
152
165
|
</expand>
|
153
166
|
<select />
|
154
167
|
</subPane>
|
@@ -209,23 +222,24 @@
|
|
209
222
|
<option name="number" value="Default" />
|
210
223
|
<option name="presentableId" value="Default" />
|
211
224
|
<updated>1525279604835</updated>
|
212
|
-
<workItem from="1525279607229" duration="
|
225
|
+
<workItem from="1525279607229" duration="31554000" />
|
213
226
|
</task>
|
214
227
|
<servers />
|
215
228
|
</component>
|
216
229
|
<component name="TimeTrackingManager">
|
217
|
-
<option name="totallyTimeSpent" value="
|
230
|
+
<option name="totallyTimeSpent" value="31554000" />
|
218
231
|
</component>
|
219
232
|
<component name="ToolWindowManager">
|
220
|
-
<frame x="
|
233
|
+
<frame x="1611" y="22" width="1489" height="1058" extended-state="0" />
|
234
|
+
<editor active="true" />
|
221
235
|
<layout>
|
222
236
|
<window_info anchor="bottom" id="TODO" order="6" />
|
223
237
|
<window_info anchor="bottom" id="Messages" sideWeight="0.49965397" weight="0.3293348" />
|
224
|
-
<window_info anchor="bottom" id="Event Log" sideWeight="0.50380623" side_tool="true" weight="0.
|
238
|
+
<window_info anchor="bottom" id="Event Log" sideWeight="0.50380623" side_tool="true" weight="0.28540304" />
|
225
239
|
<window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
|
226
|
-
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.48719722" weight="0.
|
240
|
+
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.48719722" visible="true" weight="0.2777778" />
|
227
241
|
<window_info anchor="bottom" id="Version Control" />
|
228
|
-
<window_info
|
242
|
+
<window_info anchor="bottom" id="Terminal" sideWeight="0.49619377" weight="0.3453159" />
|
229
243
|
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24982698" />
|
230
244
|
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
|
231
245
|
<window_info anchor="right" id="Database" />
|
@@ -240,6 +254,28 @@
|
|
240
254
|
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
241
255
|
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
242
256
|
</layout>
|
257
|
+
<layout-to-restore>
|
258
|
+
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="3" weight="0.25" />
|
259
|
+
<window_info anchor="bottom" id="Docker" order="0" show_stripe_button="false" />
|
260
|
+
<window_info anchor="bottom" id="Run" order="8" sideWeight="0.48719722" weight="0.2780807" />
|
261
|
+
<window_info anchor="right" id="Ant Build" order="2" weight="0.25" />
|
262
|
+
<window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
|
263
|
+
<window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.24982698" />
|
264
|
+
<window_info id="Structure" order="2" side_tool="true" weight="0.25" />
|
265
|
+
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="1" type="SLIDING" weight="0.4" />
|
266
|
+
<window_info anchor="bottom" id="TODO" order="12" />
|
267
|
+
<window_info anchor="bottom" id="Database Changes" order="1" show_stripe_button="false" />
|
268
|
+
<window_info anchor="bottom" id="Find" order="7" sideWeight="0.49896193" weight="0.32897604" />
|
269
|
+
<window_info anchor="right" id="Database" order="0" />
|
270
|
+
<window_info active="true" anchor="bottom" id="Terminal" order="2" sideWeight="0.49619377" visible="true" weight="0.20261438" />
|
271
|
+
<window_info anchor="bottom" id="Debug" order="9" weight="0.4" />
|
272
|
+
<window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
|
273
|
+
<window_info anchor="bottom" id="Version Control" order="3" />
|
274
|
+
<window_info anchor="bottom" id="Event Log" order="4" sideWeight="0.50380623" side_tool="true" weight="0.3293348" />
|
275
|
+
<window_info anchor="bottom" id="Message" order="6" />
|
276
|
+
<window_info anchor="bottom" id="Messages" order="5" sideWeight="0.49965397" weight="0.3293348" />
|
277
|
+
<window_info id="Favorites" order="0" side_tool="true" />
|
278
|
+
</layout-to-restore>
|
243
279
|
</component>
|
244
280
|
<component name="TypeScriptGeneratedFilesManager">
|
245
281
|
<option name="version" value="1" />
|
@@ -294,52 +330,62 @@
|
|
294
330
|
</state>
|
295
331
|
</provider>
|
296
332
|
</entry>
|
333
|
+
<entry file="file://$PROJECT_DIR$/.gitignore">
|
334
|
+
<provider selected="true" editor-type-id="text-editor">
|
335
|
+
<state relative-caret-position="322">
|
336
|
+
<caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
|
337
|
+
</state>
|
338
|
+
</provider>
|
339
|
+
</entry>
|
297
340
|
<entry file="file://$PROJECT_DIR$/exe/SimBot">
|
298
341
|
<provider selected="true" editor-type-id="text-editor">
|
299
|
-
<state relative-caret-position="
|
300
|
-
<caret line="
|
342
|
+
<state relative-caret-position="92">
|
343
|
+
<caret line="4" column="7" lean-forward="true" selection-start-line="4" selection-start-column="7" selection-end-line="4" selection-end-column="7" />
|
301
344
|
</state>
|
302
345
|
</provider>
|
303
346
|
</entry>
|
347
|
+
<entry file="file://$PROJECT_DIR$/.ruby-version">
|
348
|
+
<provider selected="true" editor-type-id="text-editor" />
|
349
|
+
</entry>
|
304
350
|
<entry file="file://$PROJECT_DIR$/Gemfile">
|
305
351
|
<provider selected="true" editor-type-id="text-editor">
|
306
|
-
<state relative-caret-position="
|
307
|
-
<caret line="
|
352
|
+
<state relative-caret-position="115">
|
353
|
+
<caret line="5" column="7" lean-forward="true" selection-start-line="5" selection-start-column="7" selection-end-line="5" selection-end-column="7" />
|
308
354
|
</state>
|
309
355
|
</provider>
|
310
356
|
</entry>
|
311
|
-
<entry file="file://$PROJECT_DIR$/lib/
|
357
|
+
<entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
|
312
358
|
<provider selected="true" editor-type-id="text-editor">
|
313
|
-
<state relative-caret-position="
|
314
|
-
<caret line="
|
359
|
+
<state relative-caret-position="69">
|
360
|
+
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
|
315
361
|
</state>
|
316
362
|
</provider>
|
317
363
|
</entry>
|
318
|
-
<entry file="file://$PROJECT_DIR$/
|
364
|
+
<entry file="file://$PROJECT_DIR$/SimBot.gemspec">
|
319
365
|
<provider selected="true" editor-type-id="text-editor">
|
320
|
-
<state relative-caret-position="
|
321
|
-
<caret line="
|
366
|
+
<state relative-caret-position="527">
|
367
|
+
<caret line="24" lean-forward="true" selection-start-line="24" selection-end-line="24" />
|
322
368
|
</state>
|
323
369
|
</provider>
|
324
370
|
</entry>
|
325
|
-
<entry file="file://$PROJECT_DIR$/lib/
|
371
|
+
<entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
|
326
372
|
<provider selected="true" editor-type-id="text-editor">
|
327
|
-
<state relative-caret-position="
|
328
|
-
<caret line="
|
373
|
+
<state relative-caret-position="439">
|
374
|
+
<caret line="24" column="5" lean-forward="true" selection-start-line="24" selection-start-column="5" selection-end-line="24" selection-end-column="5" />
|
329
375
|
</state>
|
330
376
|
</provider>
|
331
377
|
</entry>
|
332
|
-
<entry file="file://$PROJECT_DIR$/SimBot.
|
378
|
+
<entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
|
333
379
|
<provider selected="true" editor-type-id="text-editor">
|
334
|
-
<state relative-caret-position="
|
335
|
-
<caret line="
|
380
|
+
<state relative-caret-position="479">
|
381
|
+
<caret line="23" column="9" lean-forward="true" selection-start-line="23" selection-start-column="9" selection-end-line="23" selection-end-column="9" />
|
336
382
|
</state>
|
337
383
|
</provider>
|
338
384
|
</entry>
|
339
|
-
<entry file="file://$PROJECT_DIR
|
385
|
+
<entry file="file://$PROJECT_DIR$/lib/utils.rb">
|
340
386
|
<provider selected="true" editor-type-id="text-editor">
|
341
387
|
<state relative-caret-position="322">
|
342
|
-
<caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
|
388
|
+
<caret line="14" column="3" lean-forward="true" selection-start-line="14" selection-start-column="3" selection-end-line="14" selection-end-column="3" />
|
343
389
|
</state>
|
344
390
|
</provider>
|
345
391
|
</entry>
|
data/Gemfile.lock
CHANGED
data/lib/SimBot.rb
CHANGED
@@ -6,8 +6,9 @@ module SimBot
|
|
6
6
|
require 'utils'
|
7
7
|
require 'api_controller'
|
8
8
|
desc 'start', 'Start simulation bot parsing in base-url and auth token.'
|
9
|
-
method_option :base_url, type: :string,
|
9
|
+
method_option :base_url, type: :string, default: 'https://platform.test.ovex.io/', desc: 'API base URL'
|
10
10
|
method_option :jwt, type: :string, required: true, desc: 'JWT to be used'
|
11
|
+
method_option :market, type: :string, default: 'bchxrp', required: false, desc: 'OVEX market for SimBot to interact with'
|
11
12
|
method_option :freq, type: :numeric, default: 1, desc: 'Frequency for trades to be added'
|
12
13
|
def start
|
13
14
|
count = 0
|
@@ -15,9 +16,9 @@ module SimBot
|
|
15
16
|
loop do
|
16
17
|
vol = rand(0.2...2.9)
|
17
18
|
price = Utils.get_bchxrp_price
|
18
|
-
api.post_order(
|
19
|
-
sleep
|
20
|
-
api.post_order(
|
19
|
+
api.post_order(options[:market], price, vol, 'sell')
|
20
|
+
sleep(1 / options[:freq])
|
21
|
+
api.post_order(options[:market], price, vol, 'buy')
|
21
22
|
puts "order ##{count} placed"
|
22
23
|
count += 1
|
23
24
|
end
|
@@ -26,5 +27,9 @@ module SimBot
|
|
26
27
|
def bchxrp_price
|
27
28
|
puts Utils.get_bchxrp_price
|
28
29
|
end
|
30
|
+
desc 'eoseth_price', 'get the price of EOS in ETH'
|
31
|
+
def eoseth_price
|
32
|
+
puts Utils.get_eoseth_price
|
33
|
+
end
|
29
34
|
end
|
30
35
|
end
|
data/lib/SimBot/version.rb
CHANGED
data/lib/utils.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
class Utils
|
2
2
|
def self.get_bchxrp_price
|
3
3
|
# fetch bch/xrp price from coin market cap
|
4
|
+
factor = rand(1...1.05)
|
4
5
|
response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=XRP')
|
5
6
|
hash = JSON.parse (response.body)
|
6
|
-
return hash['data']['quotes']['XRP']['price'].to_f.round(4)
|
7
|
+
return hash['data']['quotes']['XRP']['price'].to_f.round(4) * factor
|
7
8
|
end
|
8
|
-
|
9
|
+
def self.get_eoseth_price
|
10
|
+
# fetch bch/xrp price from coin market cap
|
11
|
+
response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1765/?convert=ETH')
|
12
|
+
hash = JSON.parse (response.body)
|
13
|
+
return hash['data']['quotes']['ETH']['price'].to_f.round(4)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|