@riocrypto/common-server 1.0.733 → 1.0.735
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.
|
@@ -33,28 +33,17 @@ const calculateAggregateVolumeAndRevenue = (mongoose, days, user) => __awaiter(v
|
|
|
33
33
|
let volume = 0;
|
|
34
34
|
let revenue = 0;
|
|
35
35
|
orders.forEach((order) => {
|
|
36
|
-
var _a
|
|
36
|
+
var _a;
|
|
37
37
|
const fiatAmount = order.amountFiat || 0;
|
|
38
38
|
const conversionRate = order.conversionRateToUSD || 0;
|
|
39
|
-
const
|
|
40
|
-
const platformFee = ((_b = order.fees) === null || _b === void 0 ? void 0 : _b.platformFeeFiat) || 0;
|
|
41
|
-
const platformTax = ((_c = order.fees) === null || _c === void 0 ? void 0 : _c.platformFeeFiatTax) || 0;
|
|
42
|
-
const processingFee = ((_d = order.fees) === null || _d === void 0 ? void 0 : _d.processingFeeFiat) || 0;
|
|
43
|
-
const transferFee = ((_e = order.fees) === null || _e === void 0 ? void 0 : _e.transferFeeFiat) || 0;
|
|
39
|
+
const platformFee = ((_a = order.fees) === null || _a === void 0 ? void 0 : _a.platformFeeFiat) || 0;
|
|
44
40
|
const price = order.price || 0;
|
|
45
41
|
const amountCrypto = order.amountCrypto || 0;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
transferFee) *
|
|
52
|
-
conversionRate;
|
|
53
|
-
const buyVolume = fiatAmount * conversionRate;
|
|
54
|
-
volume += sellVolume + buyVolume;
|
|
55
|
-
const sellRevenue = amountCrypto * price * platformFee * conversionRate;
|
|
56
|
-
const buyRevenue = fiatAmount * platformFee * conversionRate;
|
|
57
|
-
revenue += sellRevenue + buyRevenue;
|
|
42
|
+
const orderVolume = order.side === common_1.Side.Sell
|
|
43
|
+
? amountCrypto * price * conversionRate
|
|
44
|
+
: fiatAmount * conversionRate;
|
|
45
|
+
volume += orderVolume;
|
|
46
|
+
revenue += platformFee * conversionRate;
|
|
58
47
|
});
|
|
59
48
|
const volumeResult = volume || 0;
|
|
60
49
|
const revenueResult = revenue || 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.735",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.653",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|