rbtc_arbitrage_simple 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +23 -0
  5. data/Gemfile +18 -0
  6. data/Gemfile.lock +156 -0
  7. data/Guardfile +8 -0
  8. data/LICENSE.txt +22 -0
  9. data/Procfile +1 -0
  10. data/README.md +88 -0
  11. data/Rakefile +10 -0
  12. data/bin/rbtc_simple +4 -0
  13. data/dummy_web_server.rb +9 -0
  14. data/lib/rbtc_arbitrage.rb +15 -0
  15. data/lib/rbtc_arbitrage/campbx.rb +98 -0
  16. data/lib/rbtc_arbitrage/cli.rb +19 -0
  17. data/lib/rbtc_arbitrage/client.rb +48 -0
  18. data/lib/rbtc_arbitrage/clients/btce_client.rb +62 -0
  19. data/lib/rbtc_arbitrage/clients/campbx_client.rb +48 -0
  20. data/lib/rbtc_arbitrage/clients/client.rb.example +46 -0
  21. data/lib/rbtc_arbitrage/clients/coinbase_client.rb +63 -0
  22. data/lib/rbtc_arbitrage/clients/mtgox_client.rb +56 -0
  23. data/lib/rbtc_arbitrage/trader.rb +123 -0
  24. data/lib/rbtc_arbitrage/version.rb +3 -0
  25. data/rbtc_arbitrage.gemspec +30 -0
  26. data/spec/cli_spec.rb +8 -0
  27. data/spec/client_spec.rb +33 -0
  28. data/spec/clients/btce_client_spec.rb +93 -0
  29. data/spec/clients/campbx_client_spec.rb +66 -0
  30. data/spec/clients/coinbase_client_spec.rb +66 -0
  31. data/spec/clients/mtgox_client_spec.rb +53 -0
  32. data/spec/rbtc_arbitrage_spec.rb +11 -0
  33. data/spec/spec_helper.rb +34 -0
  34. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_balance/fetches_the_balance_correctly.yml +96 -0
  35. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_buy_correctly.yml +52 -0
  36. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_sell_correctly.yml +52 -0
  37. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_prices_correctly.yml +44 -0
  38. data/spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_balance/should_raise_if_bad_API_keys.yml +53 -0
  39. data/spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/calls_btc-e.yml +91 -0
  40. data/spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_buy_correctly.yml +47 -0
  41. data/spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_sell_correctly.yml +47 -0
  42. data/spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_balance/fetches_the_balance_correctly.yml +95 -0
  43. data/spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_buy_correctly.yml +49 -0
  44. data/spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_sell_correctly.yml +49 -0
  45. data/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml +109 -0
  46. data/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml +215 -0
  47. data/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml +56 -0
  48. data/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml +56 -0
  49. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +77 -0
  50. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +44 -0
  51. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +44 -0
  52. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +85 -0
  53. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +88 -0
  54. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +81 -0
  55. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +81 -0
  56. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +88 -0
  57. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +166 -0
  58. data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +173 -0
  59. data/spec/trader_spec.rb +228 -0
  60. metadata +249 -0
@@ -0,0 +1,228 @@
1
+ require 'spec_helper'
2
+ describe RbtcArbitrage::Trader do
3
+ let(:trader) { RbtcArbitrage::Trader.new(verbose: false) }
4
+ describe "#validate_env" do
5
+
6
+ before :each do
7
+ @old_keys = {}
8
+ #clear env variables
9
+ ["KEY", "SECRET"].each do |suffix|
10
+ RbtcArbitrage.clients.each do |client_class|
11
+ key = "#{client_class.new.exchange.to_s.upcase}_#{suffix}"
12
+ @old_keys[key] = ENV[key]
13
+ ENV[key] = nil
14
+ end
15
+ end
16
+ end
17
+
18
+ after :each do
19
+ @old_keys ||= {}
20
+ @old_keys.each do |k,v|
21
+ ENV[k] = v
22
+ end
23
+ end
24
+
25
+ RbtcArbitrage.clients.each do |client|
26
+ describe client do
27
+ keys = ["KEY", "SECRET"]
28
+ keys.pop if client.new.exchange == :coinbase
29
+ keys << "ADDRESS" unless client.instance_methods(false).include?(:address)
30
+ client = client.new
31
+ prefix = client.exchange.to_s.upcase
32
+ keys.each do |suffix|
33
+ key = "#{prefix}_#{suffix}"
34
+ it "should raise errors when missing env variable $#{key}" do
35
+ expect { client.validate_env }.to raise_error(ArgumentError)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ describe "#fetch_prices" do
43
+ it "gets the right price set", :vcr do
44
+ stamp_price = CampBX::API.new.xticker["Best Ask"].to_f
45
+ mtgox_price = MtGox.ticker.buy
46
+
47
+ trader.fetch_prices
48
+
49
+ #allow for recent price changes
50
+ trader.buyer[:price].should be_within(0.02).of(stamp_price)
51
+ trader.seller[:price].should be_within(0.02).of(mtgox_price)
52
+ end
53
+
54
+ it "calculates profit and percent accurately" do
55
+ trader.buy_client.stub(:price) { 10.5 }
56
+ trader.sell_client.stub(:price) { 10 }
57
+
58
+ trader.fetch_prices
59
+ trader.instance_variable_get(:@paid).should == (10.5 * 1.006 * 0.01)
60
+ trader.instance_variable_get(:@received).should == (10 * 0.994 * 0.01)
61
+ end
62
+ end
63
+
64
+ describe "#initialize" do
65
+ let(:options) {
66
+ {
67
+ volume: 1,
68
+ cutoff: 1,
69
+ logger: nil,
70
+ verbose: false,
71
+ live: true,
72
+ seller: :btce,
73
+ buyer: :mtgox,
74
+ }
75
+ }
76
+
77
+ let(:trader) { RbtcArbitrage::Trader.new(options) }
78
+
79
+ it "sets the right options" do
80
+ trader #memoize
81
+ options.each do |k,v|
82
+ next if [:seller,:buyer].include?(k)
83
+ trader.options[k].should == v
84
+ end
85
+ end
86
+
87
+ it "sets the right exchanges" do
88
+ trader.buy_client.should be_a(RbtcArbitrage::Clients::MtGoxClient)
89
+ trader.sell_client.should be_a(RbtcArbitrage::Clients::BtceClient)
90
+ end
91
+
92
+ end
93
+
94
+ describe "#execute_trade" do
95
+ it "should raise SecurityError if not live", :vcr do
96
+ expect { trader.execute_trade }.to raise_error(SecurityError)
97
+ end
98
+
99
+ context "when live" do
100
+ let(:trader) { RbtcArbitrage::Trader.new(verbose: false, cutoff: 100, live: true) }
101
+
102
+ it "shouldn't raise security error", :vcr do
103
+ expect { trader.execute_trade }.not_to raise_error
104
+ end
105
+
106
+ it "should fetch balance", :vcr do
107
+ trader.should_receive(:get_balance)
108
+ trader.execute_trade
109
+ end
110
+
111
+ it "raises SecurityError if not enough USD", :vcr do
112
+ trader.instance_variable_set :@percent, 101
113
+ trader.instance_variable_set :@paid, 10000
114
+ trader.buyer[:usd] = 0
115
+ expect { trader.execute_trade }.to raise_error(SecurityError)
116
+ end
117
+
118
+ it "raises SecurityError if not enough BTC", :vcr do
119
+ trader.instance_variable_set :@percent, 101
120
+ trader.instance_variable_set :@paid, 1
121
+ trader.buyer[:usd] = 2
122
+ trader.options[:volume] = 1
123
+ trader.seller[:btc] = 0
124
+ expect { trader.execute_trade }.to raise_error(SecurityError)
125
+ end
126
+
127
+ it "should buy and sell" do
128
+ trader.instance_variable_set :@percent, 101
129
+ trader.instance_variable_set :@paid, 1
130
+ trader.buyer[:usd] = 2
131
+ trader.options[:volume] = 1
132
+ trader.seller[:btc] = 2
133
+ trader.should_receive :get_balance
134
+ trader.buy_client.should_receive(:buy)
135
+ trader.sell_client.should_receive(:sell)
136
+ trader.buy_client.should_receive(:transfer).with(trader.sell_client)
137
+ trader.execute_trade
138
+ end
139
+ end
140
+ end
141
+
142
+ describe "#trade" do
143
+ it "calls the right methods" do
144
+ trader.should_receive(:fetch_prices)
145
+ trader.should_not_receive(:log_info)
146
+ trader.should_not_receive(:execute_trade)
147
+
148
+ trader.instance_variable_set :@percent, 0
149
+
150
+ trader.trade
151
+ end
152
+
153
+ it "raises SecurityError if cutoff > percent" do
154
+ trader.options[:live] = true
155
+ trader.options[:cutoff] = 10
156
+ trader.instance_variable_set :@percent, 1
157
+
158
+ trader.should_receive(:fetch_prices)
159
+ trader.should_not_receive(:log_info)
160
+
161
+ expect { trader.trade }.to raise_error(SecurityError)
162
+ end
163
+
164
+ it "should repeat if specified" do
165
+ trader.options[:repeat] = 10
166
+ trader.should_receive(:fetch_prices)
167
+ trader.should_receive(:trade).and_call_original
168
+ trader.should_receive(:trade_again)
169
+ trader.trade
170
+ end
171
+
172
+ it "calls #execute_trade if percent > cutoff" do
173
+ trader.options[:live] = true
174
+ trader.options[:cutoff] = 1
175
+ trader.instance_variable_set :@percent, 10
176
+
177
+ trader.should_receive(:fetch_prices)
178
+ trader.should_not_receive(:log_info)
179
+ trader.should_receive(:execute_trade)
180
+
181
+ trader.trade
182
+ end
183
+ end
184
+
185
+ describe "#log_info" do
186
+ it "calls logger.info" do
187
+ trader.buyer[:price] = 1
188
+ trader.seller[:price] = 1
189
+ trader.instance_variable_set :@percent, 1
190
+ trader.instance_variable_set :@paid, 1
191
+ trader.instance_variable_set :@received, 1
192
+ trader.logger.should_receive(:info).exactly(5).times
193
+ trader.log_info
194
+ end
195
+ end
196
+
197
+ describe "#logger" do
198
+ it { trader.logger.should == trader.options[:logger] }
199
+ end
200
+
201
+ describe "#trade_again" do
202
+ before(:each) { trader.options[:repeat] = 10 }
203
+
204
+ it "should call #trade" do
205
+ trader.should_receive(:sleep).with(10)
206
+ trader.should_receive(:trade)
207
+ trader.trade_again
208
+ end
209
+
210
+ it "should create new clients" do
211
+ buy_client = trader.buy_client
212
+ sell_client = trader.sell_client
213
+ trader.should_receive(:sleep)
214
+ trader.should_receive(:trade)
215
+ trader.trade_again
216
+ buy_client.should_not == trader.buy_client
217
+ sell_client.should_not == trader.sell_client
218
+ end
219
+ end
220
+
221
+ describe "#client_for_exchange" do
222
+ it "should raise if wrong market" do
223
+ error = "Invalid exchange - 'test'"
224
+ expect { trader.client_for_exchange(:test) }.to raise_error(ArgumentError, error)
225
+ end
226
+ end
227
+
228
+ end
metadata ADDED
@@ -0,0 +1,249 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rbtc_arbitrage_simple
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.3
5
+ platform: ruby
6
+ authors:
7
+ - Hank Stoever
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mtgox
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activemodel
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activesupport
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '3.1'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '3.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: thor
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: btce
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.4
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.4
111
+ - !ruby/object:Gem::Dependency
112
+ name: coinbase
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.2.4
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 1.2.4
125
+ description: A gem for conducting arbitrage with Bitcoin.
126
+ email:
127
+ - hstove@gmail.com
128
+ executables:
129
+ - rbtc_simple
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - .rspec
135
+ - .travis.yml
136
+ - Gemfile
137
+ - Gemfile.lock
138
+ - Guardfile
139
+ - LICENSE.txt
140
+ - Procfile
141
+ - README.md
142
+ - Rakefile
143
+ - bin/rbtc_simple
144
+ - dummy_web_server.rb
145
+ - lib/rbtc_arbitrage.rb
146
+ - lib/rbtc_arbitrage/campbx.rb
147
+ - lib/rbtc_arbitrage/cli.rb
148
+ - lib/rbtc_arbitrage/client.rb
149
+ - lib/rbtc_arbitrage/clients/btce_client.rb
150
+ - lib/rbtc_arbitrage/clients/campbx_client.rb
151
+ - lib/rbtc_arbitrage/clients/client.rb.example
152
+ - lib/rbtc_arbitrage/clients/coinbase_client.rb
153
+ - lib/rbtc_arbitrage/clients/mtgox_client.rb
154
+ - lib/rbtc_arbitrage/trader.rb
155
+ - lib/rbtc_arbitrage/version.rb
156
+ - rbtc_arbitrage.gemspec
157
+ - spec/cli_spec.rb
158
+ - spec/client_spec.rb
159
+ - spec/clients/btce_client_spec.rb
160
+ - spec/clients/campbx_client_spec.rb
161
+ - spec/clients/coinbase_client_spec.rb
162
+ - spec/clients/mtgox_client_spec.rb
163
+ - spec/rbtc_arbitrage_spec.rb
164
+ - spec/spec_helper.rb
165
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_balance/fetches_the_balance_correctly.yml
166
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_buy_correctly.yml
167
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_sell_correctly.yml
168
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_prices_correctly.yml
169
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_balance/should_raise_if_bad_API_keys.yml
170
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/calls_btc-e.yml
171
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_buy_correctly.yml
172
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_sell_correctly.yml
173
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_balance/fetches_the_balance_correctly.yml
174
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_buy_correctly.yml
175
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_sell_correctly.yml
176
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml
177
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml
178
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml
179
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml
180
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml
181
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml
182
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml
183
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml
184
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml
185
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml
186
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml
187
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml
188
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml
189
+ - spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml
190
+ - spec/trader_spec.rb
191
+ homepage: ''
192
+ licenses:
193
+ - MIT
194
+ metadata: {}
195
+ post_install_message:
196
+ rdoc_options: []
197
+ require_paths:
198
+ - lib
199
+ required_ruby_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - '>='
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ requirements: []
210
+ rubyforge_project:
211
+ rubygems_version: 2.0.6
212
+ signing_key:
213
+ specification_version: 4
214
+ summary: A gem for conducting arbitrage with Bitcoin.
215
+ test_files:
216
+ - spec/cli_spec.rb
217
+ - spec/client_spec.rb
218
+ - spec/clients/btce_client_spec.rb
219
+ - spec/clients/campbx_client_spec.rb
220
+ - spec/clients/coinbase_client_spec.rb
221
+ - spec/clients/mtgox_client_spec.rb
222
+ - spec/rbtc_arbitrage_spec.rb
223
+ - spec/spec_helper.rb
224
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_balance/fetches_the_balance_correctly.yml
225
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_buy_correctly.yml
226
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_sell_correctly.yml
227
+ - spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_prices_correctly.yml
228
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_balance/should_raise_if_bad_API_keys.yml
229
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/calls_btc-e.yml
230
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_buy_correctly.yml
231
+ - spec/support/cassettes/RbtcArbitrage_Clients_BtceClient/_price/fetches_price_for_sell_correctly.yml
232
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_balance/fetches_the_balance_correctly.yml
233
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_buy_correctly.yml
234
+ - spec/support/cassettes/RbtcArbitrage_Clients_CampbxClient/_price/fetches_price_for_sell_correctly.yml
235
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml
236
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml
237
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml
238
+ - spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml
239
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml
240
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml
241
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml
242
+ - spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml
243
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml
244
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml
245
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml
246
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml
247
+ - spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml
248
+ - spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml
249
+ - spec/trader_spec.rb