SimBot 0.1.13 → 0.1.14

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: 0b51e3b9ab75581f85ffcec039f95e6c72866c67b1c34fba12bf7043bd23a7e3
4
- data.tar.gz: 47514f63841786f5e32df4c1269a76fb29562777f5cbc0dc500c43ce664a0e2d
3
+ metadata.gz: ef2fd854c112b6a7114a61ba689aa3e66891038db441e72b767f75e4c5370c0d
4
+ data.tar.gz: 68fee626ae8f6bff7fdb99c6d856896895f99eaf0ea7c2131bd63cd35568f585
5
5
  SHA512:
6
- metadata.gz: bf4f37fc2fa72180ef9d32467e60ccf954eb47b2e6322fa4c506307437183b33f81aa7d86b95ab9714a7ea20cd3968fb8902954dac363f23122f967fb01a062d
7
- data.tar.gz: 5b911eb558750bcd6206f397804920aa1805ecbf9dff035152a6386bf2d4b47e6afb8c602026fcfcab50011c07463ecf76e524dfeac24193414e889ade812691
6
+ metadata.gz: 638223db8acb8c541f750f5e5af5100bd082d0f5a589a6f12341bb412f38e8fa288dff807baa9bf5280f5d8e3d8b78cb7b6976a9b41b1c5c2e96e54f26e2a709
7
+ data.tar.gz: 37c4ba8be466b9272ed5128749118ab52871aacea1433db69cb43056a6f6984b8c516995b25e85a0f3a48b7831e7d9120b096cddf208873c9abe1a4031bedac8
@@ -2,8 +2,11 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
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" />
5
7
  <change beforePath="$PROJECT_DIR$/SimBot-0.1.12.gem" beforeDir="false" />
6
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/api_controller.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/api_controller.rb" afterDir="false" />
7
10
  <change beforePath="$PROJECT_DIR$/lib/wash_trade.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/wash_trade.rb" afterDir="false" />
8
11
  </list>
9
12
  <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -23,8 +26,8 @@
23
26
  <file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="false">
24
27
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
25
28
  <provider selected="true" editor-type-id="text-editor">
26
- <state relative-caret-position="669">
27
- <caret line="39" column="7" lean-forward="true" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
29
+ <state relative-caret-position="897">
30
+ <caret line="39" column="7" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
28
31
  </state>
29
32
  </provider>
30
33
  </entry>
@@ -59,8 +62,8 @@
59
62
  <file leaf-file-name="api_controller.rb" pinned="false" current-in-tab="false">
60
63
  <entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
61
64
  <provider selected="true" editor-type-id="text-editor">
62
- <state relative-caret-position="184">
63
- <caret line="8" column="24" selection-start-line="8" selection-start-column="24" selection-end-line="8" selection-end-column="24" />
65
+ <state relative-caret-position="460">
66
+ <caret line="20" column="27" selection-start-line="20" selection-start-column="27" selection-end-line="20" selection-end-column="27" />
64
67
  </state>
65
68
  </provider>
66
69
  </entry>
@@ -72,8 +75,8 @@
72
75
  <file leaf-file-name="utils.rb" pinned="false" current-in-tab="false">
73
76
  <entry file="file://$PROJECT_DIR$/lib/utils.rb">
74
77
  <provider selected="true" editor-type-id="text-editor">
75
- <state relative-caret-position="92">
76
- <caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
78
+ <state relative-caret-position="595">
79
+ <caret line="27" column="5" selection-start-line="27" selection-start-column="5" selection-end-line="27" selection-end-column="5" />
77
80
  </state>
78
81
  </provider>
79
82
  </entry>
@@ -90,8 +93,8 @@
90
93
  <file leaf-file-name="barong.rb" pinned="false" current-in-tab="false">
91
94
  <entry file="file://$PROJECT_DIR$/lib/barong.rb">
92
95
  <provider selected="true" editor-type-id="text-editor">
93
- <state relative-caret-position="115">
94
- <caret line="5" selection-start-line="5" selection-end-line="8" selection-end-column="7" />
96
+ <state relative-caret-position="92">
97
+ <caret line="4" column="25" selection-start-line="4" selection-start-column="25" selection-end-line="4" selection-end-column="25" />
95
98
  </state>
96
99
  </provider>
97
100
  </entry>
@@ -108,8 +111,17 @@
108
111
  <file leaf-file-name="wash_trade.rb" pinned="false" current-in-tab="true">
109
112
  <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
110
113
  <provider selected="true" editor-type-id="text-editor">
111
- <state relative-caret-position="156">
112
- <caret line="35" column="7" lean-forward="true" selection-start-line="35" selection-start-column="7" selection-end-line="35" selection-end-column="7" />
114
+ <state relative-caret-position="632">
115
+ <caret line="37" column="7" lean-forward="true" selection-start-line="37" selection-start-column="7" selection-end-line="37" selection-end-column="7" />
116
+ </state>
117
+ </provider>
118
+ </entry>
119
+ </file>
120
+ <file leaf-file-name="SimBot_spec.rb" pinned="false" current-in-tab="false">
121
+ <entry file="file://$PROJECT_DIR$/spec/SimBot_spec.rb">
122
+ <provider selected="true" editor-type-id="text-editor">
123
+ <state relative-caret-position="161">
124
+ <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
113
125
  </state>
114
126
  </provider>
115
127
  </entry>
@@ -140,7 +152,6 @@
140
152
  <option value="$PROJECT_DIR$/exe/SimBot" />
141
153
  <option value="$PROJECT_DIR$/lib/utilities.rb" />
142
154
  <option value="$PROJECT_DIR$/.gitignore" />
143
- <option value="$PROJECT_DIR$/lib/api_controller.rb" />
144
155
  <option value="$PROJECT_DIR$/lib/barong.rb" />
145
156
  <option value="$PROJECT_DIR$/SimBot.gemspec" />
146
157
  <option value="$PROJECT_DIR$/lib/Deamons/WashTrade.rb" />
@@ -148,6 +159,7 @@
148
159
  <option value="$PROJECT_DIR$/lib/Deamons/wash_trade.rb" />
149
160
  <option value="$PROJECT_DIR$/lib/SimBot.rb" />
150
161
  <option value="$PROJECT_DIR$/lib/utils.rb" />
162
+ <option value="$PROJECT_DIR$/lib/api_controller.rb" />
151
163
  <option value="$PROJECT_DIR$/lib/wash_trade.rb" />
152
164
  <option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
153
165
  </list>
@@ -184,18 +196,18 @@
184
196
  <path>
185
197
  <item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
186
198
  <item name="SimBot" type="462c0819:PsiDirectoryNode" />
187
- <item name="bin" type="462c0819:PsiDirectoryNode" />
199
+ <item name="lib" type="462c0819:PsiDirectoryNode" />
188
200
  </path>
189
201
  <path>
190
202
  <item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
191
203
  <item name="SimBot" type="462c0819:PsiDirectoryNode" />
192
204
  <item name="lib" type="462c0819:PsiDirectoryNode" />
205
+ <item name="SimBot" type="462c0819:PsiDirectoryNode" />
193
206
  </path>
194
207
  <path>
195
208
  <item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
196
209
  <item name="SimBot" type="462c0819:PsiDirectoryNode" />
197
- <item name="lib" type="462c0819:PsiDirectoryNode" />
198
- <item name="SimBot" type="462c0819:PsiDirectoryNode" />
210
+ <item name="spec" type="462c0819:PsiDirectoryNode" />
199
211
  </path>
200
212
  </expand>
201
213
  <select />
@@ -264,12 +276,12 @@
264
276
  <updated>1525279604835</updated>
265
277
  <workItem from="1525279607229" duration="36216000" />
266
278
  <workItem from="1528301072964" duration="35313000" />
267
- <workItem from="1528709208580" duration="10176000" />
279
+ <workItem from="1528709208580" duration="16041000" />
268
280
  </task>
269
281
  <servers />
270
282
  </component>
271
283
  <component name="TimeTrackingManager">
272
- <option name="totallyTimeSpent" value="81705000" />
284
+ <option name="totallyTimeSpent" value="87570000" />
273
285
  </component>
274
286
  <component name="ToolWindowManager">
275
287
  <frame x="1440" y="22" width="1615" height="1058" extended-state="0" />
@@ -282,7 +294,7 @@
282
294
  <window_info anchor="right" id="Database" order="3" />
283
295
  <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
284
296
  <window_info anchor="bottom" id="Version Control" order="7" />
285
- <window_info anchor="bottom" id="Run" order="2" sideWeight="0.48719722" visible="true" weight="0.28540304" />
297
+ <window_info anchor="bottom" id="Run" order="2" sideWeight="0.48719722" weight="0.28540304" />
286
298
  <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
287
299
  <window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49619377" weight="0.41463414" />
288
300
  <window_info id="Favorites" order="2" side_tool="true" />
@@ -471,81 +483,88 @@
471
483
  </provider>
472
484
  </entry>
