watchcow 0.1.4 → 0.1.5
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 +3 -2
- 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: d4ab5d0732e75c883a3d49c49f3df8135ddebe108def030247efadd9dfcadae5
|
4
|
+
data.tar.gz: 527d958620db506d46f9673f6ab88cd99153211384399aea1eb284836135c343
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85275053ba4d1d752fe63748de876c4e427d832b371f3db86982dacbb194b66fdba925cdbf8bacc8d43c0cc1f02bafffb65543c03751a017a9e07624d02d4efd
|
7
|
+
data.tar.gz: 55664d43e1eea63184a6231f45df738692bf218511a669843dc27a909986c7b1c8c22be1a9b78e0ea5a31abdb28dfe648cd0c56fd4d4c35833d5f57243f35fdd
|
data/lib/watchcow/rate.rb
CHANGED
@@ -21,11 +21,12 @@ module Watchcow
|
|
21
21
|
# puts dm_symbol.dig(:symbol)
|
22
22
|
spot_result = Watchcow::MarketDepth.call(params: spot_symbol, k: :spot)
|
23
23
|
# puts spot_symbol.dig(:symbol)
|
24
|
+
dm_result = JSON.parse dm_result
|
25
|
+
days_remain = self.days_remain_of(coin, t)
|
24
26
|
rescue
|
25
27
|
redo
|
26
28
|
end
|
27
|
-
|
28
|
-
days_remain = self.days_remain_of(coin, t)
|
29
|
+
|
29
30
|
dm_first_bid = dm_result.dig('tick', 'bids')[0][0].to_f
|
30
31
|
spot_first_bid = spot_result.dig('tick', 'bids')[0][0].to_f
|
31
32
|
margin_annual = (((dm_first_bid - spot_first_bid) / spot_first_bid) / days_remain * 365 * 100).round(6)
|
data/lib/watchcow/version.rb
CHANGED