watchcow 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99751f179eb4c15e3b19d81e778b8fb6c3c99e5582fb51ce0130aaa8ab436b8d
4
- data.tar.gz: d78b9d8c59613ca84e186c5a2ff783fb68817fb32ec0aa2ff727a88b213f346a
3
+ metadata.gz: b4573a11d59d17d89bda6f6afbea3c964112612da2974cf12f42fea503043fc0
4
+ data.tar.gz: cb7ad9c20387b773747ad38d0b8cab922276994f0f34782b1f3adc81154ae293
5
5
  SHA512:
6
- metadata.gz: 75ef29d231100e343af3879050df3945dafe1e30fab0a5dd9d5e998e4595144e963264d87585c238fb0916198d942f984612b01e610645f5da67c63ef33b2302
7
- data.tar.gz: 18f09893ef9c952b124f79f119379c0a16bcb86b2b60e9a022b2ac0f61c49a202ddcf4f28ce6ba1743e824e8988171befbfb23640504f16aa5073896444ea8fd
6
+ metadata.gz: 309ff205f70ba3c7158a5d3d72260e7df6a2824ff376ecb51f611a67eba154ed7234eacbcd15fccdd2be01d66c672187829c5cb65e5c5d46862b6aff3231e44e
7
+ data.tar.gz: bb042886d415016609c1e2e642030481fb7dbff7d8cdeb2f33154456145beb785a5ad49ddff21f785b91149e35dd5418d61b878e4f3e9a674dfea12ea936aa84
data/lib/watchcow/rate.rb CHANGED
@@ -31,6 +31,8 @@ module Watchcow
31
31
  spot_first_bid = spot_result.dig('tick', 'bids')[0][0].to_f
32
32
  margin_annual = (((dm_first_bid - spot_first_bid) / spot_first_bid) / days_remain * 365 * 100).round(6)
33
33
  margin_expect = margin_annual / 365 * days_remain
34
+ base_gap = dm_first_bid - spot_first_bid
35
+ gap_rate = base_gap / dm_first_bid * 100
34
36
 
35
37
  real_margin_expect = (1.0 / spot_first_bid - 1.0 / dm_first_bid) * spot_first_bid * 100
36
38
  result = {
@@ -40,7 +42,9 @@ module Watchcow
40
42
  expected_margin: margin_expect,
41
43
  real_margin_expected: real_margin_expect,
42
44
  dm_first_bid: dm_first_bid,
43
- spot_first_bid: spot_first_bid
45
+ spot_first_bid: spot_first_bid,
46
+ base_gap: base_gap,
47
+ gap_rate: gap_rate
44
48
  }
45
49
  results.push(result)
46
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchcow
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchcow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - DrinE Liu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-21 00:00:00.000000000 Z
11
+ date: 2021-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty