rbtc_arbitrage 1.4.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/Gemfile +17 -14
  4. data/Gemfile.lock +26 -28
  5. data/lib/rbtc_arbitrage.rb +2 -2
  6. data/lib/rbtc_arbitrage/cli.rb +1 -1
  7. data/lib/rbtc_arbitrage/trader.rb +8 -2
  8. data/lib/rbtc_arbitrage/version.rb +1 -1
  9. data/rbtc_arbitrage.gemspec +1 -3
  10. data/spec/clients/bitstamp_client_spec.rb +2 -2
  11. data/spec/rbtc_arbitrage_spec.rb +1 -1
  12. data/spec/spec_helper.rb +1 -1
  13. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_transfer/calls_Bitstamp_correctly.yml +48 -0
  14. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +46 -48
  15. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +52 -52
  16. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +49 -46
  17. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +43 -173
  18. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +87 -168
  19. data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +101 -98
  20. data/spec/trader_spec.rb +4 -4
  21. metadata +6 -56
  22. data/lib/rbtc_arbitrage/clients/mtgox_client.rb +0 -56
  23. data/spec/clients/mtgox_client_spec.rb +0 -53
  24. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +0 -77
  25. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +0 -44
  26. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +0 -44
  27. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +0 -85
@@ -1,85 +0,0 @@
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
- Cache-Control:
32
- - public, max-age=19
33
- Expires:
34
- - Mon, 16 Dec 2013 02:37:47 GMT
35
- Date:
36
- - Mon, 16 Dec 2013 02:37:28 GMT
37
- Connection:
38
- - keep-alive
39
- body:
40
- encoding: UTF-8
41
- string: '{"result":"success","return":{"high":{"value":"928.00000","value_int":"92800000","display":"$928.00","display_short":"$928.00","currency":"USD"},"low":{"value":"838.02010","value_int":"83802010","display":"$838.02","display_short":"$838.02","currency":"USD"},"avg":{"value":"881.69362","value_int":"88169362","display":"$881.69","display_short":"$881.69","currency":"USD"},"vwap":{"value":"877.80871","value_int":"87780871","display":"$877.81","display_short":"$877.81","currency":"USD"},"vol":{"value":"15209.28682013","value_int":"1520928682013","display":"15,209.29\u00a0BTC","display_short":"15,209.29\u00a0BTC","currency":"BTC"},"last_local":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last_orig":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last_all":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"buy":{"value":"912.40000","value_int":"91240000","display":"$912.40","display_short":"$912.40","currency":"USD"},"sell":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"item":"BTC","now":"1387161430752600"}}'
42
- http_version:
43
- recorded_at: Mon, 16 Dec 2013 02:37:28 GMT
44
- - request:
45
- method: get
46
- uri: https://data.mtgox.com/api/1/BTCUSD/ticker
47
- body:
48
- encoding: US-ASCII
49
- string: ''
50
- headers:
51
- Accept:
52
- - application/json
53
- User-Agent:
54
- - mtgox gem 1.1.0
55
- Accept-Encoding:
56
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
- response:
58
- status:
59
- code: 200
60
- message: OK
61
- headers:
62
- Server:
63
- - nginx/1.4.4
64
- Content-Type:
65
- - application/json; charset=utf-8
66
- X-Powered-By:
67
- - PHP/5.5.4
68
- Access-Control-Allow-Origin:
69
- - '*'
70
- Content-Length:
71
- - '1377'
72
- Cache-Control:
73
- - public, max-age=19
74
- Expires:
75
- - Mon, 16 Dec 2013 02:37:47 GMT
76
- Date:
77
- - Mon, 16 Dec 2013 02:37:28 GMT
78
- Connection:
79
- - keep-alive
80
- body:
81
- encoding: UTF-8
82
- string: '{"result":"success","return":{"high":{"value":"928.00000","value_int":"92800000","display":"$928.00","display_short":"$928.00","currency":"USD"},"low":{"value":"838.02010","value_int":"83802010","display":"$838.02","display_short":"$838.02","currency":"USD"},"avg":{"value":"881.69362","value_int":"88169362","display":"$881.69","display_short":"$881.69","currency":"USD"},"vwap":{"value":"877.80871","value_int":"87780871","display":"$877.81","display_short":"$877.81","currency":"USD"},"vol":{"value":"15209.28682013","value_int":"1520928682013","display":"15,209.29\u00a0BTC","display_short":"15,209.29\u00a0BTC","currency":"BTC"},"last_local":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last_orig":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last_all":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"last":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"buy":{"value":"912.40000","value_int":"91240000","display":"$912.40","display_short":"$912.40","currency":"USD"},"sell":{"value":"915.00000","value_int":"91500000","display":"$915.00","display_short":"$915.00","currency":"USD"},"item":"BTC","now":"1387161430752600"}}'
83
- http_version:
84
- recorded_at: Mon, 16 Dec 2013 02:37:28 GMT
85
- recorded_with: VCR 2.7.0