aga-money 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adb2de788b6d5aaff7c6b9f816aa85f061352a6a90c771b193c72be96a7b1811
|
4
|
+
data.tar.gz: f06107519ddf0d7a37e094ad05303df0694c1935d655a734ccde8c4753b90dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba0590138088e6ffb0af19aee7eb08f340f94a6f9f35eea0f3ebfc6d15d98a454467d857e4a2d15a059d293f55feab38279e9ebd8fef358502a3a920618dad15
|
7
|
+
data.tar.gz: b12b563691cb0e01e0a1d6975f9aa8e4b04b45c03af8ac7962001b2861a9b942d1b5800c19e9cae49843dba4c0c9ce6ef8b411da09b56efff116aebb351a09b9
|
@@ -29,12 +29,12 @@ module Money
|
|
29
29
|
percentage(detection).round(3) >= computation_percentage(price).round(3)
|
30
30
|
end
|
31
31
|
|
32
|
-
# rubocop: disable
|
32
|
+
# rubocop: disable Lint/MissingCopEnableDirective
|
33
33
|
def discriminate_pairs
|
34
34
|
return nil if @pairs.nil?
|
35
35
|
|
36
|
-
max = @pairs&.
|
37
|
-
min = @pairs&.
|
36
|
+
max = @pairs&.max_by { |pair| pair[:price] }
|
37
|
+
min = @pairs&.min_by { |pair| pair[:price] }
|
38
38
|
|
39
39
|
detection = select_max_pairs(max: max, min: min)
|
40
40
|
gain = compare(detection)
|
@@ -52,15 +52,16 @@ module Money
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def select_exchange_names(data)
|
55
|
-
data&.
|
55
|
+
data&.sort_by { |e| e[:price] }
|
56
56
|
end
|
57
57
|
|
58
58
|
def select_max_pairs(max:, min:)
|
59
|
-
data =
|
59
|
+
data = [min, max]
|
60
|
+
|
60
61
|
exchanges = select_exchange_names(data)
|
61
|
-
diff = max - min
|
62
|
+
diff = max[:price] - min[:price]
|
62
63
|
|
63
|
-
{ payload: { max_diff: diff, exchanges: exchanges, price: min } }
|
64
|
+
{ payload: { max_diff: diff, exchanges: exchanges, price: min[:price] } }
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
@@ -16,7 +16,9 @@ module Money
|
|
16
16
|
@data = data
|
17
17
|
end
|
18
18
|
|
19
|
+
# rubocop: disable Metrics/MethodLength, Lint/MissingCopEnableDirective
|
19
20
|
def gain
|
21
|
+
cryptos = []
|
20
22
|
@data&.map do |item|
|
21
23
|
exchanges = item[:exchanges]
|
22
24
|
@gainer = Money::Helpers::Controls::Gain.new(exchanges)
|
@@ -27,10 +29,10 @@ module Money
|
|
27
29
|
item[:exchanges] = potential.dig(:payload, :exchanges)
|
28
30
|
item.each { |i| i.delete(:price) }
|
29
31
|
|
30
|
-
item
|
32
|
+
cryptos << item
|
31
33
|
end&.compact
|
32
34
|
|
33
|
-
|
35
|
+
cryptos
|
34
36
|
end
|
35
37
|
|
36
38
|
def liquidity
|
data/lib/money/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aga-money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Baldazzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -262,5 +262,5 @@ requirements: []
|
|
262
262
|
rubygems_version: 3.3.24
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
|
-
summary: aga-money0.0.
|
265
|
+
summary: aga-money0.0.2
|
266
266
|
test_files: []
|