473
485
  <entry file="file://$PROJECT_DIR$/lib/utilities.rb" />
474
- <entry file="file://$PROJECT_DIR$/.gitignore">
486
+ <entry file="file://$PROJECT_DIR$/Gemfile">
475
487
  <provider selected="true" editor-type-id="text-editor">
476
- <state relative-caret-position="322">
477
- <caret line="14" selection-start-line="14" selection-end-line="14" />
488
+ <state relative-caret-position="138">
489
+ <caret line="6" selection-start-line="6" selection-end-line="6" />
478
490
  </state>
479
491
  </provider>
480
492
  </entry>
481
- <entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
493
+ <entry file="file://$PROJECT_DIR$/bin/setup">
482
494
  <provider selected="true" editor-type-id="text-editor">
483
495
  <state relative-caret-position="184">
484
- <caret line="8" column="24" selection-start-line="8" selection-start-column="24" selection-end-line="8" selection-end-column="24" />
496
+ <caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" />
485
497
  </state>
486
498
  </provider>
487
499
  </entry>
488
- <entry file="file://$PROJECT_DIR$/Gemfile">
500
+ <entry file="file://$PROJECT_DIR$/bin/console">
489
501
  <provider selected="true" editor-type-id="text-editor">
490
- <state relative-caret-position="138">
491
- <caret line="6" selection-start-line="6" selection-end-line="6" />
502
+ <state relative-caret-position="322">
503
+ <caret line="14" selection-start-line="14" selection-end-line="14" />
492
504
  </state>
493
505
  </provider>
494
506
  </entry>
495
- <entry file="file://$PROJECT_DIR$/bin/setup">
507
+ <entry file="file://$PROJECT_DIR$/lib/Deamons/deamon.rb" />
508
+ <entry file="file://$PROJECT_DIR$/lib/barong.rb">
496
509
  <provider selected="true" editor-type-id="text-editor">
497
- <state relative-caret-position="184">
498
- <caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" />
510
+ <state relative-caret-position="92">
511
+ <caret line="4" column="25" selection-start-line="4" selection-start-column="25" selection-end-line="4" selection-end-column="25" />
499
512
  </state>
500
513
  </provider>
501
514
  </entry>
502
- <entry file="file://$PROJECT_DIR$/bin/console">
515
+ <entry file="file://$PROJECT_DIR$/.gitignore">
503
516
  <provider selected="true" editor-type-id="text-editor">
504
517
  <state relative-caret-position="322">
505
518
  <caret line="14" selection-start-line="14" selection-end-line="14" />
506
519
  </state>
507
520
  </provider>
508
521
  </entry>
509
- <entry file="file://$PROJECT_DIR$/SimBot.gemspec">
522
+ <entry file="file://$PROJECT_DIR$/spec/SimBot_spec.rb">
510
523
  <provider selected="true" editor-type-id="text-editor">
511
- <state relative-caret-position="483">
512
- <caret line="21" column="32" selection-start-line="21" selection-start-column="32" selection-end-line="21" selection-end-column="32" />
524
+ <state relative-caret-position="161">
525
+ <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
513
526
  </state>
514
527
  </provider>
515
528
  </entry>
516
- <entry file="file://$PROJECT_DIR$/lib/barong.rb">
529
+ <entry file="file://$PROJECT_DIR$/lib/utils.rb">
517
530
  <provider selected="true" editor-type-id="text-editor">
518
- <state relative-caret-position="115">
519
- <caret line="5" selection-start-line="5" selection-end-line="8" selection-end-column="7" />
531
+ <state relative-caret-position="595">
532
+ <caret line="27" column="5" selection-start-line="27" selection-start-column="5" selection-end-line="27" selection-end-column="5" />
520
533
  </state>
521
534
  </provider>
522
535
  </entry>
523
- <entry file="file://$PROJECT_DIR$/lib/Deamons/deamon.rb" />
524
- <entry file="file://$PROJECT_DIR$/exe/SimBot">
536
+ <entry file="file://$PROJECT_DIR$/SimBot.gemspec">
525
537
  <provider selected="true" editor-type-id="text-editor">
526
- <state relative-caret-position="92">
527
- <caret line="4" column="7" selection-start-line="4" selection-start-column="7" selection-end-line="4" selection-end-column="7" />
538
+ <state relative-caret-position="483">
539
+ <caret line="21" column="32" selection-start-line="21" selection-start-column="32" selection-end-line="21" selection-end-column="32" />
540
+ </state>
541
+ </provider>
542
+ </entry>
543
+ <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
544
+ <provider selected="true" editor-type-id="text-editor">
545
+ <state relative-caret-position="632">
546
+ <caret line="37" column="7" lean-forward="true" selection-start-line="37" selection-start-column="7" selection-end-line="37" selection-end-column="7" />
528
547
  </state>
