bitex_bot 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a39b95522374291e1dbdc8f33d3fde97d15db2be
4
+ data.tar.gz: e3da7735d646f8e99e3636b75c296d4cebc8c471
5
+ SHA512:
6
+ metadata.gz: 9272fa653acd4d6155b971e322da57865d5e7e116e17217947b39ffd245e7c5675a1b557e0ff11ed24e9d3f474f26c47d6fcd4ec28dc3c2ae5ce2710fe030baa
7
+ data.tar.gz: effe749aa919234ff0a2c27090b4b1c3bfa6065d6769a222e95c809536431b2cfd036048f108867e973ca9c1c154388febde61a9234da4ecaea4ea7d569bcaeb
data/bitex_bot.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "activesupport"
27
27
  spec.add_dependency "sqlite3"
28
28
  spec.add_dependency "bitstamp"
29
- spec.add_dependency "bitex", "0.1.9"
29
+ spec.add_dependency "bitex", "0.2.1"
30
30
  spec.add_dependency "itbit", "0.0.3"
31
31
  spec.add_dependency "mail"
32
32
  spec.add_dependency "hashie"
@@ -88,7 +88,7 @@ module BitexBot
88
88
  add_index :close_sells, :order_id
89
89
  end
90
90
 
91
- unless ActiveRecord::Base.connection.column_exists?('stores', 'buying_amount_to_spend_per_order')
91
+ unless ActiveRecord::Base.connection.table_exists?('stores')
92
92
  create_table "stores", force: true do |t|
93
93
  t.decimal "taker_usd", precision: 20, scale: 8
94
94
  t.decimal "taker_btc", precision: 20, scale: 8
@@ -25,7 +25,14 @@ class BitstampApiWrapper
25
25
  # }
26
26
  def self.order_book(retries = 20)
27
27
  begin
28
- Bitstamp.order_book
28
+ book = Bitstamp.order_book
29
+ age = Time.now.to_i - book["timestamp"].to_i)
30
+ if age > 300
31
+ BitexBot::Robot.logger.info("Refusing to continue as orderbook is #{age} seconds old")
32
+ self.order_book(retries)
33
+ else
34
+ book
35
+ end
29
36
  rescue StandardError => e
30
37
  if retries == 0
31
38
  raise
@@ -146,7 +146,7 @@ module BitexBot
146
146
  total_usd = balances['usd_balance'].to_d + profile[:usd_balance]
147
147
  total_btc = balances['btc_balance'].to_d + profile[:btc_balance]
148
148
 
149
- last_log = `tail -n 500 #{Settings.log.try(:file)}` if Settings.log.try(:file)
149
+ last_log = `tail -c 61440 #{Settings.log.try(:file)}` if Settings.log.try(:file)
150
150
 
151
151
  store.update_attributes(taker_usd: balances['usd_balance'],
152
152
  taker_btc: balances['btc_balance'], log: last_log)
@@ -1,3 +1,3 @@
1
1
  module BitexBot
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitex_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
5
- prerelease:
4
+ version: 0.2.9
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nubis
@@ -10,108 +9,95 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2015-03-17 00:00:00.000000000 Z
12
+ date: 2015-08-05 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: settingslogic
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: activerecord
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: activesupport
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - ">="
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: sqlite3
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - ">="
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - ">="
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: bitstamp
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - ">="
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - ">="
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: bitex
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
88
  - - '='
101
89
  - !ruby/object:Gem::Version
102
- version: 0.1.9
90
+ version: 0.2.1
103
91
  type: :runtime
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
95
  - - '='
109
96
  - !ruby/object:Gem::Version
110
- version: 0.1.9
97
+ version: 0.2.1
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: itbit
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
102
  - - '='
117
103
  - !ruby/object:Gem::Version
@@ -119,7 +105,6 @@ dependencies:
119
105
  type: :runtime
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
109
  - - '='
125
110
  - !ruby/object:Gem::Version
@@ -127,182 +112,161 @@ dependencies:
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: mail
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
- - - ! '>='
116
+ - - ">="
133
117
  - !ruby/object:Gem::Version
