@gainsnetwork/sdk 0.1.19-rc4 → 0.1.19-rc5

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.
@@ -19,27 +19,28 @@ const computeFeeMultiplier = (feeTiers, traderFeeTiers) => {
19
19
  const { currentDay, tiers } = feeTiers;
20
20
  const { traderInfo, expiredPoints, lastDayUpdatedPoints } = traderFeeTiers;
21
21
  const { lastDayUpdated, trailingPoints } = traderInfo;
22
+ let curTrailingPoints = trailingPoints;
22
23
  if (currentDay > lastDayUpdated) {
23
- let curTrailingPoints = 0;
24
+ curTrailingPoints = 0;
24
25
  const earliestActiveDay = currentDay - exports.TRAILING_PERIOD_DAYS;
25
26
  if (lastDayUpdated >= earliestActiveDay) {
26
27
  curTrailingPoints = trailingPoints + lastDayUpdatedPoints;
27
28
  const expiredTrailingPoints = expiredPoints.reduce((acc, points) => acc + points, 0);
28
29
  curTrailingPoints -= expiredTrailingPoints;
29
30
  }
30
- let newFeeMultiplier = exports.FEE_MULTIPLIER_SCALE;
31
- for (let i = (0, exports.getFeeTiersCount)(tiers); i > 0; --i) {
32
- const feeTier = tiers[i - 1];
33
- if (curTrailingPoints >= feeTier.pointsThreshold) {
34
- newFeeMultiplier = feeTier.feeMultiplier;
35
- break;
36
- }
31
+ }
32
+ let newFeeMultiplier = exports.FEE_MULTIPLIER_SCALE;
33
+ for (let i = (0, exports.getFeeTiersCount)(tiers); i > 0; --i) {
34
+ const feeTier = tiers[i - 1];
35
+ if (curTrailingPoints >= feeTier.pointsThreshold) {
36
+ newFeeMultiplier = feeTier.feeMultiplier;
37
+ break;
37
38
  }
38
- return {
39
- feeMultiplier: newFeeMultiplier,
40
- trailingPoints: curTrailingPoints,
41
- };
42
39
  }
40
+ return {
41
+ feeMultiplier: newFeeMultiplier,
42
+ trailingPoints: curTrailingPoints,
43
+ };
43
44
  return {
44
45
  feeMultiplier: exports.FEE_MULTIPLIER_SCALE,
45
46
  trailingPoints,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "0.1.19-rc4",
3
+ "version": "0.1.19-rc5",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [