watchcow 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchcow/rate.rb +5 -10
- data/lib/watchcow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0718f42c796d1a35cb38cb4d8b39ba6be25f4df90560814221387d0acda252
|
4
|
+
data.tar.gz: 21149de4cf61d958108efb17d4df03351bbc23020723e57de95771a4fbc9804d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 620dee957ac2f95633b1605bb54814b20f179fe3758fc04f9657598584ce51ad322b3582e377b0c8e8a4684be5f69e8ee321093caf3576ac9a093078e38eddaf
|
7
|
+
data.tar.gz: c70cd9a8539d07a3bed5862c847ef5db683615d545bcb7387979bc293119f67beba996a551c19232697857ecec2e8829a471b6cdccac4886acfac29bdf826ad8
|
data/lib/watchcow/rate.rb
CHANGED
@@ -22,7 +22,7 @@ module Watchcow
|
|
22
22
|
spot_result = Watchcow::MarketDepth.call(params: spot_symbol, k: :spot)
|
23
23
|
# puts spot_symbol.dig(:symbol)
|
24
24
|
dm_result = JSON.parse dm_result
|
25
|
-
days_remain = self.days_remain_of(coin, t)
|
25
|
+
days_remain = self.days_remain_of(coin, t) > 0 ? self.days_remain_of(coin, t) : 1
|
26
26
|
rescue
|
27
27
|
redo
|
28
28
|
end
|
@@ -33,7 +33,6 @@ module Watchcow
|
|
33
33
|
margin_expect = margin_annual / 365 * days_remain
|
34
34
|
|
35
35
|
real_margin_expect = (1.0 / spot_first_bid - 1.0 / dm_first_bid) * spot_first_bid * 100
|
36
|
-
|
37
36
|
result = {
|
38
37
|
coin: "#{coin}_#{t}",
|
39
38
|
margin: margin_annual,
|
@@ -46,14 +45,10 @@ module Watchcow
|
|
46
45
|
results.push(result)
|
47
46
|
end
|
48
47
|
end
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
results_nw = results.select{|x| x[:coin].include?('nw')}
|
54
|
-
rescue
|
55
|
-
puts results_cq.to_json
|
56
|
-
end
|
48
|
+
results_cq = results.select{|x| x[:coin].include?('cq')}
|
49
|
+
results_nq = results.select{|x| x[:coin].include?('nq')}
|
50
|
+
results_cw = results.select{|x| x[:coin].include?('cw')}
|
51
|
+
results_nw = results.select{|x| x[:coin].include?('nw')}
|
57
52
|
{
|
58
53
|
cq_list: results_cq.sort{|x,y| y[:expected_margin] <=> x[:expected_margin]},
|
59
54
|
nq_list: results_nq.sort{|x,y| y[:expected_margin] <=> x[:expected_margin]},
|
data/lib/watchcow/version.rb
CHANGED