134
118
  version: '0'
135
119
  type: :runtime
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
- - - ! '>='
123
+ - - ">="
141
124
  - !ruby/object:Gem::Version
142
125
  version: '0'
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: hashie
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
- - - ! '>='
130
+ - - ">="
149
131
  - !ruby/object:Gem::Version
150
132
  version: '0'
151
133
  type: :runtime
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
- - - ! '>='
137
+ - - ">="
157
138
  - !ruby/object:Gem::Version
158
139
  version: '0'
159
140
  - !ruby/object:Gem::Dependency
160
141
  name: bundler
161
142
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
143
  requirements:
164
- - - ~>
144
+ - - "~>"
165
145
  - !ruby/object:Gem::Version
166
146
  version: '1.3'
167
147
  type: :development
168
148
  prerelease: false
169
149
  version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
- - - ~>
151
+ - - "~>"
173
152
  - !ruby/object:Gem::Version
174
153
  version: '1.3'
175
154
  - !ruby/object:Gem::Dependency
176
155
  name: rake
177
156
  requirement: !ruby/object:Gem::Requirement
178
- none: false
179
157
  requirements:
180
- - - ! '>='
158
+ - - ">="
181
159
  - !ruby/object:Gem::Version
182
160
  version: '0'
183
161
  type: :development
184
162
  prerelease: false
185
163
  version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
164
  requirements:
188
- - - ! '>='
165
+ - - ">="
189
166
  - !ruby/object:Gem::Version
190
167
  version: '0'
191
168
  - !ruby/object:Gem::Dependency
192
169
  name: rspec
193
170
  requirement: !ruby/object:Gem::Requirement
194
- none: false
195
171
  requirements:
196
- - - ! '>='
172
+ - - ">="
197
173
  - !ruby/object:Gem::Version
198
174
  version: '0'
199
175
  type: :development
200
176
  prerelease: false
201
177
  version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
178
  requirements:
204
- - - ! '>='
179
+ - - ">="
205
180
  - !ruby/object:Gem::Version
206
181
  version: '0'
207
182
  - !ruby/object:Gem::Dependency
208
183
  name: rspec-mocks
209
184
  requirement: !ruby/object:Gem::Requirement
210
- none: false
211
185
  requirements:
212
- - - ! '>='
186
+ - - ">="
213
187
  - !ruby/object:Gem::Version
214
188
  version: '0'
215
189
  type: :development
216
190
  prerelease: false
217
191
  version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
192
  requirements:
220
- - - ! '>='
193
+ - - ">="
221
194
  - !ruby/object:Gem::Version
222
195
  version: '0'
223
196
  - !ruby/object:Gem::Dependency
224
197
  name: database_cleaner
225
198
  requirement: !ruby/object:Gem::Requirement
226
- none: false
227
199
  requirements:
228
- - - ! '>='
200
+ - - ">="
229
201
  - !ruby/object:Gem::Version
230
202
  version: '0'
231
203
  type: :development
232
204
  prerelease: false
233
205
  version_requirements: !ruby/object:Gem::Requirement
234
- none: false
235
206
  requirements:
236
- - - ! '>='
207
+ - - ">="
237
208
  - !ruby/object:Gem::Version
238
209
  version: '0'
239
210
  - !ruby/object:Gem::Dependency
240
211
  name: factory_girl
241
212
  requirement: !ruby/object:Gem::Requirement
242
- none: false
243
213
  requirements:
244
- - - ! '>='
214
+ - - ">="
245
215
  - !ruby/object:Gem::Version
246
216
  version: '0'
247
217
  type: :development
248
218
  prerelease: false
249
219
  version_requirements: !ruby/object:Gem::Requirement
250
- none: false
251
220
  requirements:
252
- - - ! '>='
221
+ - - ">="
253
222
  - !ruby/object:Gem::Version
254
223
  version: '0'
255
224
  - !ruby/object:Gem::Dependency
256
225
  name: timecop
