rbtc_arbitrage_simple 1.4.4 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +16 -14
- data/Gemfile.lock +17 -21
- data/lib/rbtc_arbitrage.rb +3 -1
- data/lib/rbtc_arbitrage/campbx.rb +3 -4
- data/lib/rbtc_arbitrage/cli.rb +2 -2
- data/lib/rbtc_arbitrage/clients/coinbase_client.rb +3 -2
- data/lib/rbtc_arbitrage/trader.rb +21 -75
- data/lib/rbtc_arbitrage/trader/logger.rb +31 -0
- data/lib/rbtc_arbitrage/trader/notifier.rb +60 -0
- data/lib/rbtc_arbitrage/version.rb +1 -1
- data/rbtc_arbitrage.gemspec +1 -1
- data/spec/clients/coinbase_client_spec.rb +2 -3
- data/spec/rbtc_arbitrage_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +30 -25
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +38 -24
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +40 -26
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +30 -25
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +72 -53
- data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +60 -50
- data/spec/trader_spec.rb +8 -8
- metadata +10 -19
- data/lib/rbtc_arbitrage/clients/mtgox_client.rb +0 -56
- data/spec/clients/mtgox_client_spec.rb +0 -53
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +0 -77
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +0 -44
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +0 -44
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +0 -85
@@ -1,44 +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
|
-
- Tue, 17 Dec 2013 18:52:46 GMT
|
35
|
-
Date:
|
36
|
-
- Tue, 17 Dec 2013 18:52:27 GMT
|
37
|
-
Connection:
|
38
|
-
- keep-alive
|
39
|
-
body:
|
40
|
-
encoding: UTF-8
|
41
|
-
string: '{"result":"success","return":{"high":{"value":"824.88888","value_int":"82488888","display":"$824.89","display_short":"$824.89","currency":"USD"},"low":{"value":"678.89040","value_int":"67889040","display":"$678.89","display_short":"$678.89","currency":"USD"},"avg":{"value":"740.58273","value_int":"74058273","display":"$740.58","display_short":"$740.58","currency":"USD"},"vwap":{"value":"737.16841","value_int":"73716841","display":"$737.17","display_short":"$737.17","currency":"USD"},"vol":{"value":"46591.37947288","value_int":"4659137947288","display":"46,591.38\u00a0BTC","display_short":"46,591.38\u00a0BTC","currency":"BTC"},"last_local":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last_orig":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last_all":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"buy":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"sell":{"value":"747.00000","value_int":"74700000","display":"$747.00","display_short":"$747.00","currency":"USD"},"item":"BTC","now":"1387306337410204"}}'
|
42
|
-
http_version:
|
43
|
-
recorded_at: Tue, 17 Dec 2013 18:52:28 GMT
|
44
|
-
recorded_with: VCR 2.7.0
|
@@ -1,44 +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
|
-
- Tue, 17 Dec 2013 18:52:46 GMT
|
35
|
-
Date:
|
36
|
-
- Tue, 17 Dec 2013 18:52:27 GMT
|
37
|
-
Connection:
|
38
|
-
- keep-alive
|
39
|
-
body:
|
40
|
-
encoding: UTF-8
|
41
|
-
string: '{"result":"success","return":{"high":{"value":"824.88888","value_int":"82488888","display":"$824.89","display_short":"$824.89","currency":"USD"},"low":{"value":"678.89040","value_int":"67889040","display":"$678.89","display_short":"$678.89","currency":"USD"},"avg":{"value":"740.58273","value_int":"74058273","display":"$740.58","display_short":"$740.58","currency":"USD"},"vwap":{"value":"737.16841","value_int":"73716841","display":"$737.17","display_short":"$737.17","currency":"USD"},"vol":{"value":"46591.37947288","value_int":"4659137947288","display":"46,591.38\u00a0BTC","display_short":"46,591.38\u00a0BTC","currency":"BTC"},"last_local":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last_orig":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last_all":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"last":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"buy":{"value":"746.00000","value_int":"74600000","display":"$746.00","display_short":"$746.00","currency":"USD"},"sell":{"value":"747.00000","value_int":"74700000","display":"$747.00","display_short":"$747.00","currency":"USD"},"item":"BTC","now":"1387306337410204"}}'
|
42
|
-
http_version:
|
43
|
-
recorded_at: Tue, 17 Dec 2013 18:52:28 GMT
|
44
|
-
recorded_with: VCR 2.7.0
|
data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml
DELETED
@@ -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
|