529
548
  </provider>
530
549
  </entry>
531
550
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
532
551
  <provider selected="true" editor-type-id="text-editor">
533
- <state relative-caret-position="669">
534
- <caret line="39" column="7" lean-forward="true" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
552
+ <state relative-caret-position="897">
553
+ <caret line="39" column="7" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
535
554
  </state>
536
555
  </provider>
537
556
  </entry>
538
- <entry file="file://$PROJECT_DIR$/lib/utils.rb">
557
+ <entry file="file://$PROJECT_DIR$/exe/SimBot">
539
558
  <provider selected="true" editor-type-id="text-editor">
540
559
  <state relative-caret-position="92">
541
- <caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
560
+ <caret line="4" column="7" selection-start-line="4" selection-start-column="7" selection-end-line="4" selection-end-column="7" />
542
561
  </state>
543
562
  </provider>
544
563
  </entry>
545
- <entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
564
+ <entry file="file://$PROJECT_DIR$/lib/api_controller.rb">
546
565
  <provider selected="true" editor-type-id="text-editor">
547
- <state relative-caret-position="156">
548
- <caret line="35" column="7" lean-forward="true" selection-start-line="35" selection-start-column="7" selection-end-line="35" selection-end-column="7" />
566
+ <state relative-caret-position="460">
567
+ <caret line="20" column="27" selection-start-line="20" selection-start-column="27" selection-end-line="20" selection-end-column="27" />
549
568
  </state>
550
569
  </provider>
551
570
  </entry>
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- SimBot (0.1.12)
4
+ SimBot (0.1.13)
5
5
  json
6
6
  pusher-client
7
7
  rest-client
@@ -1,3 +1,3 @@
1
1
  module SimBot
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
@@ -13,14 +13,14 @@ class ApiController
13
13
  def post_order(market, price, volume, type)
14
14
  response = RestClient.post("#{@endpoint}/orders",
15
15
  {
16
- 'market': market,
17
- 'side': type.to_s,
18
- 'volume': volume.to_s,
19
- 'price': price.to_s,
20
- 'ord_type': 'limit'
16
+ 'market': market,
17
+ 'side': type.to_s,
18
+ 'volume': volume.to_s,
19
+ 'price': price.to_s,
20
+ 'ord_type': 'limit'
21
21
  },
22
- { 'Authorization': "Bearer #{@auth_token}",
22
+ {'Authorization': "Bearer #{@auth_token}",
23
23
  'content_type': 'application/x-www-form-urlencoded'})
24
24
  #puts response
25
25
  end
26
- end
26
+ end
@@ -1,8 +1,8 @@
1
-
2
1
  module Deamons
3
2
  # Simple process to add wash trades to a market in order to simulate trade matching for QA and dev
4
3
  class WashTrade
5
4
  require 'utils'
5
+
6
6
  def initialize(api, market, freq)
7
7
  @g_count = 1
8
8
  @range = 1.015
@@ -12,7 +12,7 @@ module Deamons
12
12
  Process.fork do
13
13
  Process.daemon(true)
14
14
  pid = Process.pid
15
- redirect("#{pid}.outfile","#{pid}.errfile")
15
+ redirect("#{pid}.outfile", "#{pid}.errfile")
16
16
  write_pid_file(pid, "#{pid}.pid")
17
17
  start
18
18
  end
@@ -21,21 +21,23 @@ module Deamons
21
21
 
22
22
  def start
23
23
  count = 0
24
+ puts "--------#{@market} -------"
24
25
  loop do
25
26
  vol = rand(0.2...3)
26
- price = move_price
27
+ price = aug_price
27
28
  @api.post_order(@market, price, vol, 'sell')
28
29
  delay = (1.00 / @freq)
29
30
  sleep(delay)
30
31
  @api.post_order(@market, price, vol, 'buy')
31
32
  puts "order ##{count} placed"
32
33
  count += 1
34
+ rescue ::StandardError => e
35
+ STDERR.puts e
36
+ next
33
37
  end
34
- rescue ::StandardError => e
35
- puts e
36
38
  end
37
39
 
38
- def move_price
40
+ def aug_price
39
41
  if @g_count > 60
40
42
  @range = rand(1.003...1.010)
41
43
  @g_count = 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SimBot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Ovadia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler