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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +16 -14
  3. data/Gemfile.lock +17 -21
  4. data/lib/rbtc_arbitrage.rb +3 -1
  5. data/lib/rbtc_arbitrage/campbx.rb +3 -4
  6. data/lib/rbtc_arbitrage/cli.rb +2 -2
  7. data/lib/rbtc_arbitrage/clients/coinbase_client.rb +3 -2
  8. data/lib/rbtc_arbitrage/trader.rb +21 -75
  9. data/lib/rbtc_arbitrage/trader/logger.rb +31 -0
  10. data/lib/rbtc_arbitrage/trader/notifier.rb +60 -0
  11. data/lib/rbtc_arbitrage/version.rb +1 -1
  12. data/rbtc_arbitrage.gemspec +1 -1
  13. data/spec/clients/coinbase_client_spec.rb +2 -3
  14. data/spec/rbtc_arbitrage_spec.rb +1 -1
  15. data/spec/spec_helper.rb +2 -1
  16. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +30 -25
  17. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +38 -24
  18. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +40 -26
  19. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +30 -25
  20. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +72 -53
  21. data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +60 -50
  22. data/spec/trader_spec.rb +8 -8
  23. metadata +10 -19
  24. data/lib/rbtc_arbitrage/clients/mtgox_client.rb +0 -56
  25. data/spec/clients/mtgox_client_spec.rb +0 -53
  26. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +0 -77
  27. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +0 -44
  28. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +0 -44
  29. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +0 -85
@@ -7,9 +7,8 @@ describe RbtcArbitrage::Clients::CoinbaseClient do
7
7
  it { client.exchange.should == :coinbase }
8
8
 
9
9
  describe "#balance" do
10
- it "fetches the balance correctly", :vcr do
11
- balance = coinbase.balance.to_f
12
- expected = [balance, Float::MAX]
10
+ it "fetches the balance correctly" do
11
+ expected = [Float::MAX, Float::MAX]
13
12
  client.balance.should eql(expected)
14
13
  client.balance.each do |b|
15
14
  b.should be_a(Float)
@@ -4,8 +4,8 @@ describe RbtcArbitrage do
4
4
  describe ".clients" do
5
5
  it "includes clients" do
6
6
  clients = RbtcArbitrage.clients
7
- clients.should include(RbtcArbitrage::Clients::MtGoxClient)
8
7
  clients.should include(RbtcArbitrage::Clients::BtceClient)
8
+ clients.should include(RbtcArbitrage::Clients::CampbxClient)
9
9
  end
10
10
  end
11
11
  end
data/spec/spec_helper.rb CHANGED
@@ -10,11 +10,12 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
10
10
  SimpleCov.start do
11
11
  add_filter "/spec/"
12
12
  add_filter "/lib/rbtc_arbitrage/campbx.rb"
13
+ add_filter "/bitstamp/"
13
14
  end
14
15
 
15
16
  require 'bundler'
16
17
  require './lib/rbtc_arbitrage'
17
- Bundler.require
18
+ Bundler.require(:default, :development)
18
19
 
19
20
  VCR.configure do |c|
20
21
  c.cassette_library_dir = 'spec/support/cassettes'
@@ -21,7 +21,7 @@ http_interactions:
21
21
  Server:
22
22
  - cloudflare-nginx
23
23
  Date:
24
- - Mon, 23 Dec 2013 16:50:38 GMT
24
+ - Mon, 24 Mar 2014 01:13:01 GMT
25
25
  Content-Type:
26
26
  - application/json
27
27
  Transfer-Encoding:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  Connection:
30
30
  - keep-alive
31
31
  Set-Cookie:
32
- - __cfduid=d58bd3f2a4b2e988c8550d909c806de761387817438029; expires=Mon, 23-Dec-2019
32
+ - __cfduid=d9ccfbc02e8e56296d3a44d48d5228e2d1395623580725; expires=Mon, 23-Dec-2019
33
33
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
34
34
  X-Frame-Options:
35
35
  - SAMEORIGIN
@@ -38,51 +38,56 @@ http_interactions:
38
38
  Vary:
39
39
  - Accept-Encoding
40
40
  Expires:
41
- - Mon, 23 Dec 2013 17:50:37 GMT
41
+ - Mon, 24 Mar 2014 02:12:55 GMT
42
42
  Cf-Ray:
43
- - e168d4bad3d012d
43
+ - 10ff00f38c860657-SJC
44
44
  body:
45
45
  encoding: UTF-8
46
- string: '{"Last Trade":"625.01","Best Bid":"625.01","Best Ask":"637.97"}'
46
+ string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"592.71"}'
47
47
  http_version:
48
- recorded_at: Mon, 23 Dec 2013 16:50:37 GMT
48
+ recorded_at: Mon, 24 Mar 2014 01:13:01 GMT
49
49
  - request:
50
50
  method: get
51
- uri: https://data.mtgox.com/api/1/BTCUSD/ticker
51
+ uri: https://btc-e.com/api/2/btc_usd/ticker
52
52
  body:
53
53
  encoding: US-ASCII
54
54
  string: ''
55
55
  headers:
56
- Accept:
57
- - application/json
58
- User-Agent:
59
- - mtgox gem 1.1.0
60
56
  Accept-Encoding:
61
57
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - '*/*'
60
+ User-Agent:
61
+ - Ruby
62
62
  response:
63
63
  status:
64
64
  code: 200
65
65
  message: OK
66
66
  headers:
67
67
  Server:
68
- - nginx/1.4.4
69
- Content-Type:
70
- - application/json; charset=utf-8
71
- Access-Control-Allow-Origin:
72
- - '*'
73
- Content-Length:
74
- - '1377'
75
- Cache-Control:
76
- - public, max-age=21
77
- Expires:
78
- - Mon, 23 Dec 2013 16:50:59 GMT
68
+ - cloudflare-nginx
79
69
  Date:
80
- - Mon, 23 Dec 2013 16:50:38 GMT
70
+ - Mon, 24 Mar 2014 01:13:01 GMT
71
+ Content-Type:
72
+ - text/html; charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
81
75
  Connection:
82
76
  - keep-alive
77
+ Set-Cookie:
78
+ - __cfduid=dbe9ea8ca02ca24f921f0272eae89823c1395623581448; expires=Mon, 23-Dec-2019
79
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
80
+ X-Frame-Options:
81
+ - DENY
82
+ Expires:
83
+ - Thu, 01 Jan 1970 00:00:01 GMT
84
+ Cache-Control:
85
+ - no-cache
86
+ Cf-Ray:
87
+ - 10ff00f80a290701-SJC
83
88
  body:
84
89
  encoding: UTF-8
85
- string: '{"result":"success","return":{"high":{"value":"685.99999","value_int":"68599999","display":"$686.00","display_short":"$686.00","currency":"USD"},"low":{"value":"630.00000","value_int":"63000000","display":"$630.00","display_short":"$630.00","currency":"USD"},"avg":{"value":"662.16460","value_int":"66216460","display":"$662.16","display_short":"$662.16","currency":"USD"},"vwap":{"value":"662.16864","value_int":"66216864","display":"$662.17","display_short":"$662.17","currency":"USD"},"vol":{"value":"12449.81724962","value_int":"1244981724962","display":"12,449.82\u00a0BTC","display_short":"12,449.82\u00a0BTC","currency":"BTC"},"last_local":{"value":"665.78999","value_int":"66578999","display":"$665.79","display_short":"$665.79","currency":"USD"},"last_orig":{"value":"665.78999","value_int":"66578999","display":"$665.79","display_short":"$665.79","currency":"USD"},"last_all":{"value":"665.78999","value_int":"66578999","display":"$665.79","display_short":"$665.79","currency":"USD"},"last":{"value":"665.78999","value_int":"66578999","display":"$665.79","display_short":"$665.79","currency":"USD"},"buy":{"value":"660.80021","value_int":"66080021","display":"$660.80","display_short":"$660.80","currency":"USD"},"sell":{"value":"665.78996","value_int":"66578996","display":"$665.79","display_short":"$665.79","currency":"USD"},"item":"BTC","now":"1387817429741903"}}'
90
+ string: '{"ticker":{"high":577,"low":561.21503,"avg":569.107515,"vol":1378796.15736,"vol_cur":2423.35249,"last":563.988,"buy":564.989,"sell":563.988,"updated":1395623580,"server_time":1395623581}}'
86
91
  http_version:
87
- recorded_at: Mon, 23 Dec 2013 16:50:37 GMT
92
+ recorded_at: Mon, 24 Mar 2014 01:13:01 GMT
88
93
  recorded_with: VCR 2.8.0
@@ -2,36 +2,50 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://data.mtgox.com/api/1/generic/info
5
+ uri: https://btc-e.com/tapi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: method=getInfo&nonce=1395624101
9
+ headers:
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
+ Content-Type:
17
+ - application/x-www-form-urlencoded
6
18
  response:
7
19
  status:
8
20
  code: 200
9
21
  message: OK
10
22
  headers:
11
23
  Server:
12
- - nginx/1.4.4
24
+ - cloudflare-nginx
25
+ Date:
26
+ - Mon, 24 Mar 2014 01:21:41 GMT
13
27
  Content-Type:
14
- - application/json; charset=utf-8
15
- Access-Control-Allow-Origin:
16
- - '*'
17
- Content-Length:
18
- - '1732'
28
+ - text/html; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - __cfduid=d0cc647fc907074b1b948005348143a7a1395624101391; expires=Mon, 23-Dec-2019
35
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
36
+ X-Frame-Options:
37
+ - DENY
19
38
  Expires:
20
- - Mon, 23 Dec 2013 16:52:20 GMT
39
+ - Thu, 01 Jan 1970 00:00:01 GMT
21
40
  Cache-Control:
22
- - max-age=0, no-cache, no-store
23
- Pragma:
24
41
  - no-cache
25
- Date:
26
- - Mon, 23 Dec 2013 16:52:20 GMT
27
- Connection:
28
- - keep-alive
42
+ Cf-Ray:
43
+ - 10ff0da9143b0701-SJC
29
44
  body:
30
45
  encoding: UTF-8
31
- 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
32
- 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.45}}'
33
- http_version:
34
- recorded_at: Mon, 23 Dec 2013 16:52:19 GMT
46
+ string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624101}}'
47
+ http_version:
48
+ recorded_at: Mon, 24 Mar 2014 01:21:41 GMT
35
49
  - request:
36
50
  method: post
37
51
  uri: https://campbx.com/api/myfunds.php
@@ -52,7 +66,7 @@ http_interactions:
52
66
  Server:
53
67
  - cloudflare-nginx
54
68
  Date:
55
- - Mon, 23 Dec 2013 16:52:21 GMT
69
+ - Mon, 24 Mar 2014 01:21:42 GMT
56
70
  Content-Type:
57
71
  - application/json
58
72
  Transfer-Encoding:
@@ -60,7 +74,7 @@ http_interactions:
60
74
  Connection:
61
75
  - keep-alive
62
76
  Set-Cookie:
63
- - __cfduid=d701d904c2b2cddcefad8ee0f50717b2f1387817540930; expires=Mon, 23-Dec-2019
77
+ - __cfduid=d868c00c39bae7657fd15e92a3f09616d1395624102072; expires=Mon, 23-Dec-2019
64
78
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
65
79
  X-Frame-Options:
66
80
  - SAMEORIGIN
@@ -69,13 +83,13 @@ http_interactions:
69
83
  Vary:
70
84
  - Accept-Encoding
71
85
  Expires:
72
- - Mon, 23 Dec 2013 17:52:20 GMT
86
+ - Mon, 24 Mar 2014 02:21:36 GMT
73
87
  Cf-Ray:
74
- - e168fce65b2012d
88
+ - 10ff0dad65cb012b-SJC
75
89
  body:
76
90
  encoding: UTF-8
77
91
  string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
78
92
  BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
79
- http_version:
80
- recorded_at: Mon, 23 Dec 2013 16:52:20 GMT
93
+ http_version:
94
+ recorded_at: Mon, 24 Mar 2014 01:21:42 GMT
81
95
  recorded_with: VCR 2.8.0
@@ -2,36 +2,50 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://data.mtgox.com/api/1/generic/info
5
+ uri: https://btc-e.com/tapi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: method=getInfo&nonce=1395624054
9
+ headers:
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
+ Content-Type:
17
+ - application/x-www-form-urlencoded
6
18
  response:
7
19
  status:
8
20
  code: 200
9
21
  message: OK
10
22
  headers:
11
23
  Server:
12
- - nginx/1.4.4
24
+ - cloudflare-nginx
25
+ Date:
26
+ - Mon, 24 Mar 2014 01:20:54 GMT
13
27
  Content-Type:
14
- - application/json; charset=utf-8
15
- Access-Control-Allow-Origin:
16
- - '*'
17
- Content-Length:
18
- - '1732'
28
+ - text/html; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - __cfduid=daedd562d62bc3ded064487bcdcf373ee1395624054845; expires=Mon, 23-Dec-2019
35
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
36
+ X-Frame-Options:
37
+ - DENY
19
38
  Expires:
20
- - Mon, 23 Dec 2013 16:51:12 GMT
39
+ - Thu, 01 Jan 1970 00:00:01 GMT
21
40
  Cache-Control:
22
- - max-age=0, no-cache, no-store
23
- Pragma:
24
41
  - no-cache
25
- Date:
26
- - Mon, 23 Dec 2013 16:51:12 GMT
27
- Connection:
28
- - keep-alive
42
+ Cf-Ray:
43
+ - 10ff0c865b850129-SJC
29
44
  body:
30
45
  encoding: UTF-8
31
- 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
32
- 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.45}}'
33
- http_version:
34
- recorded_at: Mon, 23 Dec 2013 16:51:11 GMT
46
+ string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624054}}'
47
+ http_version:
48
+ recorded_at: Mon, 24 Mar 2014 01:20:54 GMT
35
49
  - request:
36
50
  method: post
37
51
  uri: https://campbx.com/api/myfunds.php
@@ -52,7 +66,7 @@ http_interactions:
52
66
  Server:
53
67
  - cloudflare-nginx
54
68
  Date:
55
- - Mon, 23 Dec 2013 16:51:13 GMT
69
+ - Mon, 24 Mar 2014 01:20:55 GMT
56
70
  Content-Type:
57
71
  - application/json
58
72
  Transfer-Encoding:
@@ -60,7 +74,7 @@ http_interactions:
60
74
  Connection:
61
75
  - keep-alive
62
76
  Set-Cookie:
63
- - __cfduid=d10f5ac004a9165ef621716bc76b652ca1387817472922; expires=Mon, 23-Dec-2019
77
+ - __cfduid=d3910086127b9b197855ec7c9236f3c681395624055468; expires=Mon, 23-Dec-2019
64
78
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
65
79
  X-Frame-Options:
66
80
  - SAMEORIGIN
@@ -69,13 +83,13 @@ http_interactions:
69
83
  Vary:
70
84
  - Accept-Encoding
71
85
  Expires:
72
- - Mon, 23 Dec 2013 17:51:12 GMT
86
+ - Mon, 24 Mar 2014 02:20:50 GMT
73
87
  Cf-Ray:
74
- - e168e254197012d
88
+ - 10ff0c8a316f012b-SJC
75
89
  body:
76
90
  encoding: UTF-8
77
- string: "\r\n{\"Total USD\":\"1.41\",\"Total BTC\":\"0.00790000\",\"Liquid USD\":\"1.41\",\"Liquid
78
- BTC\":\"0.00790000\",\"Margin Account USD\":\"0.00\",\"Margin Account BTC\":\"0.00000000\"}"
79
- http_version:
80
- recorded_at: Mon, 23 Dec 2013 16:51:12 GMT
91
+ string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
92
+ BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
93
+ http_version:
94
+ recorded_at: Mon, 24 Mar 2014 01:20:55 GMT
81
95
  recorded_with: VCR 2.8.0
@@ -21,7 +21,7 @@ http_interactions:
21
21
  Server:
22
22
  - cloudflare-nginx
23
23
  Date:
24
- - Mon, 23 Dec 2013 16:52:42 GMT
24
+ - Mon, 24 Mar 2014 01:21:36 GMT
25
25
  Content-Type:
26
26
  - application/json
27
27
  Transfer-Encoding:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  Connection:
30
30
  - keep-alive
31
31
  Set-Cookie:
32
- - __cfduid=d5ef05644738487d7ebb9dc12da1f747f1387817562303; expires=Mon, 23-Dec-2019
32
+ - __cfduid=d9283230678b5bfe878acd868015fef501395624095839; expires=Mon, 23-Dec-2019
33
33
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
34
34
  X-Frame-Options:
35
35
  - SAMEORIGIN
@@ -38,51 +38,56 @@ http_interactions:
38
38
  Vary:
39
39
  - Accept-Encoding
40
40
  Expires:
41
- - Mon, 23 Dec 2013 17:52:41 GMT
41
+ - Mon, 24 Mar 2014 02:21:30 GMT
42
42
  Cf-Ray:
43
- - e1690546069012d
43
+ - 10ff0d86fe3b0657-SJC
44
44
  body:
45
45
  encoding: UTF-8
46
- string: '{"Last Trade":"625.01","Best Bid":"625.01","Best Ask":"637.97"}'
46
+ string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"595.02"}'
47
47
  http_version:
48
- recorded_at: Mon, 23 Dec 2013 16:52:42 GMT
48
+ recorded_at: Mon, 24 Mar 2014 01:21:36 GMT
49
49
  - request:
50
50
  method: get
51
- uri: https://data.mtgox.com/api/1/BTCUSD/ticker
51
+ uri: https://btc-e.com/api/2/btc_usd/ticker
52
52
  body:
53
53
  encoding: US-ASCII
54
54
  string: ''
55
55
  headers:
56
- Accept:
57
- - application/json
58
- User-Agent:
59
- - mtgox gem 1.1.0
60
56
  Accept-Encoding:
61
57
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - '*/*'
60
+ User-Agent:
61
+ - Ruby
62
62
  response:
63
63
  status:
64
64
  code: 200
65
65
  message: OK
66
66
  headers:
67
67
  Server:
68
- - nginx/1.4.4
69
- Content-Type:
70
- - application/json; charset=utf-8
71
- Access-Control-Allow-Origin:
72
- - '*'
73
- Content-Length:
74
- - '1377'
75
- Cache-Control:
76
- - public, max-age=17
77
- Expires:
78
- - Mon, 23 Dec 2013 16:53:00 GMT
68
+ - cloudflare-nginx
79
69
  Date:
80
- - Mon, 23 Dec 2013 16:52:43 GMT
70
+ - Mon, 24 Mar 2014 01:21:36 GMT
71
+ Content-Type:
72
+ - text/html; charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
81
75
  Connection:
82
76
  - keep-alive
77
+ Set-Cookie:
78
+ - __cfduid=d8c3646db5b40b611f2f3d25f8434bee81395624096677; expires=Mon, 23-Dec-2019
79
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
80
+ X-Frame-Options:
81
+ - DENY
82
+ Expires:
83
+ - Thu, 01 Jan 1970 00:00:01 GMT
84
+ Cache-Control:
85
+ - no-cache
86
+ Cf-Ray:
87
+ - 10ff0d8c320d0701-SJC
83
88
  body:
84
89
  encoding: UTF-8
85
- string: '{"result":"success","return":{"high":{"value":"685.99999","value_int":"68599999","display":"$686.00","display_short":"$686.00","currency":"USD"},"low":{"value":"630.00000","value_int":"63000000","display":"$630.00","display_short":"$630.00","currency":"USD"},"avg":{"value":"662.15456","value_int":"66215456","display":"$662.15","display_short":"$662.15","currency":"USD"},"vwap":{"value":"662.16657","value_int":"66216657","display":"$662.17","display_short":"$662.17","currency":"USD"},"vol":{"value":"12455.98795853","value_int":"1245598795853","display":"12,455.99\u00a0BTC","display_short":"12,455.99\u00a0BTC","currency":"BTC"},"last_local":{"value":"655.50000","value_int":"65550000","display":"$655.50","display_short":"$655.50","currency":"USD"},"last_orig":{"value":"655.50000","value_int":"65550000","display":"$655.50","display_short":"$655.50","currency":"USD"},"last_all":{"value":"655.50000","value_int":"65550000","display":"$655.50","display_short":"$655.50","currency":"USD"},"last":{"value":"655.50000","value_int":"65550000","display":"$655.50","display_short":"$655.50","currency":"USD"},"buy":{"value":"655.67600","value_int":"65567600","display":"$655.68","display_short":"$655.68","currency":"USD"},"sell":{"value":"664.99500","value_int":"66499500","display":"$665.00","display_short":"$665.00","currency":"USD"},"item":"BTC","now":"1387817551782871"}}'
90
+ string: '{"ticker":{"high":577,"low":561.01001,"avg":569.005005,"vol":1400936.05639,"vol_cur":2462.82808,"last":561.288,"buy":561.882,"sell":561.288,"updated":1395624094,"server_time":1395624096}}'
86
91
  http_version:
87
- recorded_at: Mon, 23 Dec 2013 16:52:42 GMT
92
+ recorded_at: Mon, 24 Mar 2014 01:21:37 GMT
88
93
  recorded_with: VCR 2.8.0
@@ -21,7 +21,7 @@ http_interactions:
21
21
  Server:
22
22
  - cloudflare-nginx
23
23
  Date:
24
- - Mon, 23 Dec 2013 16:52:22 GMT
24
+ - Mon, 24 Mar 2014 01:21:44 GMT
25
25
  Content-Type:
26
26
  - application/json
27
27
  Transfer-Encoding:
@@ -29,7 +29,7 @@ http_interactions:
29
29
  Connection:
30
30
  - keep-alive
31
31
  Set-Cookie:
32
- - __cfduid=d13c053a630b8468a5b9405f4b6eb1f7a1387817542464; expires=Mon, 23-Dec-2019
32
+ - __cfduid=d45238e17ceb6ee684e9ed3bafee828471395624103601; expires=Mon, 23-Dec-2019
33
33
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
34
34
  X-Frame-Options:
35
35
  - SAMEORIGIN
@@ -38,85 +38,104 @@ http_interactions:
38
38
  Vary:
39
39
  - Accept-Encoding
40
40
  Expires:
41
- - Mon, 23 Dec 2013 17:52:21 GMT
41
+ - Mon, 24 Mar 2014 02:21:38 GMT
42
42
  Cf-Ray:
43
- - e168fd86749012d
43
+ - 10ff0db785db012b-SJC
44
44
  body:
45
45
  encoding: UTF-8
46
- string: '{"Last Trade":"625.01","Best Bid":"625.01","Best Ask":"637.97"}'
47
- http_version:
48
- recorded_at: Mon, 23 Dec 2013 16:52:22 GMT
46
+ string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"595.01"}'
47
+ http_version:
48
+ recorded_at: Mon, 24 Mar 2014 01:21:44 GMT
49
49
  - request:
50
50
  method: get
51
- uri: https://data.mtgox.com/api/1/BTCUSD/ticker
51
+ uri: https://btc-e.com/api/2/btc_usd/ticker
52
52
  body:
53
53
  encoding: US-ASCII
54
54
  string: ''
55
55
  headers:
56
- Accept:
57
- - application/json
58
- User-Agent:
59
- - mtgox gem 1.1.0
60
56
  Accept-Encoding:
61
57
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - '*/*'
60
+ User-Agent:
61
+ - Ruby
62
62
  response:
63
63
  status:
64
64
  code: 200
65
65
  message: OK
66
66
  headers:
67
67
  Server:
68
- - nginx/1.4.4
69
- Content-Type:
70
- - application/json; charset=utf-8
71
- Access-Control-Allow-Origin:
72
- - '*'
73
- Content-Length:
74
- - '1387'
75
- Cache-Control:
76
- - public, max-age=10
77
- Expires:
78
- - Mon, 23 Dec 2013 16:52:33 GMT
68
+ - cloudflare-nginx
79
69
  Date:
80
- - Mon, 23 Dec 2013 16:52:23 GMT
70
+ - Mon, 24 Mar 2014 01:21:45 GMT
71
+ Content-Type:
72
+ - text/html; charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
81
75
  Connection:
82
76
  - keep-alive
77
+ Set-Cookie:
78
+ - __cfduid=dbefbb482c999a6850d15b9bd9d87616d1395624105369; expires=Mon, 23-Dec-2019
79
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
80
+ X-Frame-Options:
81
+ - DENY
82
+ Expires:
83
+ - Thu, 01 Jan 1970 00:00:01 GMT
84
+ Cache-Control:
85
+ - no-cache
86
+ Cf-Ray:
87
+ - 10ff0dc288dd0701-SJC
83
88
  body:
84
89
  encoding: UTF-8
85
- string: '{"result":"success","return":{"high":{"value":"685.99999","value_int":"68599999","display":"$686.00","display_short":"$686.00","currency":"USD"},"low":{"value":"630.00000","value_int":"63000000","display":"$630.00","display_short":"$630.00","currency":"USD"},"avg":{"value":"662.15756","value_int":"66215756","display":"$662.16","display_short":"$662.16","currency":"USD"},"vwap":{"value":"662.16810","value_int":"66216810","display":"$662.17","display_short":"$662.17","currency":"USD"},"vol":{"value":"12454.97895853","value_int":"1245497895853","display":"12,454.98\u00a0BTC","display_short":"12,454.98\u00a0BTC","currency":"BTC"},"last_local":{"value":"655.66600","value_int":"65566600","display":"$655.67","display_short":"$655.67","currency":"USD"},"last_orig":{"value":"68000.000","value_int":"68000000","display":"\u00a568,000","display_short":"\u00a568,000","currency":"JPY"},"last_all":{"value":"650.87621","value_int":"65087621","display":"$650.88","display_short":"$650.88","currency":"USD"},"last":{"value":"655.66600","value_int":"65566600","display":"$655.67","display_short":"$655.67","currency":"USD"},"buy":{"value":"663.55000","value_int":"66355000","display":"$663.55","display_short":"$663.55","currency":"USD"},"sell":{"value":"665.40000","value_int":"66540000","display":"$665.40","display_short":"$665.40","currency":"USD"},"item":"BTC","now":"1387817517954792"}}'
86
- http_version:
87
- recorded_at: Mon, 23 Dec 2013 16:52:22 GMT
90
+ string: '{"ticker":{"high":577,"low":561.01001,"avg":569.005005,"vol":1400936.05639,"vol_cur":2462.82808,"last":561.882,"buy":561.882,"sell":561.288,"updated":1395624104,"server_time":1395624105}}'
91
+ http_version:
92
+ recorded_at: Mon, 24 Mar 2014 01:21:45 GMT
88
93
  - request:
89
94
  method: post
90
- uri: https://data.mtgox.com/api/1/generic/info
95
+ uri: https://btc-e.com/tapi
96
+ body:
97
+ encoding: US-ASCII
98
+ string: method=getInfo&nonce=1395624105
99
+ headers:
100
+ Accept-Encoding:
101
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
102
+ Accept:
103
+ - '*/*'
104
+ User-Agent:
105
+ - Ruby
106
+ Content-Type:
107
+ - application/x-www-form-urlencoded
91
108
  response:
92
109
  status:
93
110
  code: 200
94
111
  message: OK
95
112
  headers:
96
113
  Server:
97
- - nginx/1.4.4
114
+ - cloudflare-nginx
115
+ Date:
116
+ - Mon, 24 Mar 2014 01:21:45 GMT
98
117
  Content-Type:
99
- - application/json; charset=utf-8
100
- Access-Control-Allow-Origin:
101
- - '*'
102
- Content-Length:
103
- - '1732'
118
+ - text/html; charset=utf-8
119
+ Transfer-Encoding:
120
+ - chunked
121
+ Connection:
122
+ - keep-alive
123
+ Set-Cookie:
124
+ - __cfduid=dda67cb1620704a4220047d5ecc0c10f71395624105706; expires=Mon, 23-Dec-2019
125
+ 23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
126
+ X-Frame-Options:
127
+ - DENY
104
128
  Expires:
105
- - Mon, 23 Dec 2013 16:52:23 GMT
129
+ - Thu, 01 Jan 1970 00:00:01 GMT
106
130
  Cache-Control:
107
- - max-age=0, no-cache, no-store
108
- Pragma:
109
131
  - no-cache
110
- Date:
111
- - Mon, 23 Dec 2013 16:52:23 GMT
112
- Connection:
113
- - keep-alive
132
+ Cf-Ray:
133
+ - 10ff0dc41d990701-SJC
114
134
  body:
115
135
  encoding: UTF-8
116
- 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
117
- 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.45}}'
118
- http_version:
119
- recorded_at: Mon, 23 Dec 2013 16:52:22 GMT
136
+ string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624105}}'
137
+ http_version:
138
+ recorded_at: Mon, 24 Mar 2014 01:21:45 GMT
120
139
  - request:
121
140
  method: post
122
141
  uri: https://campbx.com/api/myfunds.php
@@ -137,7 +156,7 @@ http_interactions:
137
156
  Server:
138
157
  - cloudflare-nginx
139
158
  Date:
140
- - Mon, 23 Dec 2013 16:52:24 GMT
159
+ - Mon, 24 Mar 2014 01:21:46 GMT
141
160
  Content-Type:
142
161
  - application/json
143
162
  Transfer-Encoding:
@@ -145,7 +164,7 @@ http_interactions:
145
164
  Connection:
146
165
  - keep-alive
147
166
  Set-Cookie:
148
- - __cfduid=df2c166d2cc41339f1576c03e50d91cfe1387817543781; expires=Mon, 23-Dec-2019
167
+ - __cfduid=da275613e0baee065fa7271f31df929a91395624106027; expires=Mon, 23-Dec-2019
149
168
  23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
150
169
  X-Frame-Options:
151
170
  - SAMEORIGIN
@@ -154,13 +173,13 @@ http_interactions:
154
173
  Vary:
155
174
  - Accept-Encoding
156
175
  Expires:
157
- - Mon, 23 Dec 2013 17:52:22 GMT
176
+ - Mon, 24 Mar 2014 02:21:40 GMT
158
177
  Cf-Ray:
159
- - e168fe02756012d
178
+ - 10ff0dc63050012b-SJC
160
179
  body:
161
180
  encoding: UTF-8
162
- string: "\r\n{\"Total USD\":\"1.41\",\"Total BTC\":\"0.00790000\",\"Liquid USD\":\"1.41\",\"Liquid
163
- BTC\":\"0.00790000\",\"Margin Account USD\":\"0.00\",\"Margin Account BTC\":\"0.00000000\"}"
164
- http_version:
165
- recorded_at: Mon, 23 Dec 2013 16:52:23 GMT
181
+ string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
182
+ BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
183
+ http_version:
184
+ recorded_at: Mon, 24 Mar 2014 01:21:46 GMT
166
185
  recorded_with: VCR 2.8.0