rbtc_arbitrage 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +6 -6
  2. data/.rspec +1 -1
  3. data/.travis.yml +13 -3
  4. data/Gemfile +10 -0
  5. data/Guardfile +8 -0
  6. data/README.md +41 -3
  7. data/btce-api-key.yml +2 -0
  8. data/lib/rbtc_arbitrage/campbx.rb +98 -0
  9. data/lib/rbtc_arbitrage/cli.rb +3 -1
  10. data/lib/rbtc_arbitrage/client.rb +45 -0
  11. data/lib/rbtc_arbitrage/clients/bitstamp_client.rb +52 -0
  12. data/lib/rbtc_arbitrage/clients/mtgox_client.rb +45 -0
  13. data/lib/rbtc_arbitrage/trader.rb +62 -66
  14. data/lib/rbtc_arbitrage/version.rb +1 -1
  15. data/lib/rbtc_arbitrage.rb +3 -1
  16. data/rbtc_arbitrage.gemspec +2 -0
  17. data/spec/cli_spec.rb +8 -0
  18. data/spec/client_spec.rb +18 -0
  19. data/spec/clients/bitstamp_client_spec.rb +53 -0
  20. data/spec/clients/mtgox_client_spec.rb +52 -0
  21. data/spec/spec_helper.rb +27 -12
  22. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_balance/fetches_the_balance_correctly.yml +96 -0
  23. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_buy_correctly.yml +52 -0
  24. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_sell_correctly.yml +52 -0
  25. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_prices_correctly.yml +44 -0
  26. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +77 -0
  27. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +44 -0
  28. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +44 -0
  29. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +85 -0
  30. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +93 -0
  31. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +86 -0
  32. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +80 -0
  33. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +225 -0
  34. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +262 -0
  35. data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +176 -0
  36. data/spec/support/cassettes/RbtcArbitrage_Trader/_get_balance/fetches_the_right_balance.yml +166 -0
  37. data/spec/trader_spec.rb +156 -19
  38. metadata +89 -18