257
226
  requirement: !ruby/object:Gem::Requirement
258
- none: false
259
227
  requirements:
260
- - - ! '>='
228
+ - - ">="
261
229
  - !ruby/object:Gem::Version
262
230
  version: '0'
263
231
  type: :development
264
232
  prerelease: false
265
233
  version_requirements: !ruby/object:Gem::Requirement
266
- none: false
267
234
  requirements:
268
- - - ! '>='
235
+ - - ">="
269
236
  - !ruby/object:Gem::Version
270
237
  version: '0'
271
238
  - !ruby/object:Gem::Dependency
272
239
  name: debugger
273
240
  requirement: !ruby/object:Gem::Requirement
274
- none: false
275
241
  requirements:
276
- - - ! '>='
242
+ - - ">="
277
243
  - !ruby/object:Gem::Version
278
244
  version: '0'
279
245
  type: :development
280
246
  prerelease: false
281
247
  version_requirements: !ruby/object:Gem::Requirement
282
- none: false
283
248
  requirements:
284
- - - ! '>='
249
+ - - ">="
285
250
  - !ruby/object:Gem::Version
286
251
  version: '0'
287
252
  - !ruby/object:Gem::Dependency
288
253
  name: shoulda-matchers
289
254
  requirement: !ruby/object:Gem::Requirement
290
- none: false
291
255
  requirements:
292
- - - ! '>='
256
+ - - ">="
293
257
  - !ruby/object:Gem::Version
294
258
  version: '0'
295
259
  type: :development
296
260
  prerelease: false
297
261
  version_requirements: !ruby/object:Gem::Requirement
298
- none: false
299
262
  requirements:
300
- - - ! '>='
263
+ - - ">="
301
264
  - !ruby/object:Gem::Version
302
265
  version: '0'
303
- description: ! "Both a trading robot and a library to build trading\n robots.
304
- The bitex-bot lets you buy cheap on bitex and\n sell on another
305
- exchange and vice versa."
266
+ description: |-
267
+ Both a trading robot and a library to build trading
268
+ robots. The bitex-bot lets you buy cheap on bitex and
269
+ sell on another exchange and vice versa.
306
270
  email:
307
271
  - nb@bitex.la
308
272
  - tr@bitex.la
@@ -311,8 +275,8 @@ executables:
311
275
  extensions: []
312
276
  extra_rdoc_files: []
313
277
  files:
314
- - .gitignore
315
- - .rspec
278
+ - ".gitignore"
279
+ - ".rspec"
316
280
  - Gemfile
317
281
  - LICENSE.txt
318
282
  - README.md
@@ -357,27 +321,26 @@ files:
357
321
  homepage: ''
358
322
  licenses:
359
323
  - MIT
324
+ metadata: {}
360
325
  post_install_message:
361
326
  rdoc_options: []
362
327
  require_paths:
363
328
  - lib
364
329
  required_ruby_version: !ruby/object:Gem::Requirement
365
- none: false
366
330
  requirements:
367
- - - ! '>='
331
+ - - ">="
368
332
  - !ruby/object:Gem::Version
369
333
  version: '0'
370
334
  required_rubygems_version: !ruby/object:Gem::Requirement
371
- none: false
372
335
  requirements:
373
- - - ! '>='
336
+ - - ">="
374
337
  - !ruby/object:Gem::Version
375
338
  version: '0'
376
339
  requirements: []
377
340
  rubyforge_project:
378
- rubygems_version: 1.8.23
341
+ rubygems_version: 2.4.5
379
342
  signing_key:
380
- specification_version: 3
343
+ specification_version: 4
381
344
  summary: A trading robot to do arbitrage between bitex.la and other exchanges!
382
345
  test_files:
383
346
  - spec/factories/bitex_buy.rb
@@ -395,4 +358,3 @@ test_files:
395
358
  - spec/spec_helper.rb
396
359
  - spec/support/bitex_stubs.rb
397
360
  - spec/support/bitstamp_stubs.rb
398
- has_rdoc: