istox 0.2.0 → 0.2.1
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 +4 -4
- data/lib/istox/helpers/order_book_price_time.rb +2 -2
- data/lib/istox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 177c19f4e1837c38552a01345f4df0ed0b6d75489c3ff7ac7cee4e6ae5300e9d
|
4
|
+
data.tar.gz: bc1e0d56a7c66ebbbb11f2408e8dfbbec8fad3bb056eafd08ca89aa3b7af712c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b4c6ea1b0f4dade5ce454996d6d72c454560d641a4bba722385db12da19e8531bc6fcab904cb372b664ec3952047510942b92da16bf3ab3dcc28bbde685d603
|
7
|
+
data.tar.gz: 5d5e23ac455354401407c93507526fb616e4d7fba272e4883f7a142c86f0bff8c282101aec833b63ae810e90f914c8a273825306673de9c40f6e96908a6123fd
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Istox
|
2
2
|
class OrderBookPriceTime
|
3
3
|
class << self
|
4
|
-
def allocation(soft_cap, total_supply, investments)
|
4
|
+
def allocation(soft_cap, total_supply, investments, decimal_place: 2)
|
5
5
|
# sort by token price desc, and id asc
|
6
6
|
investments = investments.sort do |a, b|
|
7
7
|
[b[:token_price], a[:id]] <=> [a[:token_price], b[:id]]
|
@@ -15,7 +15,7 @@ module Istox
|
|
15
15
|
total_allocated = 0.0
|
16
16
|
total_unallocated = 0.0
|
17
17
|
total_investment = 0.0
|
18
|
-
cutoff_price = ::Istox::FMath.round_up(::Istox::FMath.div(soft_cap, total_supply),
|
18
|
+
cutoff_price = ::Istox::FMath.round_up(::Istox::FMath.div(soft_cap, total_supply), decimal_place)
|
19
19
|
is_cutoff = false
|
20
20
|
|
21
21
|
# return result immediately if no interest
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|