@@ -0,0 +1,262 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://data.mtgox.com/api/1/BTCUSD/ticker
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ User-Agent:
13
+ - mtgox gem 1.1.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.4
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Powered-By:
26
+ - PHP/5.5.4
27
+ Access-Control-Allow-Origin:
28
+ - '*'
29
+ Content-Length:
30
+ - '1377'
31
+ Expires:
32
+ - Sat, 14 Dec 2013 00:11:24 GMT
33
+ Date:
34
+ - Sat, 14 Dec 2013 00:11:16 GMT
35
+ Connection:
36
+ - keep-alive
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"result":"success","return":{"high":{"value":"990.00000","value_int":"99000000","display":"$990.00","display_short":"$990.00","currency":"USD"},"low":{"value":"882.15864","value_int":"88215864","display":"$882.16","display_short":"$882.16","currency":"USD"},"avg":{"value":"929.85051","value_int":"92985051","display":"$929.85","display_short":"$929.85","currency":"USD"},"vwap":{"value":"931.14105","value_int":"93114105","display":"$931.14","display_short":"$931.14","currency":"USD"},"vol":{"value":"17098.42923413","value_int":"1709842923413","display":"17,098.43\u00a0BTC","display_short":"17,098.43\u00a0BTC","currency":"BTC"},"last_local":{"value":"936.91051","value_int":"93691051","display":"$936.91","display_short":"$936.91","currency":"USD"},"last_orig":{"value":"936.91051","value_int":"93691051","display":"$936.91","display_short":"$936.91","currency":"USD"},"last_all":{"value":"936.91051","value_int":"93691051","display":"$936.91","display_short":"$936.91","currency":"USD"},"last":{"value":"936.91051","value_int":"93691051","display":"$936.91","display_short":"$936.91","currency":"USD"},"buy":{"value":"936.91051","value_int":"93691051","display":"$936.91","display_short":"$936.91","currency":"USD"},"sell":{"value":"939.99999","value_int":"93999999","display":"$940.00","display_short":"$940.00","currency":"USD"},"item":"BTC","now":"1386979853545522"}}'
40
+ http_version:
41
+ recorded_at: Sat, 14 Dec 2013 00:11:15 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://www.bitstamp.net/api/ticker/
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers: {}
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Date:
55
+ - Sat, 14 Dec 2013 00:11:18 GMT
56
+ Server:
57
+ - Apache
58
+ Content-Language:
59
+ - en
60
+ Expires:
61
+ - Sat, 14 Dec 2013 00:11:18 GMT
62
+ Vary:
63
+ - Accept-Language
64
+ Cache-Control:
65
+ - max-age=0
66
+ Last-Modified:
67
+ - Sat, 14 Dec 2013 00:11:18 GMT
68
+ Connection:
69
+ - close
70
+ Transfer-Encoding:
71
+ - chunked
72
+ Content-Type:
73
+ - application/json
74
+ Set-Cookie:
75
+ - incap_ses_124_99025=wp/Pe6y/EklQ+vjVAYq4ASaiq1IAAAAAZp7dDncapnrTcJ5kpIQdyw==;
76
+ path=/; Domain=.bitstamp.net
77
+ - nlbi_99025=frJvdklUpDcWVR4aItob8gAAAAD//cyej+u2tsraUKi14TY1; path=/; Domain=.bitstamp.net
78
+ - visid_incap_99025=htYi8DIDT6mQNq81wErLuCaiq1IAAAAAQUIPAAAAAAC6L4jthZPC0huW9aVHobjK;
79
+ expires=Sun, 13 Dec 2015 10:20:58 GMT; path=/; Domain=.bitstamp.net
80
+ X-Iinfo:
81
+ - 6-267125833-267125990 NNNY CT(194 197 0) RT(1386979877303 200) q(0 0 3 -1)
82
+ r(3 5) U6
83
+ X-Cdn:
84
+ - Incapsula
85
+ body:
86
+ encoding: ASCII-8BIT
87
+ string: '{"high": "920.42", "last": "881.01", "timestamp": "1386979871", "bid":
88
+ "880.58", "volume": "14742.57748152", "low": "850.00", "ask": "881.01"}'
89
+ http_version:
90
+ recorded_at: Sat, 14 Dec 2013 00:11:17 GMT
91
+ - request:
92
+ method: post
93
+ uri: https://data.mtgox.com/api/1/generic/info
94
+ body:
95
+ encoding: US-ASCII
96
+ string: nonce=1386979877064995
97
+ headers: {}
98
+ response:
99
+ status:
100
+ code: 200
101
+ message: OK
102
+ headers:
103
+ Server:
104
+ - nginx/1.4.4
105
+ Content-Type:
106
+ - application/json; charset=utf-8
107
+ X-Powered-By:
108
+ - PHP/5.5.4
109
+ Access-Control-Allow-Origin:
110
+ - '*'
111
+ Content-Length:
112
+ - '1731'
113
+ Expires:
114
+ - Sat, 14 Dec 2013 00:11:18 GMT
115
+ Cache-Control:
116
+ - max-age=0, no-cache, no-store
117
+ Pragma:
118
+ - no-cache
119
+ Date:
120
+ - Sat, 14 Dec 2013 00:11:18 GMT
121
+ Connection:
122
+ - keep-alive
123
+ body:
124
+ encoding: UTF-8
125
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
126
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
127
+ http_version:
128
+ recorded_at: Sat, 14 Dec 2013 00:11:17 GMT
129
+ - request:
130
+ method: post
131
+ uri: https://www.bitstamp.net/api/balance/
132
+ body:
133
+ encoding: US-ASCII
134
+ string: ''
135
+ headers: {}
136
+ response:
137
+ status:
138
+ code: 200
139
+ message: OK
140
+ headers:
141
+ Date:
142
+ - Sat, 14 Dec 2013 00:11:19 GMT
143
+ Server:
144
+ - Apache
145
+ Content-Language:
146
+ - en
147
+ Expires:
148
+ - Sat, 14 Dec 2013 00:11:19 GMT
149
+ Vary:
150
+ - Accept-Language
151
+ Cache-Control:
152
+ - max-age=0
153
+ Last-Modified:
154
+ - Sat, 14 Dec 2013 00:11:19 GMT
155
+ Connection:
156
+ - close
157
+ Transfer-Encoding:
158
+ - chunked
159
+ Content-Type:
160
+ - application/json
161
+ Set-Cookie:
162
+ - incap_ses_124_99025=GESjRX2p1FQy/fjVAYq4ASeiq1IAAAAAJcwtVpaFJ+QHk8orTEMsZw==;
163
+ path=/; Domain=.bitstamp.net
164
+ - nlbi_99025=J1gzYO+0XhN1UV4/Itob8gAAAABBDThC+VwGL20pWFGXgvj7; path=/; Domain=.bitstamp.net
165
+ - visid_incap_99025=2AKYVKhlRCm/WnhrC2Fityeiq1IAAAAAQUIPAAAAAAD0WM8jegGzeJ0ciNTV87Ff;
166
+ expires=Sun, 13 Dec 2015 10:20:58 GMT; path=/; Domain=.bitstamp.net
167
+ X-Iinfo:
168
+ - 6-267126664-267126809 NNNY CT(195 194 0) RT(1386979878484 170) q(0 0 4 -1)
169
+ r(4 6) U6
170
+ X-Cdn:
171
+ - Incapsula
172
+ body:
173
+ encoding: ASCII-8BIT
174
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
175
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
176
+ http_version:
177
+ recorded_at: Sat, 14 Dec 2013 00:11:18 GMT
178
+ - request:
179
+ method: get
180
+ uri: https://www.bitstamp.net/api/ticker/
181
+ body:
182
+ encoding: US-ASCII
183
+ string: ''
184
+ headers: {}
185
+ response:
186
+ status:
187
+ code: 200
188
+ message: OK
189
+ headers:
190
+ Last-Modified:
191
+ - Mon, 16 Dec 2013 02:12:58 GMT
192
+ Content-Length:
193
+ - '142'
194
+ Content-Type:
195
+ - application/json
196
+ Date:
197
+ - Mon, 16 Dec 2013 02:13:01 GMT
198
+ Set-Cookie:
199
+ - incap_ses_124_99025=oAAKBfh/+BebzgTeAYq4Aa1hrlIAAAAAEfBbC/KT2mE2YFNlC/1lyg==;
200
+ path=/; Domain=.bitstamp.net
201
+ - visid_incap_99025=hPcnjpjDSUC3iAxDMQyuYq1hrlIAAAAAQUIPAAAAAAB+KwK/y1uaEhittWjXASNS;
202
+ expires=Tue, 15 Dec 2015 10:21:00 GMT; path=/; Domain=.bitstamp.net
203
+ X-Iinfo:
204
+ - 6-412133624-0 0CNY RT(1387159981182 470) q(0 -1 -1 0) r(0 -1)
205
+ X-Cdn:
206
+ - Incapsula
207
+ body:
208
+ encoding: ASCII-8BIT
209
+ string: '{"high": "869.98", "last": "856.14", "timestamp": "1387159973", "bid":
210
+ "856.13", "volume": "11217.69441970", "low": "803.51", "ask": "856.14"}'
211
+ http_version:
212
+ recorded_at: Mon, 16 Dec 2013 02:13:01 GMT
213
+ - request:
214
+ method: get
215
+ uri: https://www.bitstamp.net/api/ticker/
216
+ body:
217
+ encoding: US-ASCII
218
+ string: ''
219
+ headers: {}
220
+ response:
221
+ status:
222
+ code: 200
223
+ message: OK
224
+ headers:
225
+ Date:
226
+ - Wed, 18 Dec 2013 16:05:37 GMT
227
+ Server:
228
+ - Apache
229
+ Content-Language:
230
+ - en
231
+ Expires:
232
+ - Wed, 18 Dec 2013 16:05:37 GMT
233
+ Vary:
234
+ - Accept-Language
235
+ Cache-Control:
236
+ - max-age=0
237
+ Last-Modified:
238
+ - Wed, 18 Dec 2013 16:05:37 GMT
239
+ Connection:
240
+ - close
241
+ Transfer-Encoding:
242
+ - chunked
243
+ Content-Type:
244
+ - application/json
245
+ Set-Cookie:
246
+ - incap_ses_124_99025=fuP7FFvJnjp1j05zBoq4AdHHsVIAAAAArqmygbHRZCD82yqclcr33w==;
247
+ path=/; Domain=.bitstamp.net
248
+ - nlbi_99025=kr1fOzNQhRegQCrEItob8gAAAAAPQ9EmQddfssZX5Aa/29tG; path=/; Domain=.bitstamp.net
249
+ - visid_incap_99025=iBN9Fa/uQ1WiZunAXUGle9HHsVIAAAAAQUIPAAAAAAARBsszfGccqoFxcirQiIvb;
250
+ expires=Thu, 17 Dec 2015 17:12:31 GMT; path=/; Domain=.bitstamp.net
251
+ X-Iinfo:
252
+ - 6-64948554-64948783 NNNY CT(194 193 0) RT(1387382736888 198) q(0 0 4 0) r(4
253
+ 6) U13
254
+ X-Cdn:
255
+ - Incapsula
256
+ body:
257
+ encoding: ASCII-8BIT
258
+ string: '{"high": "718.00", "last": "558.01", "timestamp": "1387382716", "bid":
259
+ "558.01", "volume": "116665.49784212", "low": "382.21", "ask": "560.00"}'
260
+ http_version:
261
+ recorded_at: Wed, 18 Dec 2013 16:05:38 GMT
262
+ recorded_with: VCR 2.7.0
@@ -0,0 +1,176 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.bitstamp.net/api/ticker/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Sat, 07 Dec 2013 00:26:20 GMT
17
+ Server:
18
+ - Apache
19
+ Content-Language:
20
+ - en
21
+ Expires:
22
+ - Sat, 07 Dec 2013 00:26:20 GMT
23
+ Vary:
24
+ - Accept-Language
25
+ Cache-Control:
26
+ - max-age=0
27
+ Last-Modified:
28
+ - Sat, 07 Dec 2013 00:26:20 GMT
29
+ Content-Length:
30
+ - '143'
31
+ Connection:
32
+ - close
33
+ Content-Type:
34
+ - application/json
35
+ Set-Cookie:
36
+ - incap_ses_124_99025=u5e3Rdx3w1wPlA00/Ym4ASxrolIAAAAAIdi10K5L5D7AsIYkGOtxLQ==;
37
+ path=/; Domain=.bitstamp.net
38
+ - nlbi_99025=Rn+xB5JYEHpfqvF1Itob8gAAAAChgNAo+uIYDjrEcGqHxMvT; path=/; Domain=.bitstamp.net
39
+ - visid_incap_99025=klpmJNi3T3yJAv8ZxfVzZixrolIAAAAAQUIPAAAAAAA8RrOblNFsuFiMbsITSFhv;
40
+ expires=Sun, 06 Dec 2015 16:13:00 GMT; path=/; Domain=.bitstamp.net
41
+ X-Iinfo:
42
+ - 6-194391567-194391674 NNNY CT(200 199 0) RT(1386375979341 154) q(0 0 4 -1)
43
+ r(4 7) U6
44
+ X-Cdn:
45
+ - Incapsula
46
+ body:
47
+ encoding: ASCII-8BIT
48
+ string: '{"high": "1033.00", "last": "806.00", "timestamp": "1386375966", "bid":
49
+ "810.01", "volume": "53542.98657805", "low": "796.73", "ask": "818.46"}'
50
+ http_version:
51
+ recorded_at: Sat, 07 Dec 2013 00:26:21 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://data.mtgox.com/api/1/BTCUSD/ticker
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ Accept:
60
+ - application/json
61
+ User-Agent:
62
+ - mtgox gem 1.1.0
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Server:
71
+ - nginx/1.4.1
72
+ Content-Type:
73
+ - application/json; charset=utf-8
74
+ X-Powered-By:
75
+ - PHP/5.5.4
76
+ Access-Control-Allow-Origin:
77
+ - '*'
78
+ Vary:
79
+ - Accept-Encoding
80
+ Cache-Control:
81
+ - public, max-age=18
82
+ Expires:
83
+ - Sat, 07 Dec 2013 00:26:39 GMT
84
+ Date:
85
+ - Sat, 07 Dec 2013 00:26:21 GMT
86
+ Content-Length:
87
+ - '1405'
88
+ Connection:
89
+ - keep-alive
90
+ body:
91
+ encoding: UTF-8
92
+ string: '{"result":"success","return":{"high":{"value":"1118.98900","value_int":"111898900","display":"$1,118.99","display_short":"$1,118.99","currency":"USD"},"low":{"value":"800.00000","value_int":"80000000","display":"$800.00","display_short":"$800.00","currency":"USD"},"avg":{"value":"959.10609","value_int":"95910609","display":"$959.11","display_short":"$959.11","currency":"USD"},"vwap":{"value":"946.40403","value_int":"94640403","display":"$946.40","display_short":"$946.40","currency":"USD"},"vol":{"value":"53996.78689676","value_int":"5399678689676","display":"53,996.79\u00a0BTC","display_short":"53,996.79\u00a0BTC","currency":"BTC"},"last_local":{"value":"875.49500","value_int":"87549500","display":"$875.50","display_short":"$875.50","currency":"USD"},"last_orig":{"value":"639.00000","value_int":"63900000","display":"639.00\u00a0\u20ac","display_short":"639.00\u00a0\u20ac","currency":"EUR"},"last_all":{"value":"872.93790","value_int":"87293790","display":"$872.94","display_short":"$872.94","currency":"USD"},"last":{"value":"875.49500","value_int":"87549500","display":"$875.50","display_short":"$875.50","currency":"USD"},"buy":{"value":"863.40001","value_int":"86340001","display":"$863.40","display_short":"$863.40","currency":"USD"},"sell":{"value":"875.48498","value_int":"87548498","display":"$875.48","display_short":"$875.48","currency":"USD"},"item":"BTC","now":"1386375967563898"}}'
93
+ http_version:
94
+ recorded_at: Sat, 07 Dec 2013 00:26:21 GMT
95
+ - request:
96
+ method: get
97
+ uri: https://data.mtgox.com/api/1/BTCUSD/ticker
98
+ body:
99
+ encoding: US-ASCII
100
+ string: ''
101
+ headers:
102
+ Accept:
103
+ - application/json
104
+ User-Agent:
105
+ - mtgox gem 1.1.0
106
+ Accept-Encoding:
107
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
108
+ response:
109
+ status:
110
+ code: 200
111
+ message: OK
112
+ headers:
113
+ Server:
114
+ - nginx/1.4.1
115
+ Content-Type:
116
+ - application/json; charset=utf-8
117
+ X-Powered-By:
118
+ - PHP/5.5.4
119
+ Access-Control-Allow-Origin:
120
+ - '*'
121
+ Vary:
122
+ - Accept-Encoding
123
+ Cache-Control:
124
+ - public, max-age=18
125
+ Expires:
126
+ - Sat, 07 Dec 2013 00:26:39 GMT
127
+ Date:
128
+ - Sat, 07 Dec 2013 00:26:21 GMT
129
+ Content-Length:
130
+ - '1405'
131
+ Connection:
132
+ - keep-alive
133
+ body:
134
+ encoding: UTF-8
135
+ string: '{"result":"success","return":{"high":{"value":"1118.98900","value_int":"111898900","display":"$1,118.99","display_short":"$1,118.99","currency":"USD"},"low":{"value":"800.00000","value_int":"80000000","display":"$800.00","display_short":"$800.00","currency":"USD"},"avg":{"value":"959.10609","value_int":"95910609","display":"$959.11","display_short":"$959.11","currency":"USD"},"vwap":{"value":"946.40403","value_int":"94640403","display":"$946.40","display_short":"$946.40","currency":"USD"},"vol":{"value":"53996.78689676","value_int":"5399678689676","display":"53,996.79\u00a0BTC","display_short":"53,996.79\u00a0BTC","currency":"BTC"},"last_local":{"value":"875.49500","value_int":"87549500","display":"$875.50","display_short":"$875.50","currency":"USD"},"last_orig":{"value":"639.00000","value_int":"63900000","display":"639.00\u00a0\u20ac","display_short":"639.00\u00a0\u20ac","currency":"EUR"},"last_all":{"value":"872.93790","value_int":"87293790","display":"$872.94","display_short":"$872.94","currency":"USD"},"last":{"value":"875.49500","value_int":"87549500","display":"$875.50","display_short":"$875.50","currency":"USD"},"buy":{"value":"863.40001","value_int":"86340001","display":"$863.40","display_short":"$863.40","currency":"USD"},"sell":{"value":"875.48498","value_int":"87548498","display":"$875.48","display_short":"$875.48","currency":"USD"},"item":"BTC","now":"1386375967563898"}}'
136
+ http_version:
137
+ recorded_at: Sat, 07 Dec 2013 00:26:21 GMT
138
+ - request:
139
+ method: get
140
+ uri: https://www.bitstamp.net/api/ticker/
141
+ body:
142
+ encoding: US-ASCII
143
+ string: ''
144
+ headers: {}
145
+ response:
146
+ status:
147
+ code: 200
148
+ message: OK
149
+ headers:
150
+ Date:
151
+ - Sat, 07 Dec 2013 00:26:21 GMT
152
+ Server:
153
+ - Apache
154
+ Content-Language:
155
+ - en
156
+ Expires:
157
+ - Sat, 07 Dec 2013 00:26:21 GMT
158
+ Vary:
159
+ - Accept-Language
160
+ Cache-Control:
161
+ - max-age=0
162
+ Last-Modified:
163
+ - Sat, 07 Dec 2013 00:26:21 GMT
164
+ Connection:
165
+ - close
166
+ Transfer-Encoding:
167
+ - chunked
168
+ Content-Type:
169
+ - application/json
170
+ body:
171
+ encoding: ASCII-8BIT
172
+ string: '{"high": "1033.00", "last": "818.46", "timestamp": "1386375976", "bid":
173
+ "810.01", "volume": "53542.49489069", "low": "796.73", "ask": "818.46"}'
174
+ http_version:
175
+ recorded_at: Sat, 07 Dec 2013 00:26:22 GMT
176
+ recorded_with: VCR 2.7.0
@@ -0,0 +1,166 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://data.mtgox.com/api/1/generic/info
6
+ body:
7
+ headers:
8
+ Content-Type:
9
+ - application/x-www-form-urlencoded
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.1
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Powered-By:
26
+ - PHP/5.5.4
27
+ Access-Control-Allow-Origin:
28
+ - '*'
29
+ Vary:
30
+ - Accept-Encoding
31
+ Expires:
32
+ - Sat, 07 Dec 2013 00:26:17 GMT
33
+ Cache-Control:
34
+ - max-age=0, no-cache, no-store
35
+ Pragma:
36
+ - no-cache
37
+ Date:
38
+ - Sat, 07 Dec 2013 00:26:17 GMT
39
+ Content-Length:
40
+ - '1731'
41
+ Connection:
42
+ - keep-alive
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
46
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
47
+ http_version:
48
+ recorded_at: Sat, 07 Dec 2013 00:26:17 GMT
49
+ - request:
50
+ method: post
51
+ uri: https://data.mtgox.com/api/1/generic/info
52
+ body:
53
+ Content-Type:
54
+ - application/x-www-form-urlencoded
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ Accept:
58
+ - '*/*'
59
+ User-Agent:
60
+ - Ruby
61
+ response:
62
+ status:
63
+ code: 200
64
+ message: OK
65
+ headers:
66
+ Server:
67
+ - nginx/1.4.1
68
+ Content-Type:
69
+ - application/json; charset=utf-8
70
+ X-Powered-By:
71
+ - PHP/5.5.4
72
+ Access-Control-Allow-Origin:
73
+ - '*'
74
+ Vary:
75
+ - Accept-Encoding
76
+ Expires:
77
+ - Sat, 07 Dec 2013 00:26:17 GMT
78
+ Cache-Control:
79
+ - max-age=0, no-cache, no-store
80
+ Pragma:
81
+ - no-cache
82
+ Date:
83
+ - Sat, 07 Dec 2013 00:26:17 GMT
84
+ Content-Length:
85
+ - '1731'
86
+ Connection:
87
+ - keep-alive
88
+ body:
89
+ encoding: UTF-8
90
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
91
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
92
+ http_version:
93
+ recorded_at: Sat, 07 Dec 2013 00:26:17 GMT
94
+ - request:
95
+ method: post
96
+ uri: https://www.bitstamp.net/api/balance/
97
+ body:
98
+ headers: {}
99
+ response:
100
+ status:
101
+ code: 200
102
+ message: OK
103
+ headers:
104
+ Date:
105
+ - Sat, 07 Dec 2013 00:26:18 GMT
106
+ Server:
107
+ - Apache
108
+ Content-Language:
109
+ - en
110
+ Expires:
111
+ - Sat, 07 Dec 2013 00:26:19 GMT
112
+ Vary:
113
+ - Accept-Language
114
+ Cache-Control:
115
+ - max-age=0
116
+ Last-Modified:
117
+ - Sat, 07 Dec 2013 00:26:19 GMT
118
+ Connection:
119
+ - close
120
+ Transfer-Encoding:
121
+ - chunked
122
+ Content-Type:
123
+ - application/json
124
+ body:
125
+ encoding: ASCII-8BIT
126
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
127
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
128
+ http_version:
129
+ recorded_at: Sat, 07 Dec 2013 00:26:19 GMT
130
+ - request:
131
+ method: post
132
+ uri: https://www.bitstamp.net/api/balance/
133
+ body:
134
+ headers: {}
135
+ response:
136
+ status:
137
+ code: 200
138
+ message: OK
139
+ headers:
140
+ Date:
141
+ - Sat, 07 Dec 2013 00:26:19 GMT
142
+ Server:
143
+ - Apache
144
+ Content-Language:
145
+ - en
146
+ Expires:
147
+ - Sat, 07 Dec 2013 00:26:19 GMT
148
+ Vary:
149
+ - Accept-Language
150
+ Cache-Control:
151
+ - max-age=0
152
+ Last-Modified:
153
+ - Sat, 07 Dec 2013 00:26:19 GMT
154
+ Content-Length:
155
+ - '149'
156
+ Connection:
157
+ - close
158
+ Content-Type:
159
+ - application/json
160
+ body:
161
+ encoding: ASCII-8BIT
162
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
163
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
164
+ http_version:
165
+ recorded_at: Sat, 07 Dec 2013 00:26:20 GMT
166
+ recorded_with: VCR 2.7.0