@vuu-ui/vuu-data-test 0.13.7 → 0.13.8
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.
- package/cjs/index.js +3047 -46
- package/cjs/index.js.map +1 -1
- package/esm/index.js +3019 -14
- package/esm/index.js.map +1 -1
- package/package.json +6 -6
- package/cjs/ArrayProxy.js +0 -72
- package/cjs/ArrayProxy.js.map +0 -1
- package/cjs/RuntimeVisualLink.js +0 -89
- package/cjs/RuntimeVisualLink.js.map +0 -1
- package/cjs/Table.js +0 -184
- package/cjs/Table.js.map +0 -1
- package/cjs/TickingArrayDataSource.js +0 -208
- package/cjs/TickingArrayDataSource.js.map +0 -1
- package/cjs/UpdateGenerator.js +0 -94
- package/cjs/UpdateGenerator.js.map +0 -1
- package/cjs/VuuModule.js +0 -370
- package/cjs/VuuModule.js.map +0 -1
- package/cjs/basket/basket-module.js +0 -255
- package/cjs/basket/basket-module.js.map +0 -1
- package/cjs/basket/basket-schemas.js +0 -123
- package/cjs/basket/basket-schemas.js.map +0 -1
- package/cjs/basket/reference-data/constituents.js +0 -40
- package/cjs/basket/reference-data/constituents.js.map +0 -1
- package/cjs/basket/reference-data/ftse100.js +0 -105
- package/cjs/basket/reference-data/ftse100.js.map +0 -1
- package/cjs/basket/reference-data/hsi.js +0 -87
- package/cjs/basket/reference-data/hsi.js.map +0 -1
- package/cjs/basket/reference-data/nasdaq100.js +0 -108
- package/cjs/basket/reference-data/nasdaq100.js.map +0 -1
- package/cjs/basket/reference-data/prices.js +0 -54
- package/cjs/basket/reference-data/prices.js.map +0 -1
- package/cjs/basket/reference-data/sp500.js +0 -46
- package/cjs/basket/reference-data/sp500.js.map +0 -1
- package/cjs/data-utils.js +0 -57
- package/cjs/data-utils.js.map +0 -1
- package/cjs/local-datasource-provider/LocalDatasourceProvider.js +0 -84
- package/cjs/local-datasource-provider/LocalDatasourceProvider.js.map +0 -1
- package/cjs/makeSuggestions.js +0 -43
- package/cjs/makeSuggestions.js.map +0 -1
- package/cjs/schemas.js +0 -28
- package/cjs/schemas.js.map +0 -1
- package/cjs/simul/SimulModule.js +0 -24
- package/cjs/simul/SimulModule.js.map +0 -1
- package/cjs/simul/reference-data/accounts.js +0 -27
- package/cjs/simul/reference-data/accounts.js.map +0 -1
- package/cjs/simul/reference-data/algos.js +0 -6
- package/cjs/simul/reference-data/algos.js.map +0 -1
- package/cjs/simul/reference-data/currencies.js +0 -6
- package/cjs/simul/reference-data/currencies.js.map +0 -1
- package/cjs/simul/reference-data/instruments-extended.js +0 -18
- package/cjs/simul/reference-data/instruments-extended.js.map +0 -1
- package/cjs/simul/reference-data/instruments.js +0 -77
- package/cjs/simul/reference-data/instruments.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/convert-string-to-base-ten-number.js +0 -6
- package/cjs/simul/reference-data/isin-generator/convert-string-to-base-ten-number.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/fixtures/alphabet.js +0 -31
- package/cjs/simul/reference-data/isin-generator/fixtures/alphabet.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/fixtures/alphanumeric-values.js +0 -9
- package/cjs/simul/reference-data/isin-generator/fixtures/alphanumeric-values.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/fixtures/base-ten-numbers.js +0 -17
- package/cjs/simul/reference-data/isin-generator/fixtures/base-ten-numbers.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-cusip-check-code.js +0 -24
- package/cjs/simul/reference-data/isin-generator/generate-cusip-check-code.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-cusip-without-check-code.js +0 -13
- package/cjs/simul/reference-data/isin-generator/generate-cusip-without-check-code.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-cusip.js +0 -13
- package/cjs/simul/reference-data/isin-generator/generate-cusip.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-random-alphanumeric.js +0 -8
- package/cjs/simul/reference-data/isin-generator/generate-random-alphanumeric.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-random-base-ten-number.js +0 -6
- package/cjs/simul/reference-data/isin-generator/generate-random-base-ten-number.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.js +0 -14
- package/cjs/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.js +0 -14
- package/cjs/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/index.js +0 -295
- package/cjs/simul/reference-data/isin-generator/index.js.map +0 -1
- package/cjs/simul/reference-data/isin-generator/is-odd.js +0 -6
- package/cjs/simul/reference-data/isin-generator/is-odd.js.map +0 -1
- package/cjs/simul/reference-data/locations.js +0 -17
- package/cjs/simul/reference-data/locations.js.map +0 -1
- package/cjs/simul/reference-data/lotsizes.js +0 -28
- package/cjs/simul/reference-data/lotsizes.js.map +0 -1
- package/cjs/simul/reference-data/orderStatus.js +0 -6
- package/cjs/simul/reference-data/orderStatus.js.map +0 -1
- package/cjs/simul/reference-data/orders.js +0 -54
- package/cjs/simul/reference-data/orders.js.map +0 -1
- package/cjs/simul/reference-data/parent-child-orders.js +0 -122
- package/cjs/simul/reference-data/parent-child-orders.js.map +0 -1
- package/cjs/simul/reference-data/prices.js +0 -71
- package/cjs/simul/reference-data/prices.js.map +0 -1
- package/cjs/simul/reference-data/sides.js +0 -6
- package/cjs/simul/reference-data/sides.js.map +0 -1
- package/cjs/simul/simul-module.js +0 -126
- package/cjs/simul/simul-module.js.map +0 -1
- package/cjs/simul/simul-schemas.js +0 -142
- package/cjs/simul/simul-schemas.js.map +0 -1
- package/cjs/test/test-module.js +0 -26
- package/cjs/test/test-module.js.map +0 -1
- package/cjs/test/test-schemas.js +0 -17
- package/cjs/test/test-schemas.js.map +0 -1
- package/cjs/vuu-modules.js +0 -15
- package/cjs/vuu-modules.js.map +0 -1
- package/cjs/vuu-row-generator.js +0 -74
- package/cjs/vuu-row-generator.js.map +0 -1
- package/esm/ArrayProxy.js +0 -70
- package/esm/ArrayProxy.js.map +0 -1
- package/esm/RuntimeVisualLink.js +0 -87
- package/esm/RuntimeVisualLink.js.map +0 -1
- package/esm/Table.js +0 -179
- package/esm/Table.js.map +0 -1
- package/esm/TickingArrayDataSource.js +0 -206
- package/esm/TickingArrayDataSource.js.map +0 -1
- package/esm/UpdateGenerator.js +0 -92
- package/esm/UpdateGenerator.js.map +0 -1
- package/esm/VuuModule.js +0 -366
- package/esm/VuuModule.js.map +0 -1
- package/esm/basket/basket-module.js +0 -251
- package/esm/basket/basket-module.js.map +0 -1
- package/esm/basket/basket-schemas.js +0 -120
- package/esm/basket/basket-schemas.js.map +0 -1
- package/esm/basket/reference-data/constituents.js +0 -38
- package/esm/basket/reference-data/constituents.js.map +0 -1
- package/esm/basket/reference-data/ftse100.js +0 -103
- package/esm/basket/reference-data/ftse100.js.map +0 -1
- package/esm/basket/reference-data/hsi.js +0 -85
- package/esm/basket/reference-data/hsi.js.map +0 -1
- package/esm/basket/reference-data/nasdaq100.js +0 -106
- package/esm/basket/reference-data/nasdaq100.js.map +0 -1
- package/esm/basket/reference-data/prices.js +0 -52
- package/esm/basket/reference-data/prices.js.map +0 -1
- package/esm/basket/reference-data/sp500.js +0 -44
- package/esm/basket/reference-data/sp500.js.map +0 -1
- package/esm/data-utils.js +0 -52
- package/esm/data-utils.js.map +0 -1
- package/esm/local-datasource-provider/LocalDatasourceProvider.js +0 -82
- package/esm/local-datasource-provider/LocalDatasourceProvider.js.map +0 -1
- package/esm/makeSuggestions.js +0 -41
- package/esm/makeSuggestions.js.map +0 -1
- package/esm/schemas.js +0 -24
- package/esm/schemas.js.map +0 -1
- package/esm/simul/SimulModule.js +0 -22
- package/esm/simul/SimulModule.js.map +0 -1
- package/esm/simul/reference-data/accounts.js +0 -25
- package/esm/simul/reference-data/accounts.js.map +0 -1
- package/esm/simul/reference-data/algos.js +0 -4
- package/esm/simul/reference-data/algos.js.map +0 -1
- package/esm/simul/reference-data/currencies.js +0 -4
- package/esm/simul/reference-data/currencies.js.map +0 -1
- package/esm/simul/reference-data/instruments-extended.js +0 -16
- package/esm/simul/reference-data/instruments-extended.js.map +0 -1
- package/esm/simul/reference-data/instruments.js +0 -72
- package/esm/simul/reference-data/instruments.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/convert-string-to-base-ten-number.js +0 -4
- package/esm/simul/reference-data/isin-generator/convert-string-to-base-ten-number.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/fixtures/alphabet.js +0 -29
- package/esm/simul/reference-data/isin-generator/fixtures/alphabet.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/fixtures/alphanumeric-values.js +0 -7
- package/esm/simul/reference-data/isin-generator/fixtures/alphanumeric-values.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/fixtures/base-ten-numbers.js +0 -15
- package/esm/simul/reference-data/isin-generator/fixtures/base-ten-numbers.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-cusip-check-code.js +0 -22
- package/esm/simul/reference-data/isin-generator/generate-cusip-check-code.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-cusip-without-check-code.js +0 -11
- package/esm/simul/reference-data/isin-generator/generate-cusip-without-check-code.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-cusip.js +0 -11
- package/esm/simul/reference-data/isin-generator/generate-cusip.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-random-alphanumeric.js +0 -6
- package/esm/simul/reference-data/isin-generator/generate-random-alphanumeric.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-random-base-ten-number.js +0 -4
- package/esm/simul/reference-data/isin-generator/generate-random-base-ten-number.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.js +0 -12
- package/esm/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.js +0 -12
- package/esm/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/index.js +0 -293
- package/esm/simul/reference-data/isin-generator/index.js.map +0 -1
- package/esm/simul/reference-data/isin-generator/is-odd.js +0 -4
- package/esm/simul/reference-data/isin-generator/is-odd.js.map +0 -1
- package/esm/simul/reference-data/locations.js +0 -14
- package/esm/simul/reference-data/locations.js.map +0 -1
- package/esm/simul/reference-data/lotsizes.js +0 -26
- package/esm/simul/reference-data/lotsizes.js.map +0 -1
- package/esm/simul/reference-data/orderStatus.js +0 -4
- package/esm/simul/reference-data/orderStatus.js.map +0 -1
- package/esm/simul/reference-data/orders.js +0 -51
- package/esm/simul/reference-data/orders.js.map +0 -1
- package/esm/simul/reference-data/parent-child-orders.js +0 -117
- package/esm/simul/reference-data/parent-child-orders.js.map +0 -1
- package/esm/simul/reference-data/prices.js +0 -68
- package/esm/simul/reference-data/prices.js.map +0 -1
- package/esm/simul/reference-data/sides.js +0 -4
- package/esm/simul/reference-data/sides.js.map +0 -1
- package/esm/simul/simul-module.js +0 -124
- package/esm/simul/simul-module.js.map +0 -1
- package/esm/simul/simul-schemas.js +0 -139
- package/esm/simul/simul-schemas.js.map +0 -1
- package/esm/test/test-module.js +0 -24
- package/esm/test/test-module.js.map +0 -1
- package/esm/test/test-schemas.js +0 -15
- package/esm/test/test-schemas.js.map +0 -1
- package/esm/vuu-modules.js +0 -13
- package/esm/vuu-modules.js.map +0 -1
- package/esm/vuu-row-generator.js +0 -68
- package/esm/vuu-row-generator.js.map +0 -1
package/cjs/index.js
CHANGED
|
@@ -1,49 +1,3050 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
3
|
+
var vuuDataLocal = require('@vuu-ui/vuu-data-local');
|
|
4
|
+
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
var __defProp$3 = Object.defineProperty;
|
|
8
|
+
var __typeError$5 = (msg) => {
|
|
9
|
+
throw TypeError(msg);
|
|
10
|
+
};
|
|
11
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
|
+
var __accessCheck$5 = (obj, member, msg) => member.has(obj) || __typeError$5("Cannot " + msg);
|
|
14
|
+
var __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
15
|
+
var __privateAdd$5 = (obj, member, value) => member.has(obj) ? __typeError$5("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
16
|
+
var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
|
|
17
|
+
var _getItem;
|
|
18
|
+
const _ArrayProxy = class _ArrayProxy {
|
|
19
|
+
constructor(size, getRow) {
|
|
20
|
+
__privateAdd$5(this, _getItem);
|
|
21
|
+
__publicField$3(this, "length", 0);
|
|
22
|
+
__publicField$3(this, "map", (func) => {
|
|
23
|
+
return new _ArrayProxy(this.length, (i) => {
|
|
24
|
+
return func(__privateGet$5(this, _getItem).call(this, i), i);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
__publicField$3(this, "slice", (from, to) => {
|
|
28
|
+
const out = [];
|
|
29
|
+
const end = Math.min(this.length, to);
|
|
30
|
+
for (let i = from; i < end; i++) {
|
|
31
|
+
out.push(__privateGet$5(this, _getItem).call(this, i));
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
});
|
|
35
|
+
__privateSet$4(this, _getItem, getRow);
|
|
36
|
+
this.length = size;
|
|
37
|
+
const handler = {
|
|
38
|
+
get: (target, prop) => {
|
|
39
|
+
var _a;
|
|
40
|
+
if (prop === "length") {
|
|
41
|
+
return target.length;
|
|
42
|
+
} else if (prop === "slice") {
|
|
43
|
+
return target.slice;
|
|
44
|
+
} else if (prop === "map") {
|
|
45
|
+
return target.map;
|
|
46
|
+
} else if (prop === "toString") {
|
|
47
|
+
return "[ArrayProxy]";
|
|
48
|
+
}
|
|
49
|
+
if (typeof prop === "string") {
|
|
50
|
+
const index = parseInt(prop, 10);
|
|
51
|
+
if (!isNaN(index)) {
|
|
52
|
+
if (index < this.length) {
|
|
53
|
+
return __privateGet$5(_a = target, _getItem).call(_a, index);
|
|
54
|
+
} else {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
throw Error(`unsupported property ${String(prop)} on ArrayProxy`);
|
|
60
|
+
},
|
|
61
|
+
set: (target, prop, newVal) => {
|
|
62
|
+
if (prop === "length") {
|
|
63
|
+
target.length = newVal;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
throw Error(`ArrayProxy is immutable except for length`);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return new Proxy(this, handler);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
_getItem = new WeakMap();
|
|
73
|
+
let ArrayProxy = _ArrayProxy;
|
|
74
|
+
|
|
75
|
+
const schemas$3 = {
|
|
76
|
+
algoType: {
|
|
77
|
+
columns: [
|
|
78
|
+
{ name: "algoType", serverDataType: "string" },
|
|
79
|
+
{ name: "id", serverDataType: "int" }
|
|
80
|
+
],
|
|
81
|
+
key: "id",
|
|
82
|
+
table: { module: "BASKET", table: "algoType" }
|
|
83
|
+
},
|
|
84
|
+
basket: {
|
|
85
|
+
columns: [
|
|
86
|
+
{ name: "id", serverDataType: "string" },
|
|
87
|
+
{ name: "name", serverDataType: "string" },
|
|
88
|
+
{ name: "notionalValue", serverDataType: "double" },
|
|
89
|
+
{ name: "notionalValueUsd", serverDataType: "double" }
|
|
90
|
+
],
|
|
91
|
+
key: "id",
|
|
92
|
+
table: { module: "BASKET", table: "basket" }
|
|
93
|
+
},
|
|
94
|
+
basketConstituent: {
|
|
95
|
+
columns: [
|
|
96
|
+
{ name: "basketId", serverDataType: "string" },
|
|
97
|
+
{ name: "change", serverDataType: "string" },
|
|
98
|
+
{ name: "description", serverDataType: "string" },
|
|
99
|
+
{ name: "lastTrade", serverDataType: "string" },
|
|
100
|
+
{ name: "ric", serverDataType: "string" },
|
|
101
|
+
{ name: "ricBasketId", serverDataType: "string" },
|
|
102
|
+
{ name: "side", serverDataType: "string" },
|
|
103
|
+
{ name: "volume", serverDataType: "string" },
|
|
104
|
+
{ name: "weighting", serverDataType: "double" }
|
|
105
|
+
],
|
|
106
|
+
key: "ricBasketId",
|
|
107
|
+
table: { module: "BASKET", table: "basketConstituent" }
|
|
108
|
+
},
|
|
109
|
+
basketTrading: {
|
|
110
|
+
columns: [
|
|
111
|
+
{ name: "basketId", serverDataType: "string" },
|
|
112
|
+
{ name: "basketName", serverDataType: "string" },
|
|
113
|
+
{ name: "filledPct", serverDataType: "double" },
|
|
114
|
+
{ name: "fxRateToUsd", serverDataType: "double" },
|
|
115
|
+
{ name: "instanceId", serverDataType: "string" },
|
|
116
|
+
{ name: "side", serverDataType: "string" },
|
|
117
|
+
{ name: "status", serverDataType: "string" },
|
|
118
|
+
{ name: "totalNotional", serverDataType: "double" },
|
|
119
|
+
{ name: "totalNotionalUsd", serverDataType: "double" },
|
|
120
|
+
{ name: "units", serverDataType: "int" }
|
|
121
|
+
],
|
|
122
|
+
key: "instanceId",
|
|
123
|
+
table: { module: "BASKET", table: "basketTrading" }
|
|
124
|
+
},
|
|
125
|
+
basketTradingConstituent: {
|
|
126
|
+
columns: [
|
|
127
|
+
{ name: "algo", serverDataType: "string" },
|
|
128
|
+
{ name: "algoParams", serverDataType: "string" },
|
|
129
|
+
{ name: "basketId", serverDataType: "string" },
|
|
130
|
+
{ name: "description", serverDataType: "string" },
|
|
131
|
+
{ name: "instanceId", serverDataType: "string" },
|
|
132
|
+
{ name: "instanceIdRic", serverDataType: "string" },
|
|
133
|
+
{ name: "limitPrice", serverDataType: "double" },
|
|
134
|
+
{ name: "notionalLocal", serverDataType: "double" },
|
|
135
|
+
{ name: "notionalUsd", serverDataType: "double" },
|
|
136
|
+
{ name: "pctFilled", serverDataType: "double" },
|
|
137
|
+
{ name: "priceSpread", serverDataType: "int" },
|
|
138
|
+
{ name: "priceStrategyId", serverDataType: "int" },
|
|
139
|
+
{ name: "quantity", serverDataType: "long" },
|
|
140
|
+
{ name: "ric", serverDataType: "string" },
|
|
141
|
+
{ name: "side", serverDataType: "string" },
|
|
142
|
+
{ name: "status", serverDataType: "string" },
|
|
143
|
+
{ name: "venue", serverDataType: "string" },
|
|
144
|
+
{ name: "weighting", serverDataType: "double" }
|
|
145
|
+
],
|
|
146
|
+
key: "instanceIdRic",
|
|
147
|
+
table: { module: "BASKET", table: "basketTradingConstituent" }
|
|
148
|
+
},
|
|
149
|
+
basketTradingConstituentJoin: {
|
|
150
|
+
columns: [
|
|
151
|
+
{ name: "algo", serverDataType: "string" },
|
|
152
|
+
{ name: "algoParams", serverDataType: "string" },
|
|
153
|
+
{ name: "ask", serverDataType: "double" },
|
|
154
|
+
{ name: "askSize", serverDataType: "double" },
|
|
155
|
+
{ name: "basketId", serverDataType: "string" },
|
|
156
|
+
{ name: "bid", serverDataType: "double" },
|
|
157
|
+
{ name: "bidSize", serverDataType: "double" },
|
|
158
|
+
{ name: "close", serverDataType: "double" },
|
|
159
|
+
{ name: "description", serverDataType: "string" },
|
|
160
|
+
{ name: "instanceId", serverDataType: "string" },
|
|
161
|
+
{ name: "instanceIdRic", serverDataType: "string" },
|
|
162
|
+
{ name: "last", serverDataType: "double" },
|
|
163
|
+
{ name: "limitPrice", serverDataType: "double" },
|
|
164
|
+
{ name: "notionalLocal", serverDataType: "double" },
|
|
165
|
+
{ name: "notionalUsd", serverDataType: "double" },
|
|
166
|
+
{ name: "open", serverDataType: "double" },
|
|
167
|
+
{ name: "pctFilled", serverDataType: "double" },
|
|
168
|
+
{ name: "phase", serverDataType: "string" },
|
|
169
|
+
{ name: "priceSpread", serverDataType: "int" },
|
|
170
|
+
{ name: "priceStrategyId", serverDataType: "int" },
|
|
171
|
+
{ name: "quantity", serverDataType: "long" },
|
|
172
|
+
{ name: "ric", serverDataType: "string" },
|
|
173
|
+
{ name: "scenario", serverDataType: "string" },
|
|
174
|
+
{ name: "side", serverDataType: "string" },
|
|
175
|
+
{ name: "status", serverDataType: "string" },
|
|
176
|
+
{ name: "venue", serverDataType: "string" },
|
|
177
|
+
{ name: "weighting", serverDataType: "double" }
|
|
178
|
+
],
|
|
179
|
+
key: "instanceIdRic",
|
|
180
|
+
table: { module: "BASKET", table: "basketTradingConstituentJoin" }
|
|
181
|
+
},
|
|
182
|
+
priceStrategyType: {
|
|
183
|
+
columns: [
|
|
184
|
+
{ name: "priceStrategy", serverDataType: "string" },
|
|
185
|
+
{ name: "id", serverDataType: "int" }
|
|
186
|
+
],
|
|
187
|
+
key: "",
|
|
188
|
+
table: { module: "BASKET", table: "priceStrategyType" }
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const isBasketTable = (table) => table.module === "BASKET";
|
|
192
|
+
|
|
193
|
+
const schemas$2 = {
|
|
194
|
+
instruments: {
|
|
195
|
+
columns: [
|
|
196
|
+
{ name: "bbg", serverDataType: "string" },
|
|
197
|
+
{ name: "currency", serverDataType: "string" },
|
|
198
|
+
{ name: "description", serverDataType: "string" },
|
|
199
|
+
{ name: "exchange", serverDataType: "string" },
|
|
200
|
+
{ name: "isin", serverDataType: "string" },
|
|
201
|
+
{ name: "lotSize", serverDataType: "int" },
|
|
202
|
+
{ name: "ric", serverDataType: "string" }
|
|
203
|
+
],
|
|
204
|
+
key: "ric",
|
|
205
|
+
table: { module: "SIMUL", table: "instruments" }
|
|
206
|
+
},
|
|
207
|
+
instrumentsExtended: {
|
|
208
|
+
columns: [
|
|
209
|
+
{ name: "bbg", serverDataType: "string" },
|
|
210
|
+
{ name: "currency", serverDataType: "string" },
|
|
211
|
+
{ name: "description", serverDataType: "string" },
|
|
212
|
+
{ name: "exchange", serverDataType: "string" },
|
|
213
|
+
{ name: "isin", serverDataType: "string" },
|
|
214
|
+
{ name: "lotSize", serverDataType: "int" },
|
|
215
|
+
{ name: "ric", serverDataType: "string" },
|
|
216
|
+
{ name: "supported", serverDataType: "boolean" },
|
|
217
|
+
{ name: "wishlist", serverDataType: "boolean" },
|
|
218
|
+
{ name: "lastUpdated", serverDataType: "long" },
|
|
219
|
+
{ name: "price", serverDataType: "double" },
|
|
220
|
+
{ name: "date", serverDataType: "long" }
|
|
221
|
+
],
|
|
222
|
+
key: "ric",
|
|
223
|
+
table: { module: "SIMUL", table: "instrumentsExtended" }
|
|
224
|
+
},
|
|
225
|
+
instrumentPrices: {
|
|
226
|
+
columns: [
|
|
227
|
+
{ name: "ask", serverDataType: "double" },
|
|
228
|
+
{ name: "askSize", serverDataType: "double" },
|
|
229
|
+
// type: "int"
|
|
230
|
+
{ name: "bbg", serverDataType: "string" },
|
|
231
|
+
{ name: "bid", serverDataType: "double" },
|
|
232
|
+
{ name: "bidSize", serverDataType: "double" },
|
|
233
|
+
{ name: "close", serverDataType: "double" },
|
|
234
|
+
{ name: "currency", serverDataType: "string" },
|
|
235
|
+
{ name: "description", serverDataType: "string" },
|
|
236
|
+
{ name: "exchange", serverDataType: "string" },
|
|
237
|
+
{ name: "isin", serverDataType: "string" },
|
|
238
|
+
{ name: "last", serverDataType: "double" },
|
|
239
|
+
{ name: "lotSize", serverDataType: "int" },
|
|
240
|
+
{ name: "open", serverDataType: "double" },
|
|
241
|
+
{ name: "phase", serverDataType: "string" },
|
|
242
|
+
{ name: "ric", serverDataType: "string" },
|
|
243
|
+
{ name: "scenario", serverDataType: "string" }
|
|
244
|
+
],
|
|
245
|
+
key: "ric",
|
|
246
|
+
table: { module: "SIMUL", table: "instrumentPrices" }
|
|
247
|
+
},
|
|
248
|
+
orders: {
|
|
249
|
+
columns: [
|
|
250
|
+
{ name: "status", serverDataType: "string" },
|
|
251
|
+
{ name: "ccy", serverDataType: "string" },
|
|
252
|
+
{ name: "created", serverDataType: "long" },
|
|
253
|
+
{ name: "filledQuantity", serverDataType: "double" },
|
|
254
|
+
{ name: "lastUpdate", serverDataType: "long" },
|
|
255
|
+
{ name: "orderId", serverDataType: "string" },
|
|
256
|
+
{ name: "quantity", serverDataType: "double" },
|
|
257
|
+
{ name: "ric", serverDataType: "string" },
|
|
258
|
+
{ name: "side", serverDataType: "string" },
|
|
259
|
+
{ name: "trader", serverDataType: "string" }
|
|
260
|
+
],
|
|
261
|
+
key: "orderId",
|
|
262
|
+
table: { module: "SIMUL", table: "orders" }
|
|
263
|
+
},
|
|
264
|
+
childOrders: {
|
|
265
|
+
columns: [
|
|
266
|
+
{ name: "account", serverDataType: "string" },
|
|
267
|
+
{ name: "averagePrice", serverDataType: "double" },
|
|
268
|
+
{ name: "ccy", serverDataType: "string" },
|
|
269
|
+
{ name: "exchange", serverDataType: "string" },
|
|
270
|
+
{ name: "filledQty", serverDataType: "double" },
|
|
271
|
+
{ name: "id", serverDataType: "string" },
|
|
272
|
+
{ name: "idAsInt", serverDataType: "int" },
|
|
273
|
+
{ name: "lastUpdate", serverDataType: "long" },
|
|
274
|
+
{ name: "openQty", serverDataType: "double" },
|
|
275
|
+
{ name: "parentOrderId", serverDataType: "string" },
|
|
276
|
+
{ name: "price", serverDataType: "double" },
|
|
277
|
+
{ name: "quantity", serverDataType: "double" },
|
|
278
|
+
{ name: "ric", serverDataType: "string" },
|
|
279
|
+
{ name: "side", serverDataType: "string" },
|
|
280
|
+
{ name: "status", serverDataType: "string" },
|
|
281
|
+
{ name: "strategy", serverDataType: "string" },
|
|
282
|
+
{ name: "volLimit", serverDataType: "int" }
|
|
283
|
+
],
|
|
284
|
+
key: "id",
|
|
285
|
+
table: { module: "SIMUL", table: "childOrders" }
|
|
286
|
+
},
|
|
287
|
+
parentOrders: {
|
|
288
|
+
columns: [
|
|
289
|
+
{ name: "account", serverDataType: "string" },
|
|
290
|
+
{ name: "algo", serverDataType: "string" },
|
|
291
|
+
{ name: "averagePrice", serverDataType: "double" },
|
|
292
|
+
{ name: "ccy", serverDataType: "string" },
|
|
293
|
+
{ name: "childCount", serverDataType: "int" },
|
|
294
|
+
{ name: "exchange", serverDataType: "string" },
|
|
295
|
+
{ name: "filledQty", serverDataType: "double" },
|
|
296
|
+
{ name: "id", serverDataType: "string" },
|
|
297
|
+
{ name: "idAsInt", serverDataType: "int" },
|
|
298
|
+
{ name: "lastUpdate", serverDataType: "long" },
|
|
299
|
+
{ name: "openQty", serverDataType: "double" },
|
|
300
|
+
{ name: "price", serverDataType: "double" },
|
|
301
|
+
{ name: "quantity", serverDataType: "double" },
|
|
302
|
+
{ name: "ric", serverDataType: "string" },
|
|
303
|
+
{ name: "side", serverDataType: "string" },
|
|
304
|
+
{ name: "status", serverDataType: "string" },
|
|
305
|
+
{ name: "volLimit", serverDataType: "int" }
|
|
306
|
+
],
|
|
307
|
+
key: "id",
|
|
308
|
+
table: { module: "SIMUL", table: "parentOrders" }
|
|
309
|
+
},
|
|
310
|
+
prices: {
|
|
311
|
+
columns: [
|
|
312
|
+
{ name: "ask", serverDataType: "double" },
|
|
313
|
+
{ name: "askSize", serverDataType: "double" },
|
|
314
|
+
// type: "int"
|
|
315
|
+
{ name: "bid", serverDataType: "double" },
|
|
316
|
+
{ name: "bidSize", serverDataType: "double" },
|
|
317
|
+
{ name: "close", serverDataType: "double" },
|
|
318
|
+
{ name: "last", serverDataType: "double" },
|
|
319
|
+
{ name: "open", serverDataType: "double" },
|
|
320
|
+
{ name: "phase", serverDataType: "string" },
|
|
321
|
+
{ name: "ric", serverDataType: "string" },
|
|
322
|
+
{ name: "scenario", serverDataType: "string" }
|
|
323
|
+
],
|
|
324
|
+
key: "ric",
|
|
325
|
+
table: { module: "SIMUL", table: "prices" }
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
const isSimulTable = (table) => table.module === "SIMUL";
|
|
329
|
+
|
|
330
|
+
const DefaultRowGenerator = (columns) => (index) => {
|
|
331
|
+
return [`row ${index + 1}`].concat(
|
|
332
|
+
Array(columns.length).fill(true).map((v, j) => `value ${j + 1} @ ${index + 1}`)
|
|
333
|
+
);
|
|
334
|
+
};
|
|
335
|
+
const DefaultColumnGenerator = (columns, columnConfig = {}) => {
|
|
336
|
+
if (typeof columns === "number") {
|
|
337
|
+
return [{ label: "Row Number", name: "rownum", width: 150 }].concat(
|
|
338
|
+
Array(columns).fill(true).map((_, i) => {
|
|
339
|
+
const name = `column_${i + 1}`;
|
|
340
|
+
const label = `Column ${i + 1}`;
|
|
341
|
+
return { label, name, width: 100, ...columnConfig[name] };
|
|
342
|
+
})
|
|
343
|
+
);
|
|
344
|
+
} else {
|
|
345
|
+
throw Error("DefaultColumnGenerator must be passed columns (number)");
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
const defaultGenerators = {
|
|
349
|
+
ColumnGenerator: DefaultColumnGenerator,
|
|
350
|
+
RowGenerator: DefaultRowGenerator
|
|
351
|
+
};
|
|
352
|
+
const getColumnAndRowGenerator = (table) => {
|
|
353
|
+
const tableName = table?.table ?? "";
|
|
354
|
+
switch (table?.module) {
|
|
355
|
+
case "SIMUL": {
|
|
356
|
+
const { ColumnGenerator, RowGenerator, createUpdateGenerator } = (
|
|
357
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
358
|
+
// @ts-ignore
|
|
359
|
+
simulDataGenerators[tableName] ?? defaultGenerators
|
|
360
|
+
);
|
|
361
|
+
return [ColumnGenerator, RowGenerator, createUpdateGenerator];
|
|
362
|
+
}
|
|
363
|
+
case "BASKET": {
|
|
364
|
+
const { ColumnGenerator, RowGenerator, createUpdateGenerator } = (
|
|
365
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
366
|
+
// @ts-ignore
|
|
367
|
+
basketDataGenerators[tableName] ?? defaultGenerators
|
|
368
|
+
);
|
|
369
|
+
return [ColumnGenerator, RowGenerator, createUpdateGenerator];
|
|
370
|
+
}
|
|
371
|
+
case void 0: {
|
|
372
|
+
const { ColumnGenerator, RowGenerator } = defaultGenerators;
|
|
373
|
+
return [ColumnGenerator, RowGenerator];
|
|
374
|
+
}
|
|
375
|
+
default:
|
|
376
|
+
throw Error(
|
|
377
|
+
`vuu-row-gererator table ${table?.table} was requested but no generator is registered`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
const populateArray = (count, colGen, rowGen, columns) => {
|
|
382
|
+
const columnDescriptors = colGen(columns);
|
|
383
|
+
const generateRow = rowGen(columnDescriptors.map((col) => col.name));
|
|
384
|
+
const data = [];
|
|
385
|
+
for (let i = 0; i < count; i++) {
|
|
386
|
+
const row = generateRow(i);
|
|
387
|
+
if (row) {
|
|
388
|
+
data[i] = row;
|
|
389
|
+
} else {
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return data;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const schemas$1 = {
|
|
397
|
+
TwoHundredColumns: {
|
|
398
|
+
columns: DefaultColumnGenerator(200).map((col) => ({
|
|
399
|
+
...col,
|
|
400
|
+
serverDataType: "string"
|
|
401
|
+
})),
|
|
402
|
+
key: "column01",
|
|
403
|
+
table: { module: "TEST", table: "TwoHundredColumns" }
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const schemas = {
|
|
408
|
+
...schemas$3,
|
|
409
|
+
...schemas$2,
|
|
410
|
+
...schemas$1
|
|
411
|
+
};
|
|
412
|
+
const allSchemas = {
|
|
413
|
+
...schemas$3,
|
|
414
|
+
...schemas$2,
|
|
415
|
+
...schemas$1
|
|
416
|
+
};
|
|
417
|
+
const getAllSchemas = () => schemas;
|
|
418
|
+
const getSchema = (tableName) => {
|
|
419
|
+
if (allSchemas[tableName]) {
|
|
420
|
+
return allSchemas[tableName];
|
|
421
|
+
}
|
|
422
|
+
throw Error(`getSchema no schema for table ${tableName}`);
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const cachedValues = /* @__PURE__ */ new Map();
|
|
426
|
+
const checkPattern = (value, pattern) => {
|
|
427
|
+
return new RegExp(`^${pattern}`, "i").test(value);
|
|
428
|
+
};
|
|
429
|
+
const getUniqueValues = (table, column, pattern = "") => {
|
|
430
|
+
let uniqueValues;
|
|
431
|
+
const cachedEntry = cachedValues.get(table);
|
|
432
|
+
if (cachedEntry && cachedEntry.has(column)) {
|
|
433
|
+
uniqueValues = cachedEntry.get(column);
|
|
434
|
+
} else {
|
|
435
|
+
const { data, map } = table;
|
|
436
|
+
const key = map[column];
|
|
437
|
+
if (key === void 0) {
|
|
438
|
+
throw Error(`table ${table.schema.table.table} has no column ${column}`);
|
|
439
|
+
}
|
|
440
|
+
uniqueValues = [];
|
|
441
|
+
const set = /* @__PURE__ */ new Set();
|
|
442
|
+
for (const row of data) {
|
|
443
|
+
const value = row[key];
|
|
444
|
+
if (!set.has(value)) {
|
|
445
|
+
set.add(value);
|
|
446
|
+
uniqueValues.push(value);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
uniqueValues.sort();
|
|
450
|
+
if (cachedEntry) {
|
|
451
|
+
cachedEntry.set(column, uniqueValues);
|
|
452
|
+
} else {
|
|
453
|
+
cachedValues.set(table, /* @__PURE__ */ new Map([[column, uniqueValues]]));
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return pattern ? uniqueValues.filter((value) => checkPattern(value.toString(), pattern)).slice(0, 10) : uniqueValues.slice(0, 10);
|
|
457
|
+
};
|
|
458
|
+
const makeSuggestions = (table, column, pattern) => new Promise((resolve) => {
|
|
459
|
+
const uniqueValues = getUniqueValues(table, column, pattern);
|
|
460
|
+
const result = uniqueValues.length > 20 ? uniqueValues?.slice(0, 20).map((v) => v.toString()) : uniqueValues.map((v) => v.toString());
|
|
461
|
+
setTimeout(() => resolve(result), 100);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
var __typeError$4 = (msg) => {
|
|
465
|
+
throw TypeError(msg);
|
|
466
|
+
};
|
|
467
|
+
var __accessCheck$4 = (obj, member, msg) => member.has(obj) || __typeError$4("Cannot " + msg);
|
|
468
|
+
var __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), member.get(obj));
|
|
469
|
+
var __privateAdd$4 = (obj, member, value) => member.has(obj) ? __typeError$4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
470
|
+
var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value);
|
|
471
|
+
var _menuRpcServices, _pendingVisualLink, _rpcServices, _sessionTables, _table, _selectionLinkSubscribers, _visualLinkService, _getVisualLinks;
|
|
472
|
+
const { KEY } = vuuUtils.metadataKeys;
|
|
473
|
+
class TickingArrayDataSource extends vuuDataLocal.ArrayDataSource {
|
|
474
|
+
constructor({
|
|
475
|
+
data,
|
|
476
|
+
getVisualLinks,
|
|
477
|
+
menuRpcServices,
|
|
478
|
+
rpcServices,
|
|
479
|
+
sessionTables,
|
|
480
|
+
table,
|
|
481
|
+
menu,
|
|
482
|
+
visualLink,
|
|
483
|
+
visualLinkService,
|
|
484
|
+
...arrayDataSourceProps
|
|
485
|
+
}) {
|
|
486
|
+
if (data === void 0 && table === void 0) {
|
|
487
|
+
throw Error("TickingArrayDataSource must be constructed with data");
|
|
488
|
+
}
|
|
489
|
+
super({
|
|
490
|
+
...arrayDataSourceProps,
|
|
491
|
+
data: data ?? table?.data ?? []
|
|
492
|
+
});
|
|
493
|
+
__privateAdd$4(this, _menuRpcServices);
|
|
494
|
+
__privateAdd$4(this, _pendingVisualLink);
|
|
495
|
+
__privateAdd$4(this, _rpcServices);
|
|
496
|
+
// A reference to session tables hosted within client side module
|
|
497
|
+
__privateAdd$4(this, _sessionTables);
|
|
498
|
+
__privateAdd$4(this, _table);
|
|
499
|
+
__privateAdd$4(this, _selectionLinkSubscribers);
|
|
500
|
+
__privateAdd$4(this, _visualLinkService);
|
|
501
|
+
__privateAdd$4(this, _getVisualLinks);
|
|
502
|
+
this._menu = menu;
|
|
503
|
+
__privateSet$3(this, _menuRpcServices, menuRpcServices);
|
|
504
|
+
__privateSet$3(this, _pendingVisualLink, visualLink);
|
|
505
|
+
__privateSet$3(this, _rpcServices, rpcServices);
|
|
506
|
+
__privateSet$3(this, _sessionTables, sessionTables);
|
|
507
|
+
__privateSet$3(this, _table, table);
|
|
508
|
+
__privateSet$3(this, _visualLinkService, visualLinkService);
|
|
509
|
+
__privateSet$3(this, _getVisualLinks, getVisualLinks);
|
|
510
|
+
if (table) {
|
|
511
|
+
this.tableSchema = table.schema;
|
|
512
|
+
table.on("insert", this.insert);
|
|
513
|
+
table.on("update", this.updateRow);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
async subscribe(subscribeProps, callback) {
|
|
517
|
+
const subscription = super.subscribe(subscribeProps, callback);
|
|
518
|
+
if (__privateGet$4(this, _pendingVisualLink)) {
|
|
519
|
+
this.visualLink = __privateGet$4(this, _pendingVisualLink);
|
|
520
|
+
__privateSet$3(this, _pendingVisualLink, void 0);
|
|
521
|
+
}
|
|
522
|
+
return subscription;
|
|
523
|
+
}
|
|
524
|
+
unsubscribe() {
|
|
525
|
+
super.unsubscribe();
|
|
526
|
+
__privateSet$3(this, _table, void 0);
|
|
527
|
+
}
|
|
528
|
+
set range(range) {
|
|
529
|
+
super.range = range;
|
|
530
|
+
}
|
|
531
|
+
get range() {
|
|
532
|
+
return super.range;
|
|
533
|
+
}
|
|
534
|
+
set links(links) {
|
|
535
|
+
super.links = links;
|
|
536
|
+
}
|
|
537
|
+
get links() {
|
|
538
|
+
var _a;
|
|
539
|
+
return (_a = __privateGet$4(this, _getVisualLinks)) == null ? void 0 : _a.call(this, this.table.table);
|
|
540
|
+
}
|
|
541
|
+
getSelectedRowIds() {
|
|
542
|
+
return this.selectedRows.reduce(
|
|
543
|
+
(rowIds, selection) => {
|
|
544
|
+
if (Array.isArray(selection)) {
|
|
545
|
+
for (let i = selection[0]; i <= selection[1]; i++) {
|
|
546
|
+
const row = this.data[i];
|
|
547
|
+
if (row) {
|
|
548
|
+
rowIds.push(row[KEY]);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
} else {
|
|
552
|
+
const row = this.data[selection];
|
|
553
|
+
if (row) {
|
|
554
|
+
rowIds.push(row[KEY]);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return rowIds;
|
|
558
|
+
},
|
|
559
|
+
[]
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
applyEdit(rowKey, columnName, value) {
|
|
563
|
+
__privateGet$4(this, _table)?.update(rowKey, columnName, value);
|
|
564
|
+
return Promise.resolve(true);
|
|
565
|
+
}
|
|
566
|
+
async rpcCall(rpcRequest) {
|
|
567
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
568
|
+
const rpcService = __privateGet$4(this, _rpcServices)?.find(
|
|
569
|
+
(service) => service.rpcName === rpcRequest.rpcName
|
|
570
|
+
);
|
|
571
|
+
if (rpcService && vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
572
|
+
switch (rpcRequest.rpcName) {
|
|
573
|
+
case "VP_BULK_EDIT_COLUMN_CELLS_RPC": {
|
|
574
|
+
return rpcService.service({
|
|
575
|
+
...rpcRequest,
|
|
576
|
+
vpId: this.viewport
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return rpcService.service({
|
|
581
|
+
...rpcRequest,
|
|
582
|
+
namedParams: {
|
|
583
|
+
selectedRowIds: this.getSelectedRowIds(),
|
|
584
|
+
table: this.tableSchema.table
|
|
585
|
+
},
|
|
586
|
+
vpId: this.viewport
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
throw Error(`no implementation for PRC service ${rpcRequest.type}`);
|
|
591
|
+
}
|
|
592
|
+
async menuRpcCall(rpcRequest) {
|
|
593
|
+
const rpcService = __privateGet$4(this, _rpcServices)?.find(
|
|
594
|
+
(service) => service.rpcName === rpcRequest.rpcName
|
|
595
|
+
);
|
|
596
|
+
if (vuuUtils.isVuuMenuRpcRequest(rpcRequest)) {
|
|
597
|
+
return rpcService?.service({
|
|
598
|
+
...rpcRequest,
|
|
599
|
+
namedParams: {
|
|
600
|
+
selectedRowIds: this.getSelectedRowIds(),
|
|
601
|
+
table: this.tableSchema.table
|
|
602
|
+
},
|
|
603
|
+
vpId: this.viewport
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
return super.menuRpcCall(rpcRequest);
|
|
607
|
+
}
|
|
608
|
+
getTypeaheadSuggestions(column, pattern) {
|
|
609
|
+
if (__privateGet$4(this, _table)) {
|
|
610
|
+
return makeSuggestions(__privateGet$4(this, _table), column, pattern);
|
|
611
|
+
} else {
|
|
612
|
+
throw Error(
|
|
613
|
+
"cannot call getTypeaheadSuggestions on TickingDataSource if table has not been provided"
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
get visualLink() {
|
|
618
|
+
return this._config.visualLink;
|
|
619
|
+
}
|
|
620
|
+
set visualLink(visualLink) {
|
|
621
|
+
var _a, _b;
|
|
622
|
+
this._config = {
|
|
623
|
+
...this._config,
|
|
624
|
+
visualLink
|
|
625
|
+
};
|
|
626
|
+
if (visualLink) {
|
|
627
|
+
const {
|
|
628
|
+
parentClientVpId,
|
|
629
|
+
link: { fromColumn, toColumn }
|
|
630
|
+
} = visualLink;
|
|
631
|
+
if (this.viewport) {
|
|
632
|
+
(_a = __privateGet$4(this, _visualLinkService)) == null ? void 0 : _a.call(this, {
|
|
633
|
+
childVpId: this.viewport,
|
|
634
|
+
childColumnName: fromColumn,
|
|
635
|
+
type: "CREATE_VISUAL_LINK",
|
|
636
|
+
parentVpId: parentClientVpId,
|
|
637
|
+
parentColumnName: toColumn
|
|
638
|
+
}).then((response) => {
|
|
639
|
+
this.emit(
|
|
640
|
+
"visual-link-created",
|
|
641
|
+
response
|
|
642
|
+
);
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
} else {
|
|
646
|
+
(_b = __privateGet$4(this, _visualLinkService)) == null ? void 0 : _b.call(this, {
|
|
647
|
+
childVpId: this.viewport,
|
|
648
|
+
type: "REMOVE_VISUAL_LINK"
|
|
649
|
+
}).then(() => {
|
|
650
|
+
this.emit("visual-link-removed");
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
_menuRpcServices = new WeakMap();
|
|
656
|
+
_pendingVisualLink = new WeakMap();
|
|
657
|
+
_rpcServices = new WeakMap();
|
|
658
|
+
_sessionTables = new WeakMap();
|
|
659
|
+
_table = new WeakMap();
|
|
660
|
+
_selectionLinkSubscribers = new WeakMap();
|
|
661
|
+
_visualLinkService = new WeakMap();
|
|
662
|
+
_getVisualLinks = new WeakMap();
|
|
663
|
+
|
|
664
|
+
var __typeError$3 = (msg) => {
|
|
665
|
+
throw TypeError(msg);
|
|
666
|
+
};
|
|
667
|
+
var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
|
|
668
|
+
var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
669
|
+
var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
670
|
+
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
|
|
671
|
+
var _data, _dataMap, _indexOfKey, _index, _schema;
|
|
672
|
+
class Table extends vuuUtils.EventEmitter {
|
|
673
|
+
constructor(schema, data, dataMap, updateGenerator) {
|
|
674
|
+
super();
|
|
675
|
+
__privateAdd$3(this, _data);
|
|
676
|
+
__privateAdd$3(this, _dataMap);
|
|
677
|
+
__privateAdd$3(this, _indexOfKey);
|
|
678
|
+
__privateAdd$3(this, _index, /* @__PURE__ */ new Map());
|
|
679
|
+
__privateAdd$3(this, _schema);
|
|
680
|
+
__privateSet$2(this, _data, data);
|
|
681
|
+
__privateSet$2(this, _dataMap, dataMap);
|
|
682
|
+
__privateSet$2(this, _schema, schema);
|
|
683
|
+
__privateSet$2(this, _indexOfKey, dataMap[schema.key]);
|
|
684
|
+
this.buildIndex();
|
|
685
|
+
updateGenerator?.setTable(this);
|
|
686
|
+
updateGenerator?.setRange({ from: 0, to: 100 });
|
|
687
|
+
}
|
|
688
|
+
buildIndex() {
|
|
689
|
+
for (let i = 0; i < __privateGet$3(this, _data).length; i++) {
|
|
690
|
+
const key = __privateGet$3(this, _data)[i][__privateGet$3(this, _indexOfKey)];
|
|
691
|
+
__privateGet$3(this, _index).set(key, i);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
get data() {
|
|
695
|
+
return __privateGet$3(this, _data);
|
|
696
|
+
}
|
|
697
|
+
get map() {
|
|
698
|
+
return __privateGet$3(this, _dataMap);
|
|
699
|
+
}
|
|
700
|
+
get schema() {
|
|
701
|
+
return __privateGet$3(this, _schema);
|
|
702
|
+
}
|
|
703
|
+
insert(row) {
|
|
704
|
+
const index = __privateGet$3(this, _data).length;
|
|
705
|
+
__privateGet$3(this, _data).push(row);
|
|
706
|
+
const key = row[__privateGet$3(this, _indexOfKey)];
|
|
707
|
+
__privateGet$3(this, _index).set(key, index);
|
|
708
|
+
this.emit("insert", row);
|
|
709
|
+
}
|
|
710
|
+
findByKey(key) {
|
|
711
|
+
const index = __privateGet$3(this, _index).get(key) ?? -1;
|
|
712
|
+
return __privateGet$3(this, _data)[index];
|
|
713
|
+
}
|
|
714
|
+
update(key, columnName, value) {
|
|
715
|
+
const rowIndex = __privateGet$3(this, _data).findIndex(
|
|
716
|
+
(row) => row[__privateGet$3(this, _indexOfKey)] === key
|
|
717
|
+
);
|
|
718
|
+
const colIndex = __privateGet$3(this, _dataMap)[columnName];
|
|
719
|
+
if (rowIndex !== -1) {
|
|
720
|
+
const row = __privateGet$3(this, _data)[rowIndex];
|
|
721
|
+
const newRow = row.slice();
|
|
722
|
+
newRow[colIndex] = value;
|
|
723
|
+
__privateGet$3(this, _data)[rowIndex] = newRow;
|
|
724
|
+
this.emit("update", newRow, columnName);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
updateRow(row) {
|
|
728
|
+
const key = row[__privateGet$3(this, _indexOfKey)];
|
|
729
|
+
const rowIndex = __privateGet$3(this, _data).findIndex(
|
|
730
|
+
(row2) => row2[__privateGet$3(this, _indexOfKey)] === key
|
|
731
|
+
);
|
|
732
|
+
if (rowIndex !== -1) {
|
|
733
|
+
__privateGet$3(this, _data)[rowIndex] = row;
|
|
734
|
+
this.emit("update", row);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
_data = new WeakMap();
|
|
739
|
+
_dataMap = new WeakMap();
|
|
740
|
+
_indexOfKey = new WeakMap();
|
|
741
|
+
_index = new WeakMap();
|
|
742
|
+
_schema = new WeakMap();
|
|
743
|
+
function buildDataColumnMapFromSchema(schema) {
|
|
744
|
+
return Object.values(schema.columns).reduce(
|
|
745
|
+
(map, col, index) => ({
|
|
746
|
+
...map,
|
|
747
|
+
[col.name]: index
|
|
748
|
+
}),
|
|
749
|
+
{}
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
function buildDataColumnMap$1(schemas, tableName) {
|
|
753
|
+
return buildDataColumnMapFromSchema(schemas[tableName]);
|
|
754
|
+
}
|
|
755
|
+
const getServerDataType = (columnName, { columns: cols1, table: t1 }, { columns: cols2, table: t2 }) => {
|
|
756
|
+
const col1 = cols1.find((col) => col.name === columnName);
|
|
757
|
+
const col2 = cols2.find((col) => col.name === columnName);
|
|
758
|
+
if (col1 && col2) {
|
|
759
|
+
if (col1.serverDataType === col2.serverDataType) {
|
|
760
|
+
return col1.serverDataType;
|
|
761
|
+
} else {
|
|
762
|
+
throw Error(
|
|
763
|
+
`both tables ${t1.table} and ${t2.table} implement column ${columnName}, but with types differ`
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
} else if (col1) {
|
|
767
|
+
return col1.serverDataType;
|
|
768
|
+
} else if (col2) {
|
|
769
|
+
return col2.serverDataType;
|
|
770
|
+
} else {
|
|
771
|
+
throw Error(`WTF how is this possible`);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
const joinTables = (joinTable, table1, table2, joinColumn) => {
|
|
775
|
+
const { map: m1, schema: schema1 } = table1;
|
|
776
|
+
const { map: m2, schema: schema2 } = table2;
|
|
777
|
+
const k1 = m1[joinColumn];
|
|
778
|
+
const k2 = m2[joinColumn];
|
|
779
|
+
const combinedColumns = new Set(
|
|
780
|
+
[...schema1.columns, ...schema2.columns].map((col) => col.name).sort()
|
|
781
|
+
);
|
|
782
|
+
const combinedSchema = {
|
|
783
|
+
key: joinColumn,
|
|
784
|
+
table: joinTable,
|
|
785
|
+
columns: Array.from(combinedColumns).map((columnName) => ({
|
|
786
|
+
name: columnName,
|
|
787
|
+
serverDataType: getServerDataType(columnName, schema1, schema2)
|
|
788
|
+
}))
|
|
789
|
+
};
|
|
790
|
+
const data = [];
|
|
791
|
+
const combinedColumnMap = buildDataColumnMapFromSchema(combinedSchema);
|
|
792
|
+
for (const row of table1.data) {
|
|
793
|
+
const row2 = table2.findByKey(String(row[k1]));
|
|
794
|
+
if (row2) {
|
|
795
|
+
const out = [];
|
|
796
|
+
for (const column of table1.schema.columns) {
|
|
797
|
+
const value = row[m1[column.name]];
|
|
798
|
+
out[combinedColumnMap[column.name]] = value;
|
|
799
|
+
}
|
|
800
|
+
for (const column of table2.schema.columns) {
|
|
801
|
+
const value = row2[m2[column.name]];
|
|
802
|
+
out[combinedColumnMap[column.name]] = value;
|
|
803
|
+
}
|
|
804
|
+
data.push(out);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
const newTable = new Table(combinedSchema, data, combinedColumnMap);
|
|
808
|
+
table1.on("insert", (row) => {
|
|
809
|
+
const row2 = table2.findByKey(String(row[k1]));
|
|
810
|
+
if (row2) {
|
|
811
|
+
const out = [];
|
|
812
|
+
for (const column of table1.schema.columns) {
|
|
813
|
+
const value = row[m1[column.name]];
|
|
814
|
+
out[combinedColumnMap[column.name]] = value;
|
|
815
|
+
}
|
|
816
|
+
for (const column of table2.schema.columns) {
|
|
817
|
+
const value = row2[m2[column.name]];
|
|
818
|
+
out[combinedColumnMap[column.name]] = value;
|
|
819
|
+
}
|
|
820
|
+
newTable.insert(out);
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
table2.on("update", (row) => {
|
|
824
|
+
const keyValue = row[k2];
|
|
825
|
+
const targetRow = newTable.findByKey(keyValue);
|
|
826
|
+
if (targetRow) {
|
|
827
|
+
const updatedRow = targetRow.slice();
|
|
828
|
+
for (const { name } of table2.schema.columns) {
|
|
829
|
+
if (row[m2[name]] !== updatedRow[combinedColumnMap[name]]) {
|
|
830
|
+
updatedRow[combinedColumnMap[name]] = row[m2[name]];
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
newTable.updateRow(updatedRow);
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
return newTable;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
function random(min, max) {
|
|
840
|
+
min = Math.ceil(min);
|
|
841
|
+
max = Math.floor(max);
|
|
842
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
843
|
+
}
|
|
844
|
+
const nextRandomDouble = (min, max) => min + (max - min) * Math.random();
|
|
845
|
+
const initBidAsk = (priceMaxDelta, nextRandomDouble2) => {
|
|
846
|
+
const mid = nextRandomDouble2(0, 1e3);
|
|
847
|
+
const tempBid = nextRandomDouble2(mid - priceMaxDelta, mid - 1);
|
|
848
|
+
const ask = nextRandomDouble2(mid + 1, mid + priceMaxDelta);
|
|
849
|
+
const bid = tempBid < 0 ? mid : tempBid;
|
|
850
|
+
const newBid = Math.round(bid * 100) / 100;
|
|
851
|
+
const newAsk = Math.round(ask * 100) / 100;
|
|
852
|
+
return [newBid, newAsk];
|
|
853
|
+
};
|
|
854
|
+
const maxAsk = (bid, ask, spreadMultipler, priceMaxDelta) => {
|
|
855
|
+
const spread = ask - bid;
|
|
856
|
+
return Math.min(
|
|
857
|
+
ask + spreadMultipler * spread,
|
|
858
|
+
spread / 2 + bid + priceMaxDelta
|
|
859
|
+
);
|
|
860
|
+
};
|
|
861
|
+
const minAsk = (bid, ask) => {
|
|
862
|
+
return Math.max(bid + 1, (ask - bid) / 2 + bid);
|
|
863
|
+
};
|
|
864
|
+
const maxBid = (bid, ask) => {
|
|
865
|
+
const result = Math.min(ask - 1, (ask - bid) / 2 + bid);
|
|
866
|
+
return result < 1 ? bid + 1 : result;
|
|
867
|
+
};
|
|
868
|
+
const minBid = (bid, ask, spreadMultipler, priceMaxDelta) => {
|
|
869
|
+
const spread = ask - bid;
|
|
870
|
+
const mid = spread / 2 + bid;
|
|
871
|
+
const result = Math.max(
|
|
872
|
+
bid - Math.min(spreadMultipler * spread, 10),
|
|
873
|
+
mid - priceMaxDelta
|
|
874
|
+
);
|
|
875
|
+
return result < 0 ? bid : result;
|
|
876
|
+
};
|
|
877
|
+
const generateNextBidAsk = (bid, ask, spreadMultipler, priceMaxDelta, nextRandomDouble2) => {
|
|
878
|
+
let tempAsk = ask;
|
|
879
|
+
if (Math.abs(bid - ask) <= 1) tempAsk = ask + 1;
|
|
880
|
+
const minBidValue = minBid(bid, tempAsk, spreadMultipler, priceMaxDelta);
|
|
881
|
+
const maxBidValue = maxBid(bid, tempAsk);
|
|
882
|
+
const minAskValue = minAsk(bid, tempAsk);
|
|
883
|
+
const maxAskValue = maxAsk(bid, tempAsk, spreadMultipler, priceMaxDelta);
|
|
884
|
+
const newBid = Math.round(nextRandomDouble2(minBidValue, maxBidValue) * 100) / 100;
|
|
885
|
+
const newAsk = Math.round(nextRandomDouble2(minAskValue, maxAskValue) * 100) / 100;
|
|
886
|
+
return [newBid, newAsk];
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
var __defProp$2 = Object.defineProperty;
|
|
890
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
891
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
892
|
+
const getNewValue = (value) => {
|
|
893
|
+
const multiplier = random(0, 100) / 1e3;
|
|
894
|
+
const direction = random(0, 10) >= 5 ? 1 : -1;
|
|
895
|
+
return value + value * multiplier * direction;
|
|
896
|
+
};
|
|
897
|
+
class BaseUpdateGenerator {
|
|
898
|
+
constructor(tickingColumns) {
|
|
899
|
+
__publicField$2(this, "table");
|
|
900
|
+
__publicField$2(this, "range");
|
|
901
|
+
__publicField$2(this, "updating", false);
|
|
902
|
+
__publicField$2(this, "timer");
|
|
903
|
+
__publicField$2(this, "tickingColumns");
|
|
904
|
+
__publicField$2(this, "update", () => {
|
|
905
|
+
if (this.range && this.table) {
|
|
906
|
+
const data = this.table?.data;
|
|
907
|
+
const { bid, ask, last, ...rest } = this.tickingColumns;
|
|
908
|
+
if (data && data?.length > 0) {
|
|
909
|
+
const maxRange = Math.min(this.range.to, data.length);
|
|
910
|
+
for (let rowIndex = this.range.from; rowIndex < maxRange; rowIndex++) {
|
|
911
|
+
let updateCount = 0;
|
|
912
|
+
const shallUpdateRow = random(0, 10) < 2;
|
|
913
|
+
if (shallUpdateRow) {
|
|
914
|
+
const rowUpdates = this.table.data[rowIndex];
|
|
915
|
+
const row = data[rowIndex];
|
|
916
|
+
if (bid !== void 0 && ask !== void 0) {
|
|
917
|
+
const { [bid]: currentBid, [ask]: currentAsk } = row;
|
|
918
|
+
const [newBid, newAsk] = generateNextBidAsk(
|
|
919
|
+
currentBid,
|
|
920
|
+
currentAsk,
|
|
921
|
+
10,
|
|
922
|
+
5,
|
|
923
|
+
nextRandomDouble
|
|
924
|
+
);
|
|
925
|
+
rowUpdates[ask] = newAsk;
|
|
926
|
+
rowUpdates[bid] = newBid;
|
|
927
|
+
if (last !== void 0) {
|
|
928
|
+
const newLast = Math.round((currentAsk + (newAsk - currentAsk) / 2) * 100) / 100;
|
|
929
|
+
rowUpdates[last] = newLast;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
for (const colIdx of Object.values(rest)) {
|
|
933
|
+
const shallUpdateColumn = random(0, 10) < 5;
|
|
934
|
+
if (shallUpdateColumn) {
|
|
935
|
+
updateCount += 1;
|
|
936
|
+
const newValue = getNewValue(row[colIdx]);
|
|
937
|
+
if (this.table) {
|
|
938
|
+
rowUpdates[colIdx] = newValue;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
if (this.table && updateCount > 0) {
|
|
943
|
+
this.table.updateRow(rowUpdates);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
if (this.updating) {
|
|
950
|
+
this.timer = window.setTimeout(this.update, 500);
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
this.tickingColumns = tickingColumns;
|
|
954
|
+
}
|
|
955
|
+
setRange(range) {
|
|
956
|
+
this.range = range;
|
|
957
|
+
if (!this.updating && this.table) {
|
|
958
|
+
this.startUpdating();
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
setTable(table) {
|
|
962
|
+
this.table = table;
|
|
963
|
+
}
|
|
964
|
+
startUpdating() {
|
|
965
|
+
this.updating = true;
|
|
966
|
+
this.update();
|
|
967
|
+
}
|
|
968
|
+
stopUpdating() {
|
|
969
|
+
this.updating = false;
|
|
970
|
+
if (this.timer) {
|
|
971
|
+
window.clearTimeout(this.timer);
|
|
972
|
+
this.timer = void 0;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
var ftse = [
|
|
978
|
+
["AAL.L", "Anglo American PLC", "436.35 13:13", "5.35 (1.24%)", "5,799,089"],
|
|
979
|
+
["ABF.L", "Associated British Foods PLC", "3,435.60 13:12", "7.40 (0.21%)", "86,808"],
|
|
980
|
+
["ADM.L", "Admiral Group PLC", "1,627.00 13:13", ""],
|
|
981
|
+
["ADN.L", "Aberdeen Asset Management PLC", "334.00 13:13", "2.50 (0.75%)", "806,880"],
|
|
982
|
+
["AHT.L", "Ashtead Group PLC", "1,027.00 13:13", "6.00 (0.59%)", "331,255"],
|
|
983
|
+
["ANTO.L", "Antofagasta PLC", "484.10 13:13", "11.70 (2.48%)", "1,753,976"],
|
|
984
|
+
["ARM.L", "ARM Holdings PLC", "1,058.00 13:13", "3.00 (0.28%)", "475,927"],
|
|
985
|
+
["AV.L", "Aviva PLC", "493.97 13:13", "2.23 (0.45%)", "2,226,835"],
|
|
986
|
+
["AZN.L", "AstraZeneca PLC", "4,399.50 13:13", "2.50 (0.06%)", "815,133"],
|
|
987
|
+
["BA.L", "BAE Systems PLC", "478.10 13:13", "4.30 (0.91%)", "2,039,934"],
|
|
988
|
+
["BAB.L", "Babcock International Group PLC", "988.00 13:13", "9.50 (0.97%)", "209,614"],
|
|
989
|
+
["BARC.L", "Barclays PLC", "226.30 13:13", "1.15 (0.51%)", "6,575,664"],
|
|
990
|
+
["BATS.L", "British American Tobacco PLC", "3,803.50 13:13", "8.50 (0.22%)", "465,110"],
|
|
991
|
+
["BDEV.L", "Barratt Developments PLC", "576.00 13:13", "0.50 (0.09%)", "1,044,365"],
|
|
992
|
+
["BG.L", "BG Group PLC", "1,013.50 13:13", "5.50 (0.55%)", "1,507,332"],
|
|
993
|
+
["BKG.L", "Berkeley Group Holdings (The) PLC", "3,126.00 13:13", "15.00 (0.48%)", "95,071"],
|
|
994
|
+
["BLND.L", "British Land Co PLC", "828.06 13:12", "10.44 (1.25%)", "1,802,548"],
|
|
995
|
+
["BLT.L", "BHP Billiton PLC", "881.40 13:13", "4.30 (0.49%)", "4,947,287"],
|
|
996
|
+
["BNZL.L", "Bunzl PLC", "1,875.40 13:05", "4.60 (0.24%)", "104,541"],
|
|
997
|
+
["BP.L", "BP PLC", "381.50 13:13", "2.95 (0.78%)", "10,493,561"],
|
|
998
|
+
["BRBY.L", "Burberry Group PLC", "1,269.00 13:13", "7.00 (0.55%)", "295,647"],
|
|
999
|
+
["BT-A", "L,BT Group PLC", "489.20 13:13", "3.70 (0.75%)", "3,914,982"],
|
|
1000
|
+
["CCL.L", "Carnival PLC", "3,426.00 13:12", "22.00 (0.64%)", "86,257"],
|
|
1001
|
+
["CNA.L", "Centrica PLC", "212.80 13:13", "0.60 (0.28%)", "2,144,540"],
|
|
1002
|
+
["CPG.L", "Compass Group PLC", "1,054.00 13:08", "5.00 (0.48%)", "1,001,167"],
|
|
1003
|
+
["CPI.L", "Capita PLC", "1,235.00 13:11", "1.00 (0.08%)", "244,591"],
|
|
1004
|
+
["CRH.L", "CRH PLC", "1,783.20 13:12", "17.80 (0.99%)", "897,325"],
|
|
1005
|
+
["DC.L", "DIXONS CARPHONE", "462.10 13:11", ""],
|
|
1006
|
+
["DGE.L", "Diageo PLC", "1,881.50 13:13", "6.50 (0.34%)", "756,906"],
|
|
1007
|
+
["DLG.L", "Direct Line Insurance Group PLC", "403.80 13:13", "0.40 (0.10%)", "1,095,340"],
|
|
1008
|
+
["EXPN.L", "Experian PLC", "1,191.00 13:12", "2.00 (0.17%)", "467,283"],
|
|
1009
|
+
["EZJ.L", "easyJet PLC", "1,682.00 13:12", "28.00 (1.64%)", "1,191,230"],
|
|
1010
|
+
["FRES.L", "Fresnillo PLC", "678.50 13:12", "6.50 (0.97%)", "381,871"],
|
|
1011
|
+
["GFS.L", "G4S PLC", "232.30 13:03", "2.00 (0.85%)", "1,096,551"],
|
|
1012
|
+
["GKN.L", "GKN PLC", "294.80 13:12", "2.50 (0.86%)", "792,247"],
|
|
1013
|
+
["GLEN.L", "Glencore PLC", "90.48 13:13", "1.65 (1.86%)", "41,631,528"],
|
|
1014
|
+
["GSK.L", "GlaxoSmithKline PLC", "1,345.00 13:13", "0.50 (0.04%)", "1,767,356"],
|
|
1015
|
+
["HIK.L", "Hikma Pharmaceuticals PLC", "2,010.00 13:04", "57.00 (2.92%)", "261,511"],
|
|
1016
|
+
["HL.L", "Hargreaves Lansdown PLC", "1,488.03 13:12", "9.97 (0.67%)", "372,261"],
|
|
1017
|
+
["HMSO.L", "Hammerson PLC", "597.50 13:11", "3.50 (0.58%)", "478,301"],
|
|
1018
|
+
["HSBA.L", "HSBC Holdings PLC", "519.70 13:13", "0.50 (0.10%)", "7,415,629"],
|
|
1019
|
+
["IAG.L", "International Consolidated Airlines Group SA", "575.40 13:12", "16.10 (2.72%)", "4,311,514"],
|
|
1020
|
+
["IHG.L", "InterContinental Hotels Group PLC", "2,481.00 13:12", "19.00 (0.76%)", "219,918"],
|
|
1021
|
+
["III.L", "3i Group PLC", "487.30 13:11", "4.50 (0.92%)", "189,987"],
|
|
1022
|
+
["IMT.L", "Imperial Tobacco Group PLC", "3,571.00 13:13", "29.00 (0.81%)", "926,816"],
|
|
1023
|
+
["INTU.L", "intu properties PLC", "319.90 13:09", "4.60 (1.42%)", "514,821"],
|
|
1024
|
+
["ISAT.L", "Inmarsat PLC", "1,054.44 13:13", "3.44 (0.33%)", "988,089"],
|
|
1025
|
+
["ITRK.L", "Intertek Group PLC", "2,643.00 13:14", "3.00 (0.11%)", "45,868"],
|
|
1026
|
+
["ITV.L", "ITV PLC", "267.30 13:14", "2.60 (0.96%)", "3,453,208"],
|
|
1027
|
+
["JMAT.L", "Johnson Matthey PLC", "2,445.00 13:14", "29.00 (1.20%)", "276,397"],
|
|
1028
|
+
["KGF.L", "Kingfisher PLC", "346.20 13:14", "4.30 (1.23%)", "1,021,408"],
|
|
1029
|
+
["LAND.L", "Land Securities Group PLC", "1,239.00 13:13", "7.00 (0.56%)", "384,973"],
|
|
1030
|
+
["LGEN.L", "Legal & General Group PLC", "266.00 13:14", "1.60 (0.60%)", "1,998,399"],
|
|
1031
|
+
["LLOY.L", "Lloyds Banking Group PLC", "73.86 13:14", "0.02 (0.03%)", "18,907,878"],
|
|
1032
|
+
["LSE.L", "London Stock Exchange Group PLC", "2,544.00 13:11", "6.00 (0.24%)", "129,657"],
|
|
1033
|
+
["MGGT.L", "Meggitt PLC", "386.00 13:15", "3.20 (0.84%)", "611,044"],
|
|
1034
|
+
["MKS.L", "Marks & Spencer Group PLC", "514.75 13:12", "3.25 (0.63%)", "920,128"],
|
|
1035
|
+
["MNDI.L", "Mondi PLC", "1,463.00 13:14", "7.00 (0.48%)", "383,546"],
|
|
1036
|
+
["MRW.L", "Morrison (Wm) Supermarkets PLC", "155.20 13:14", ""],
|
|
1037
|
+
["NG.L", "National Grid PLC", "926.40 13:14", "1.10 (0.12%)", "1,659,592"],
|
|
1038
|
+
["NXT.L", "Next PLC", "7,765.00 13:11", "95.00 (1.21%)", "114,062"],
|
|
1039
|
+
["OML.L", "Old Mutual PLC", "198.50 13:14", "0.40 (0.20%)", "2,040,849"],
|
|
1040
|
+
["PRU.L", "Prudential PLC", "1,499.50 13:15", "14.00 (0.93%)", "580,870"],
|
|
1041
|
+
["PSON.L", "Pearson PLC", "794.00 13:09", "5.00 (0.63%)", "1,177,953"],
|
|
1042
|
+
["RB.L", "Reckitt Benckiser Group PLC", "6,293.00 13:14", "34.00 (0.54%)", "281,172"],
|
|
1043
|
+
["RBS.L", "Royal Bank of Scotland Group PLC", "313.40 13:14", "2.40 (0.77%)", "2,100,058"],
|
|
1044
|
+
["RDSA.L", "Royal Dutch Shell PLC", "1,636.00 13:14", "18.00 (1.11%)", "2,467,461"],
|
|
1045
|
+
["RDSB.L", "Royal Dutch Shell PLC", "1,652.00 13:15", "14.50 (0.89%)", "1,457,434"],
|
|
1046
|
+
["REL.L", "Reed Elsevier PLC", "1,170.00 13:14", "0.00 (0.00%)", "908,802"],
|
|
1047
|
+
["RIO.L", "Rio Tinto PLC", "2,235.00 13:15", "21.00 (0.95%)", "2,190,722"],
|
|
1048
|
+
["RMG.L", "Royal Mail PLC", "453.50 13:14", "1.20 (0.26%)", "995,316"],
|
|
1049
|
+
["RR.L", "Rolls-Royce Group PLC", "546.63 13:14", "8.38 (1.51%)", "2,792,915"],
|
|
1050
|
+
["RRS.L", "Randgold Resources Ltd", "3,929.00 13:14", "0.00 (0.00%)", "135,524"],
|
|
1051
|
+
["RSA.L", "RSA Insurance Group PLC", "437.10 13:14", "0.10 (0.02%)", "395,477"],
|
|
1052
|
+
["SAB.L", "SABMiller PLC", "4,011.00 13:15", "1.00 (0.02%)", "892,451"],
|
|
1053
|
+
["SBRY.L", "Sainsbury (J) PLC", "255.80 13:14", "7.40 (2.98%)", "2,395,670"],
|
|
1054
|
+
["SDR.L", "Schroders PLC", "2,930.00 13:09", "12.00 (0.41%)", "44,674"],
|
|
1055
|
+
["SGE.L", "Sage Group (The) PLC", "545.50 13:13", "0.50 (0.09%)", "539,717"],
|
|
1056
|
+
["SHP.L", "Shire PLC", "4,685.00 13:14", "22.00 (0.47%)", "221,318"],
|
|
1057
|
+
["SKY.L", "SKY", "1,095.00 13:12", "4.00 (0.37%)", "925,016"],
|
|
1058
|
+
["SL.L", "Standard Life PLC", "399.90 13:14", "3.20 (0.79%)", "861,636"],
|
|
1059
|
+
["SMIN.L", "Smiths Group PLC", "992.50 13:14", "27.50 (2.70%)", "640,309"],
|
|
1060
|
+
["SN.L", "Smith & Nephew PLC", "1,110.00 13:14", "9.00 (0.82%)", "480,018"],
|
|
1061
|
+
["SPD.L", "Sports Direct International PLC", "694.50 13:11", "1.50 (0.22%)", "157,981"],
|
|
1062
|
+
["SSE.L", "SSE PLC", "1,463.00 13:13", "2.00 (0.14%)", "562,454"],
|
|
1063
|
+
["STAN.L", "Standard Chartered PLC", "583.00 13:14", "0.60 (0.10%)", "2,018,697"],
|
|
1064
|
+
["STJ.L", "St James's Place PLC", "964.00 13:14", "11.00 (1.13%)", "418,480"],
|
|
1065
|
+
["SVT.L", "Severn Trent PLC", "2,199.00 13:12", "1.00 (0.05%)", "95,342"],
|
|
1066
|
+
["TPK.L", "Travis Perkins PLC", "1,945.00 13:13", "4.00 (0.21%)", "92,916"],
|
|
1067
|
+
["TSCO.L", "Tesco PLC", "171.54 13:14", "2.54 (1.50%)", "9,831,136"],
|
|
1068
|
+
["TUI.L", "TUI AG", "1,115.00 13:10", "5.00 (0.45%)", "458,970"],
|
|
1069
|
+
["TW.L", "Taylor Wimpey PLC", "183.90 13:15", "1.10 (0.59%)", "3,180,729"],
|
|
1070
|
+
["ULVR.L", "Unilever PLC", "2,791.00 13:14", "29.00 (1.03%)", "824,827"],
|
|
1071
|
+
["UU.L", "United Utilities Group PLC", "959.00 13:10", "2.50 (0.26%)", "436,911"],
|
|
1072
|
+
["VOD.L", "Vodafone Group PLC", "224.25 13:15", "1.30 (0.58%)", "17,572,036"],
|
|
1073
|
+
["WOS.L", "Wolseley PLC", "3,657.00 13:14", "4.00 (0.11%)", "179,536"],
|
|
1074
|
+
["WPP.L", "WPP PLC", "1,502.00 13:15", "12.00 (0.79%)", "857,887"],
|
|
1075
|
+
["WTB.L", "Whitbread PLC", "4,484.00 13:16", "60.00 (1.32%)", "141,036"]
|
|
1076
|
+
];
|
|
1077
|
+
|
|
1078
|
+
var nasdaq = [
|
|
1079
|
+
["Apple Inc", "AAPL", 11.007, 174.94, 0.15, "(0.09%)"],
|
|
1080
|
+
["Microsoft Corp", "MSFT", 9.61, 316.98, -0.03, "(-0.01%)"],
|
|
1081
|
+
["Amazon.com Inc", "AMZN", 5.401, 129.31, 0.19, "(0.14%)"],
|
|
1082
|
+
["NVIDIA Corp", "NVDA", 4.101, 415.74, -0.36, "(-0.09%)"],
|
|
1083
|
+
["Meta Platforms Inc", "META", 3.729, 299.42, 0.34, "(0.11%)"],
|
|
1084
|
+
["Tesla Inc", "TSLA", 3.285, 244.13, -0.75, "(-0.31%)"],
|
|
1085
|
+
["Alphabet Inc", "GOOGL", 3.133, 130.49, 0.24, "(0.18%)"],
|
|
1086
|
+
["Alphabet Inc", "GOOG", 3.085, 131.49, 0.24, "(0.18%)"],
|
|
1087
|
+
["Broadcom Inc", "AVGO", 2.896, 833.04, 3.96, "(0.48%)"],
|
|
1088
|
+
["Costco Wholesale Corp", "COST", 2.137, 557.85, -0.74, "(-0.13%)"],
|
|
1089
|
+
["PepsiCo Inc", "PEP", 2.096, 174.84, -0.43, "(-0.25%)"],
|
|
1090
|
+
["Adobe Inc", "ADBE", 2.033, 511.42, -1.48, "(-0.29%)"],
|
|
1091
|
+
["Cisco Systems Inc", "CSCO", 1.887, 53.68, 0.11, "(0.20%)"],
|
|
1092
|
+
["Comcast Corp", "CMCSA", 1.633, 45.3, -0.01, "(-0.01%)"],
|
|
1093
|
+
["Netflix Inc", "NFLX", 1.478, 379.89, 0.08, "(0.02%)"],
|
|
1094
|
+
["T-Mobile US Inc", "TMUS", 1.43, 140.18, 0.83, "(0.60%)"],
|
|
1095
|
+
["Advanced Micro Devices Inc", "AMD", 1.348, 96.09, -0.11, "(-0.12%)"],
|
|
1096
|
+
["Texas Instruments Inc", "TXN", 1.264, 161, 0.69, "(0.43%)"],
|
|
1097
|
+
["Intel Corp", "INTC", 1.26, 34.19, 0.01, "(0.01%)"],
|
|
1098
|
+
["Amgen Inc", "AMGN", 1.251, 271.18, 3.48, "(1.30%)"],
|
|
1099
|
+
["Intuit Inc", "INTU", 1.226, 509, 0.43, "(0.08%)"],
|
|
1100
|
+
["Honeywell International Inc", "HON", 1.103, 188.67, -1.12, "(-0.59%)"],
|
|
1101
|
+
["QUALCOMM Inc", "QCOM", 1.046, 107.53, -0.16, "(-0.14%)"],
|
|
1102
|
+
["Applied Materials Inc", "AMAT", 0.982, 136.32, 0.15, "(0.11%)"],
|
|
1103
|
+
["Booking Holdings Inc", "BKNG", 0.941, 3, 19.2, -43.3, "(-1.42%)"],
|
|
1104
|
+
["Starbucks Corp", "SBUX", 0.926, 93.8, 0.12, "(0.12%)"],
|
|
1105
|
+
["Intuitive Surgical Inc", "ISRG", 0.867, 288.5, 0.3, "(0.10%)"],
|
|
1106
|
+
["Automatic Data Processing Inc", "ADP", 0.854, 239.45, 0.1, "(0.04%)"],
|
|
1107
|
+
["Mondelez International Inc", "MDLZ", 0.835, 71.25, 0.82, "(1.16%)"],
|
|
1108
|
+
["Gilead Sciences Inc", "GILD", 0.814, 75.47, 0.46, "(0.61%)"],
|
|
1109
|
+
["Vertex Pharmaceuticals Inc", "VRTX", 0.794, 353.67, 4.14, "(1.18%)"],
|
|
1110
|
+
["Regeneron Pharmaceuticals Inc", "REGN", 0.763, 828.09, 3.25, "(0.39%)"],
|
|
1111
|
+
["Analog Devices Inc", "ADI", 0.752, 176.82, 1.34, "(0.76%)"],
|
|
1112
|
+
["Lam Research Corp", "LRCX", 0.702, 620, 0.89, "(0.14%)"],
|
|
1113
|
+
["Micron Technology Inc", "MU", 0.646, 68.9, 0.02, "(0.03%)"],
|
|
1114
|
+
["Palo Alto Networks Inc", "PANW", 0.604, 228.7, 0.19, "(0.08%)"],
|
|
1115
|
+
["Synopsys Inc", "SNPS", 0.587, 447.12, 0.27, "(0.06%)"],
|
|
1116
|
+
["Charter Communications Inc", "CHTR", 0.581, 441.88, -3.33, "(-0.75%)"],
|
|
1117
|
+
["MercadoLibre Inc", "MELI", 0.562, 1, 275.5, -1.47, "(-0.11%)"],
|
|
1118
|
+
["PayPal Holdings Inc", "PYPL", 0.559, 57.9, 0.02, "(0.03%)"],
|
|
1119
|
+
["CSX Corp", "CSX", 0.54, 31.23, 0.03, "(0.09%)"],
|
|
1120
|
+
["Cadence Design Systems Inc", "CDNS", 0.539, 230.83, 0.17, "(0.07%)"],
|
|
1121
|
+
["KLA Corp", "KLAC", 0.53, 456.11, 4.29, "(0.95%)"],
|
|
1122
|
+
["PDD Holdings Inc ADR", "PDD", 0.521, 95.93, -0.01, "(-0.01%)"],
|
|
1123
|
+
["Marriott International Inc/MD", "MAR", 0.505, 193.9, -0.46, "(-0.23%)"],
|
|
1124
|
+
["Monster Beverage Corp", "MNST", 0.498, 54.48, -0.04, "(-0.08%)"],
|
|
1125
|
+
["Airbnb Inc", "ABNB", 0.491, 132.09, -0.11, "(-0.08%)"],
|
|
1126
|
+
["O'Reilly Automotive Inc", "ORLY", 0.485, 936.67, 0.65, "(0.07%)"],
|
|
1127
|
+
["Cintas Corp", "CTAS", 0.446, 505.27, 0.52, "(0.10%)"],
|
|
1128
|
+
["ASML Holding NV", "ASML", 0.438, 585, -2.1, "(-0.36%)"],
|
|
1129
|
+
["NXP Semiconductors NV", "NXPI", 0.434, 196.76, -0.04, "(-0.02%)"],
|
|
1130
|
+
["Workday Inc", "WDAY", 0.414, 235.55, 4.73, "(2.05%)"],
|
|
1131
|
+
["Lululemon Athletica Inc", "LULU", 0.405, 386.36, -1.69, "(-0.44%)"],
|
|
1132
|
+
["Keurig Dr Pepper Inc,KDP", 0.404, 33.25, 0.13, "(0.39%)"],
|
|
1133
|
+
["Fortinet Inc", "FTNT", 0.401, 58.29, 0.05, "(0.09%)"],
|
|
1134
|
+
["Marvell Technology Inc", "MRVL", 0.388, 52.38, 0.08, "(0.14%)"],
|
|
1135
|
+
["PACCAR Inc", "PCAR", 0.38, 84.97, 0.04, "(0.04%)"],
|
|
1136
|
+
["Old Dominion Freight Line Inc", "ODFL", 0.38, 401.01, 0.35, "(0.09%)"],
|
|
1137
|
+
["Autodesk Inc", "ADSK", 0.379, 204.07, 0.03, "(0.01%)"],
|
|
1138
|
+
["Kraft Heinz Co/The", "KHC", 0.368, 34.27, 0.11, "(0.31%)"],
|
|
1139
|
+
["Microchip Technology Inc", "MCHP", 0.36, 77, -0.08, "(-0.10%)"],
|
|
1140
|
+
["Copart Inc", "CPRT", 0.358, 43.26, 0.1, "(0.22%)"],
|
|
1141
|
+
["American Electric Power Co Inc", "AEP", 0.357, 79.23, 0.06, "(0.08%)"],
|
|
1142
|
+
["Paychex Inc", "PAYX", 0.355, 113.01, 0.06, "(0.06%)"],
|
|
1143
|
+
["Exelon Corp", "EXC", 0.35, 40.28, 0.07, "(0.16%)"],
|
|
1144
|
+
["ON Semiconductor Corp", "ON", 0.341, 93.87, 0.06, "(0.06%)"],
|
|
1145
|
+
["AstraZeneca PLC ADR", "AZN", 0.339, 67.35, -0.49, "(-0.72%)"],
|
|
1146
|
+
["Seagen Inc", "SGEN", 0.336, 212.18, -1.52, "(-0.71%)"],
|
|
1147
|
+
["Ross Stores Inc", "ROST", 0.335, 111.71, 0.05, "(0.04%)"],
|
|
1148
|
+
["Moderna Inc", "MRNA", 0.331, 100.32, 0.33, "(0.33%)"],
|
|
1149
|
+
["Biogen Inc", "BIIB", 0.326, 257.93, 0.25, "(0.10%)"],
|
|
1150
|
+
["Crowdstrike Holdings Inc", "CRWD", 0.319, 162.85, 0.28, "(0.17%)"],
|
|
1151
|
+
["IDEXX Laboratories Inc", "IDXX", 0.316, 439.41, 3.72, "(0.85%)"],
|
|
1152
|
+
["Baker Hughes Co", "BKR", 0.307, 35.44, 0.04, "(0.10%)"],
|
|
1153
|
+
["Constellation Energy Corp", "CEG", 0.307, 110.41, 0.05, "(0.04%)"],
|
|
1154
|
+
["Cognizant Technology Solutions Corp", "CTSH", 0.303, 70.19, 0.58, "(0.83%)"],
|
|
1155
|
+
["Verisk Analytics Inc", "VRSK", 0.303, 242.05, 0.1, "(0.04%)"],
|
|
1156
|
+
["Dexcom Inc", "DXCM", 0.3, 88.3, 0.8, "(0.92%)"],
|
|
1157
|
+
["Trade Desk Inc/The", "TTD", 0.293, 76.38, 0.03, "(0.03%)"],
|
|
1158
|
+
["Xcel Energy Inc", "XEL", 0.284, 59.76, 0.03, "(0.04%)"],
|
|
1159
|
+
["Electronic Arts Inc", "EA", 0.279, 118.38, -0.63, "(-0.53%)"],
|
|
1160
|
+
["CoStar Group Inc", "CSGP", 0.277, 78.18, 0.12, "(0.15%)"],
|
|
1161
|
+
["GLOBALFOUNDRIES Inc", "GFS", 0.273, 57.21, 0.38, "(0.67%)"],
|
|
1162
|
+
["Fastenal Co", "FAST", 0.268, 54.32, 0.11, "(0.20%)"],
|
|
1163
|
+
["Atlassian Corp", "TEAM", 0.253, 196.01, 0.55, "(0.28%)"],
|
|
1164
|
+
["GE HealthCare Technologies Inc", "GEHC", 0.252, 63.78, -0.56, "(-0.86%)"],
|
|
1165
|
+
["Warner Bros Discovery Inc", "WBD", 0.244, 11.09, -0.02, "(-0.14%)"],
|
|
1166
|
+
["Diamondback Energy Inc", "FANG", 0.235, 150.7, 0.13, "(0.09%)"],
|
|
1167
|
+
["Datadog Inc", "DDOG", 0.23, 88.81, 0.05, "(0.06%)"],
|
|
1168
|
+
["ANSYS Inc", "ANSS", 0.227, 300.6, -2.31, "(-0.76%)"],
|
|
1169
|
+
["eBay Inc", "EBAY", 0.203, 43.22, 0.09, "(0.20%)"],
|
|
1170
|
+
["Dollar Tree Inc", "DLTR", 0.201, 104.77, 0.27, "(0.25%)"],
|
|
1171
|
+
["Align Technology Inc", "ALGN", 0.2, 297.25, -1.31, "(-0.44%)"],
|
|
1172
|
+
["Zscaler Inc", "ZS", 0.188, 151.8, 0.09, "(0.06%)"],
|
|
1173
|
+
["Illumina Inc", "ILMN", 0.183, 132.31, -0.13, "(-0.10%)"],
|
|
1174
|
+
["Walgreens Boots Alliance Inc", "WBA", 0.161, 21.18, 0.06, "(0.28%)"],
|
|
1175
|
+
["Zoom Video Communications Inc", "ZM", 0.151, 68.57, -0.29, "(-0.41%)"],
|
|
1176
|
+
["Enphase Energy Inc", "ENPH", 0.148, 120.41, 0.49, "(0.41%)"],
|
|
1177
|
+
["Sirius XM Holdings Inc", "SIRI", 0.137, 4.05, 0.02, "(0.50%)"],
|
|
1178
|
+
["JD.com Inc ADR", "JD", 0.117, 30.43, 0.02, "(0.05%)"],
|
|
1179
|
+
["Lucid Group Inc", "LCID", 0.102, 5.14, 0.03, "(0.49%)"]
|
|
1180
|
+
];
|
|
1181
|
+
|
|
1182
|
+
var sp500 = [
|
|
1183
|
+
["Apple Inc", "AAPL", 6.992488, 171.9, 1.47, "(0.86%)"],
|
|
1184
|
+
["Microsoft Corp", "MSFT", 6.487978, 314.55, 1.76, "(0.56%)"],
|
|
1185
|
+
["Amazon.com Inc", "AMZN", 3.193379, 126.25, 0.27, "(0.22%)"],
|
|
1186
|
+
["Nvidia Corp", "NVDA", 2.928461, 433.11, 8.43, "(1.99%)"],
|
|
1187
|
+
["Alphabet Inc Cl A", "GOOGL", 2.162218, 132.93, 2.39, "(1.83%)"],
|
|
1188
|
+
["Tesla Inc", "TSLA", 1.854311, 246.56, 6.06, "(2.52%)"],
|
|
1189
|
+
["Alphabet Inc Cl C", "GOOG", 1.85251, 133.81, 2.35, "(1.78%)"],
|
|
1190
|
+
["Meta Platforms Inc Class A", "META", 1.847731, 305.93, 8.19, "(2.75%)"],
|
|
1191
|
+
["Berkshire Hathaway Inc Cl B", "BRK.B", 1.82184, 358.67, 0.89, "(0.25%)"],
|
|
1192
|
+
["Exxon Mobil Corp", "XOM", 1.343563, 118.97, -1.23, "(-1.03%)"],
|
|
1193
|
+
["Unitedhealth Group Inc", "UNH", 1.302884, 510.04, 6.31, "(1.25%)"],
|
|
1194
|
+
["Eli Lilly & Co", "LLY", 1.224046, 546.65, -3.11, "(-0.57%)"],
|
|
1195
|
+
["Jpmorgan Chase & Co", "JPM", 1.182918, 148.23, 2.45, "(1.68%)"],
|
|
1196
|
+
["Johnson & Johnson W/d", "JNJ", 1.056344, 156.83, -0.28, "(-0.18%)"],
|
|
1197
|
+
["Visa Inc Class a Shares", "V", 1.029636, 231.97, 2.47, "(1.08%)"],
|
|
1198
|
+
["Procter & Gamble Co", "PG", 0.969793, 145.75, -1.59, "(-1.08%)"],
|
|
1199
|
+
["Broadcom Inc", "AVGO", 0.941177, 835.33, 18.52, "(2.27%)"],
|
|
1200
|
+
["Mastercard Inc A", "MA", 0.918779, 400.65, 5.17, "(1.31%)"],
|
|
1201
|
+
["Chevron Corp", "CVX", 0.847353, 170.55, -0.49, "(-0.28%)"],
|
|
1202
|
+
["Home Depot Inc", "HD", 0.847289, 304.35, 2.53, "(0.84%)"],
|
|
1203
|
+
["Abbvie Inc", "BBV", 0.754672, 152.14, -0.99, "(-0.65%)"],
|
|
1204
|
+
["Merck & Co. Inc.", "MRK", 0.736434, 104.2, 0.26, "(0.25%)"],
|
|
1205
|
+
["Costco Wholesale Corp", "COST", 0.697258, 569.05, 5.52, "(0.98%)"],
|
|
1206
|
+
["Pepsico Inc", "PEP", 0.651768, 168.92, -0.65, "(-0.38%)"],
|
|
1207
|
+
["Walmart Inc", "WMT", 0.644449, 161.87, 0.15, "(0.09%)"],
|
|
1208
|
+
["Adobe Inc", "ADBE", 0.639652, 507.17, 4.57, "(0.91%)"],
|
|
1209
|
+
["Coca Cola Co", "KO", 0.60801, 55.82, -0.13, "(-0.23%)"],
|
|
1210
|
+
["Cisco Systems Inc", "CSCO", 0.605326, 53.97, 0.77, "(1.44%)"],
|
|
1211
|
+
["Accenture Plc Cl A", "ACN", 0.55372, 298.5, -15.9, "(-5.05%)"],
|
|
1212
|
+
["Salesforce Inc", "CRM", 0.551342, 204.46, 1.73, "(0.85%)"],
|
|
1213
|
+
["Thermo Fisher Scientific Inc", "TMO", 0.536951, 503.47, 5.18, "(1.04%)"],
|
|
1214
|
+
["Mcdonald S Corp", "MCD", 0.536457, 265.83, 2.19, "(0.83%)"],
|
|
1215
|
+
["Bank of America Corp", "BAC", 0.526405, 27.51, 0.24, "(0.86%)"],
|
|
1216
|
+
["Comcast Corp Class A", "CMCSA", 0.512537, 45.17, 0.57, "(1.27%)"],
|
|
1217
|
+
["Linde Plc", "LIN", 0.506835, 375.48, 3.47, "(0.93%)"],
|
|
1218
|
+
["Pfizer Inc", "PFE", 0.506043, 32.09, -0.02, "(-0.05%)"],
|
|
1219
|
+
["Netflix Inc", "NFLX", 0.467192, 377.77, 0.18, "(0.05%)"],
|
|
1220
|
+
["Abbott Laboratories", "ABT", 0.462893, 97.52, 1.99, "(2.08%)"],
|
|
1221
|
+
["Oracle Corp", "ORCL", 0.459877, 106.29, 1.67, "(1.60%)"]
|
|
1222
|
+
];
|
|
1223
|
+
|
|
1224
|
+
var hsi = [
|
|
1225
|
+
["CKH HOLDINGS", "00001.HK", 41.9, 1.15, "+2.822%", "5.15M", "215.13M", 4.38, 0.31, "6.98%", "160.48B"],
|
|
1226
|
+
["CLP HOLDINGS", "00002.HK", 57.95, -0.1, "-0.172%", "3.32M", "193.19M", 156.62, 1.39, "5.35%", "146.41B"],
|
|
1227
|
+
["HK & CHINA GAS", "00003.HK", 5.46, 0.13, "+2.439%", "16.16M", "88.00M", 19.43, 1.66, "6.41%", "101.88B"],
|
|
1228
|
+
["HSBC HOLDINGS,00005.HK", 61.7, 1.1, "+1.815%", "22.19M", "1.37B", 10.54, 0.86, "4.05%", 1, "227.60B"],
|
|
1229
|
+
["POWER ASSETS", "00006.HK", 37.9, -0.25, "-0.655%", "4.23M", "160.75M", 14.3, 0.93, "7.44%", "80.77B"],
|
|
1230
|
+
["HANG SENG BANK", "00011.HK", 97.45, 2.95, "+3.122%", "2.54M", "247.44M", 19.69, 1.01, "4.21%", "186.31B"],
|
|
1231
|
+
["HENDERSON LAND", "00012.HK", 20.65, 0.85, "+4.293%", "5.07M", "103.70M", 10.81, 0.31, "8.72%", "99.97B"],
|
|
1232
|
+
["SHK PPT", "00016.HK", 83.8, 3.25, "+4.035%", "8.25M", "685.41M", 10.16, 0.4, "5.91%", "242.83B"],
|
|
1233
|
+
["NEW WORLD DEV", "00017.HK", 15.24, 0.8, "+5.540%", "12.95M", "196.19M", 30.48, 0.18, "13.52%", "38.35B"],
|
|
1234
|
+
["GALAXY ENT", "00027.HK", 47.15, 1.9, "+4.199%", "11.97M", "560.21M", "No Profit", 3.22, "0.00%", "206.21B"],
|
|
1235
|
+
["MTR CORPORATION", "00066.HK", 31, 0.8, "+2.649%", "4.68M", "144.86M", 19.5, 1.07, "4.23%", "192.64B"],
|
|
1236
|
+
["HANG LUNG PPT", "00101.HK", 10.72, 0.56, "+5.512%", "7.68M", "81.99M", 12.61, 0.36, "7.28%", "48.23B"],
|
|
1237
|
+
["GEELY AUTO", "00175.HK", 9.24, 0.17, "+1.874%", "18.77M", "173.30M", 16.06, 1.15, "2.27%", "92.99B"],
|
|
1238
|
+
["ALI HEALTH", "00241.HK", 4.88, 0.47, "+10.658%", "53.62M", "257.82M", 108.09, 3.81, "0.00%", "66.04B"],
|
|
1239
|
+
["CITIC", "00267.HK", 7.2, 0.2, "+2.857%", "11.54M", "82.96M", 2.78, 0.28, "9.04%", "209.45B"],
|
|
1240
|
+
["WH GROUP", "00288.HK", 4.11, 0.08, "+1.985%", "18.94M", "77.65M", 4.93, 0.7, "7.30%", "52.73B"],
|
|
1241
|
+
["CHINA RES BEER", "00291.HK", 42.95, 1.2, "+2.874%", "4.83M", "207.98M", 28.41, 4.57, "1.41%", "139.34B"],
|
|
1242
|
+
["OOIL", "00316.HK", 104.5, -0.4, "-0.381%", "296.54K", "30.98M", 0.89, 0.66, "78.90%", "69.01B"],
|
|
1243
|
+
["TINGYI", "00322.HK", 10.94, 0.18, "+1.673%", "2.91M", "31.81M", 20.75, 4.09, "9.39%", "61.64B"],
|
|
1244
|
+
["SINOPEC CORP", "00386.HK", 4.28, -0.01, "-0.233%", "92.43M", "396.61M", 6.94, 0.58, "9.36%", "105.92B"],
|
|
1245
|
+
["HKEX", "00388.HK", 292.6, 9, "+3.173%", "4.61M", "1.34B", 36.76, 7.46, "2.44%", "370.97B"],
|
|
1246
|
+
["TECHTRONIC IND", "00669.HK", 76, 1.35, "+1.808%", "5.47M", "414.78M", 16.54, 3.43, "2.43%", "139.45B"],
|
|
1247
|
+
["CHINA OVERSEAS", "00688.HK", 16.24, 0.52, "+3.308%", "13.15M", "212.60M", 6.76, 0.44, "4.93%", "177.74B"],
|
|
1248
|
+
["TENCENT", "00700.HK", 306.2, 8.8, "+2.959%", "11.25M", "3.43B", 13.74, 3.6, "0.78%", 2, "926.16B"],
|
|
1249
|
+
["CHINA UNICOM", "00762.HK", 5.68, -0.05, "-0.873%", "9.23M", "52.77M", 9.16, 0.45, "5.44%", "173.80B"],
|
|
1250
|
+
["LINK REIT", "00823.HK", 38.4, 1.45, "+3.924%", "12.04M", "460.96M", 5.42, 0.52, "7.03%", "98.38B"],
|
|
1251
|
+
["CHINA RES POWER", "00836.HK", 14.94, 0.32, "+2.189%", "9.91M", "147.81M", 10.23, 0.87, "3.92%", "71.87B"],
|
|
1252
|
+
["PETROCHINA", "00857.HK", 5.9, 0, "0.000%", "64.23M", "380.44M", 6.38, 0.7, "8.08%", "124.48B"],
|
|
1253
|
+
["XINYI GLASS", "00868.HK", 10.14, 0.17, "+1.705%", "3.75M", "38.02M", 8.01, 1.3, "6.11%", "42.22B"],
|
|
1254
|
+
["ZHONGSHENG HLDG", "00881.HK", 22.05, 1.45, "+7.039%", "6.76M", "147.71M", 7.08, 1.07, "4.94%", "52.72B"],
|
|
1255
|
+
["CNOOC", "00883.HK", 13.78, -0.02, "-0.145%", "26.37M", "365.08M", 4.03, 0.97, "19.09%", "655.47B"],
|
|
1256
|
+
["CCB", "00939.HK", 4.42, 0.06, "+1.376%", "233.61M", "1.03B", 3.06, 0.35, "9.93%", 1, "062.64B"],
|
|
1257
|
+
["CHINA MOBILE", "00941.HK", 65.7, 0.25, "+0.382%", "7.82M", "516.10M", 9.91, 0.96, "6.71%", 1, "404.46B"],
|
|
1258
|
+
["LONGFOR GROUP", "00960.HK", 14.08, 0.9, "+6.829%", "10.88M", "150.68M", 3.06, 0.55, "9.05%", "92.81B"],
|
|
1259
|
+
["XINYI SOLAR", "00968.HK", 5.86, 0.28, "+5.018%", "15.99M", "92.88M", 13.64, 1.75, "3.41%", "52.17B"],
|
|
1260
|
+
["SMIC", "00981.HK", 20.05, 0.25, "+1.263%", "13.10M", "264.32M", 11.17, 1.06, "0.00%", "159.31B"],
|
|
1261
|
+
["LENOVO GROUP", "00992.HK", 8.07, 0.25, "+3.197%", "33.60M", "270.50M", 7.61, 2.23, "4.71%", "97.87B"],
|
|
1262
|
+
["CKI HOLDINGS", "01038.HK", 37.05, -0.2, "-0.537%", "1.44M", "53.73M", 12.03, 0.78, "6.83%", "93.35B"],
|
|
1263
|
+
["HENGAN INT'L", "01044.HK", 24.95, 0.2, "+0.808%", "2.62M", "64.97M", 13.35, 1.32, "6.33%", "28.99B"],
|
|
1264
|
+
["CHINA SHENHUA", "01088.HK", 25.4, 0.35, "+1.397%", "7.98M", "203.11M", 6.14, 1.13, "11.33%", "85.79B"],
|
|
1265
|
+
["CSPC PHARMA", "01093.HK", 5.74, 0.05, "+0.879%", "29.29M", "167.41M", 9.96, 2.01, "3.66%", "68.32B"],
|
|
1266
|
+
["SINOPHARM", "01099.HK", 22.7, 0.2, "+0.889%", "2.07M", "46.80M", 7.37, 0.92, "4.08%", "30.46B"],
|
|
1267
|
+
["CHINA RES LAND", "01109.HK", 31.2, 1, "+3.311%", "9.88M", "305.88M", 7.02, 0.81, "5.07%", "222.49B"],
|
|
1268
|
+
["CK ASSET", "01113.HK", 41.25, 1.25, "+3.125%", "8.57M", "352.44M", 6.9, 0.39, "5.53%", "146.47B"],
|
|
1269
|
+
["SINO BIOPHARM", "01177.HK", 2.83, 0.02, "+0.712%", "26.30M", "74.09M", 18.37, 1.59, "4.24%", "53.21B"],
|
|
1270
|
+
["CHINA RES MIXC", "01209.HK", 31.6, 1.6, "+5.333%", "3.07M", "96.42M", 28.97, 4.48, "2.87%", "72.13B"],
|
|
1271
|
+
["BYD COMPANY", "01211.HK", 242, 7, "+2.979%", "3.90M", "938.50M", 37.57, 5.63, "0.53%", "265.72B"],
|
|
1272
|
+
["AIA", "01299.HK", 63.85, 0.95, "+1.510%", "38.75M", "2.48B", 408.88, 2.53, "2.41%", "735.40B"],
|
|
1273
|
+
["CHINAHONGQIAO", "01378.HK", 7.67, 0.28, "+3.789%", "13.05M", "99.58M", 7.27, 0.76, "6.65%", "72.68B"],
|
|
1274
|
+
["ICBC", "01398.HK", 3.77, 0.07, "+1.892%", "233.48M", "881.67M", 3.45, 0.36, "9.08%", "327.21B"],
|
|
1275
|
+
["XIAOMI-W", "01810.HK", 12.34, 0.62, "+5.290%", "78.53M", "960.98M", 109.39, 1.9, "0.00%", "308.83B"],
|
|
1276
|
+
["BUD APAC", "01876.HK", 15.46, 0.16, "+1.046%", "16.17M", "250.45M", 28.65, 2.44, "1.91%", "204.74B"],
|
|
1277
|
+
["SANDS CHINA LTD", "01928.HK", 24, 0.95, "+4.121%", "19.98M", "475.93M", "No Profit", "N/A", "0.00%", "194.24B"],
|
|
1278
|
+
["CHOW TAI FOOK", "01929.HK", 11.8, 0.28, "+2.431%", "4.88M", "57.68M", 21.93, 3.64, "10.34%", "118.00B"],
|
|
1279
|
+
["WHARF REIC", "01997.HK", 30.25, 1.4, "+4.853%", "4.23M", "127.31M", "No Profit", 0.48, "4.33%", "91.85B"],
|
|
1280
|
+
["ANTA SPORTS", "02020.HK", 88.15, 4.4, "+5.254%", "4.82M", "422.51M", 27.71, 6.16, "1.52%", "249.70B"],
|
|
1281
|
+
["WUXI BIO", "02269.HK", 45.65, 1.55, "+3.515%", "17.91M", "811.49M", 38.18, 4.88, "0.00%", "194.01B"],
|
|
1282
|
+
["SHENZHOU INTL", "02313.HK", 75, 4.6, "+6.534%", "5.52M", "410.68M", 21.87, 3.25, "2.55%", "112.74B"],
|
|
1283
|
+
["PING AN", "02318.HK", 44.85, 0.85, "+1.932%", "23.05M", "1.03B", 8.28, 0.85, "6.09%", "334.02B"],
|
|
1284
|
+
["MENGNIU DAIRY", "02319.HK", 26.25, 1.5, "+6.061%", "8.58M", "223.15M", 17.34, 2.3, "1.73%", "103.42B"],
|
|
1285
|
+
["LI NING", "02331.HK", 32.95, 1.5, "+4.769%", "22.54M", "738.37M", 18.8, 3.16, "1.58%", "86.86B"],
|
|
1286
|
+
["SUNNY OPTICAL", "02382.HK", 54.7, 1.05, "+1.957%", "5.62M", "308.60M", 22.01, 2.44, "0.91%", "60.00B"],
|
|
1287
|
+
["BOC HONG KONG", "02388.HK", 21.45, 0.3, "+1.418%", "6.53M", "140.32M", 8.38, 0.75, "6.33%", "226.79B"],
|
|
1288
|
+
["CHINA LIFE", "02628.HK", 12.2, 0.24, "+2.007%", "13.53M", "165.07M", 9.49, 0.7, "4.53%", "90.78B"],
|
|
1289
|
+
["ENN ENERGY", "02688.HK", 65, 1.15, "+1.801%", "3.06M", "198.69M", 11.08, 1.67, "4.48%", "73.53B"],
|
|
1290
|
+
["ZIJIN MINING", "02899.HK", 11.98, 0.16, "+1.354%", "16.20M", "194.50M", 13.97, 3.14, "1.88%", "68.73B"],
|
|
1291
|
+
["MEITUAN-W", "03690.HK", 114.6, 3.8, "+3.430%", "19.17M", "2.19B", "No Profit", 4.89, "0.00%", "715.43B"],
|
|
1292
|
+
["HANSOH PHARMA", "03692.HK", 10.66, 0.16, "+1.524%", "17.56M", "187.72M", 21.48, 2.47, "0.94%", "63.25B"],
|
|
1293
|
+
["CM BANK", "03968.HK", 32.7, 0.1, "+0.307%", "11.13M", "363.99M", 5.51, 0.86, "6.00%", "150.12B"],
|
|
1294
|
+
["BANK OF CHINA", "03988.HK", 2.74, 0.05, "+1.859%", "275.47M", "754.54M", 3.33, 0.33, "9.55%", "229.13B"],
|
|
1295
|
+
["CG SERVICES", "06098.HK", 8.08, 0.25, "+3.193%", "16.08M", "128.87M", 12.42, 0.65, "5.20%", "27.01B"],
|
|
1296
|
+
["JD HEALTH", "06618.HK", 40.6, 2.95, "+7.835%", "7.75M", "312.36M", 299.91, 2.56, "0.00%", "129.12B"],
|
|
1297
|
+
["HAIER SMARTHOME", "06690.HK", 24.65, 1.15, "+4.894%", "7.24M", "178.37M", 13.83, 2.21, "2.59%", "70.46B"],
|
|
1298
|
+
["HAIDILAO", "06862.HK", 21, 0.6, "+2.941%", "6.86M", "143.79M", 74.46, 13.94, "0.55%", "117.05B"],
|
|
1299
|
+
["JD-SW", "09618.HK", 115.1, 4, "+3.600%", "7.43M", "852.28M", 30.73, 1.5, "6.38%", "360.24B"],
|
|
1300
|
+
["NONGFU SPRING", "09633.HK", 45, 1.5, "+3.448%", "3.69M", "165.62M", 52.49, 18.63, "1.71%", "226.56B"],
|
|
1301
|
+
["BIDU-SW", "09888.HK", 133.4, 4.6, "+3.571%", "5.82M", "772.73M", 47.3, 1.5, "0.00%", "377.37B"],
|
|
1302
|
+
["TRIP.COM-S", "09961.HK", 279.2, 7, "+2.572%", "1.25M", "349.59M", 114.05, 1.4, "0.00%", "176.65B"],
|
|
1303
|
+
["BABA-SW", "09988.HK", 85.6, 2.6, "+3.133%", "34.61M", "2.96B", 21.65, 1.62, "0.00%", 1, "837.13B"],
|
|
1304
|
+
["NTES-S", "09999.HK", 159.5, 8.3, "+5.489%", "5.02M", "797.10M", 22.7, 4.63, "1.36%", "546.99B"]
|
|
1305
|
+
];
|
|
1306
|
+
|
|
1307
|
+
const basketConstituentData = [];
|
|
1308
|
+
for (const row of ftse) {
|
|
1309
|
+
const [ric, name, lastTrade, change, volume] = row;
|
|
1310
|
+
const basketId = ".FTSE100";
|
|
1311
|
+
const side = "BUY";
|
|
1312
|
+
const weighting = 1;
|
|
1313
|
+
basketConstituentData.push([basketId, change, name, lastTrade, ric, `${ric}-${basketId}`, side, volume, weighting]);
|
|
1314
|
+
}
|
|
1315
|
+
for (const row of hsi) {
|
|
1316
|
+
const [name, ric, lastTrade, change, , volume] = row;
|
|
1317
|
+
const basketId = ".HSI";
|
|
1318
|
+
const side = "BUY";
|
|
1319
|
+
const weighting = 1;
|
|
1320
|
+
basketConstituentData.push([basketId, change, name, lastTrade, ric, `${ric}-${basketId}`, side, volume, weighting]);
|
|
1321
|
+
}
|
|
1322
|
+
for (const row of nasdaq) {
|
|
1323
|
+
const [name, ric, weighting, lastTrade, change] = row;
|
|
1324
|
+
const basketId = ".NASDAQ100";
|
|
1325
|
+
const side = "BUY";
|
|
1326
|
+
const volume = 1e3;
|
|
1327
|
+
basketConstituentData.push([basketId, change, name, lastTrade, ric, `${ric}-${basketId}`, side, volume, weighting]);
|
|
1328
|
+
}
|
|
1329
|
+
for (const row of sp500) {
|
|
1330
|
+
const [name, ric, weighting, , change] = row;
|
|
1331
|
+
const basketId = ".SP500";
|
|
1332
|
+
const side = "BUY";
|
|
1333
|
+
const volume = 1e3;
|
|
1334
|
+
const lastTrade = 0;
|
|
1335
|
+
basketConstituentData.push([basketId, change, name, lastTrade, ric, `${ric}-${basketId}`, side, volume, weighting]);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
const { bid: bid$1, bidSize: bidSize$1, ask: ask$1, askSize: askSize$1, last } = buildDataColumnMap$1(
|
|
1339
|
+
schemas$2,
|
|
1340
|
+
"prices"
|
|
1341
|
+
);
|
|
1342
|
+
const pricesUpdateGenerator$1 = new BaseUpdateGenerator({
|
|
1343
|
+
bid: bid$1,
|
|
1344
|
+
bidSize: bidSize$1,
|
|
1345
|
+
ask: ask$1,
|
|
1346
|
+
askSize: askSize$1,
|
|
1347
|
+
last
|
|
1348
|
+
});
|
|
1349
|
+
const prices = [];
|
|
1350
|
+
for (const [, , , lastTrade, ric] of basketConstituentData) {
|
|
1351
|
+
const priceSeed = parseFloat(String(lastTrade));
|
|
1352
|
+
if (!isNaN(priceSeed)) {
|
|
1353
|
+
const [bid2, ask2] = initBidAsk(5, nextRandomDouble);
|
|
1354
|
+
const askSize2 = random(1e3, 3e3);
|
|
1355
|
+
const bidSize2 = random(1e3, 3e3);
|
|
1356
|
+
const close = priceSeed + random(0, 1) / 10;
|
|
1357
|
+
const last2 = priceSeed + random(0, 1) / 10;
|
|
1358
|
+
const open = priceSeed + random(0, 1) / 10;
|
|
1359
|
+
const phase = "C";
|
|
1360
|
+
const scenario = "close";
|
|
1361
|
+
prices.push([
|
|
1362
|
+
ask2,
|
|
1363
|
+
askSize2,
|
|
1364
|
+
bid2,
|
|
1365
|
+
bidSize2,
|
|
1366
|
+
close,
|
|
1367
|
+
last2,
|
|
1368
|
+
open,
|
|
1369
|
+
phase,
|
|
1370
|
+
ric,
|
|
1371
|
+
scenario
|
|
1372
|
+
]);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
const pricesTable$1 = new Table(
|
|
1376
|
+
schemas$2.prices,
|
|
1377
|
+
prices,
|
|
1378
|
+
buildDataColumnMap$1(schemas$2, "prices"),
|
|
1379
|
+
pricesUpdateGenerator$1
|
|
1380
|
+
);
|
|
1381
|
+
|
|
1382
|
+
var __defProp$1 = Object.defineProperty;
|
|
1383
|
+
var __typeError$2 = (msg) => {
|
|
1384
|
+
throw TypeError(msg);
|
|
1385
|
+
};
|
|
1386
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1387
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "" , value);
|
|
1388
|
+
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
|
|
1389
|
+
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), member.get(obj));
|
|
1390
|
+
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1391
|
+
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
1392
|
+
var _childColumnName, _childDataSource, _parentColumnName, _parentDataSource;
|
|
1393
|
+
class RuntimeVisualLink {
|
|
1394
|
+
constructor(childDataSource, parentDataSource, childColumnName, parentColumnName) {
|
|
1395
|
+
__privateAdd$2(this, _childColumnName);
|
|
1396
|
+
__privateAdd$2(this, _childDataSource);
|
|
1397
|
+
__privateAdd$2(this, _parentColumnName);
|
|
1398
|
+
__privateAdd$2(this, _parentDataSource);
|
|
1399
|
+
__publicField$1(this, "handleParentSelectEvent", (selection) => {
|
|
1400
|
+
if (__privateGet$2(this, _childDataSource)) {
|
|
1401
|
+
const selectedValues = this.pickUniqueSelectedValues(selection);
|
|
1402
|
+
if (selectedValues.length === 0) {
|
|
1403
|
+
__privateGet$2(this, _childDataSource).baseFilter = void 0;
|
|
1404
|
+
} else if (selectedValues.length === 1) {
|
|
1405
|
+
__privateGet$2(this, _childDataSource).baseFilter = {
|
|
1406
|
+
filter: `${__privateGet$2(this, _childColumnName)} = "${selectedValues[0]}"`
|
|
1407
|
+
};
|
|
1408
|
+
} else {
|
|
1409
|
+
__privateGet$2(this, _childDataSource).baseFilter = {
|
|
1410
|
+
filter: `${__privateGet$2(this, _childColumnName)} in ["${selectedValues.join('","')}"]`
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
__privateSet$1(this, _childColumnName, childColumnName);
|
|
1416
|
+
__privateSet$1(this, _childDataSource, childDataSource);
|
|
1417
|
+
__privateSet$1(this, _parentColumnName, parentColumnName);
|
|
1418
|
+
__privateSet$1(this, _parentDataSource, parentDataSource);
|
|
1419
|
+
parentDataSource.on("row-selection", this.handleParentSelectEvent);
|
|
1420
|
+
}
|
|
1421
|
+
destroy() {
|
|
1422
|
+
}
|
|
1423
|
+
remove() {
|
|
1424
|
+
__privateGet$2(this, _parentDataSource)?.removeListener(
|
|
1425
|
+
"row-selection",
|
|
1426
|
+
this.handleParentSelectEvent
|
|
1427
|
+
);
|
|
1428
|
+
__privateGet$2(this, _childDataSource).baseFilter = { filter: "" };
|
|
1429
|
+
}
|
|
1430
|
+
pickUniqueSelectedValues(selection) {
|
|
1431
|
+
const data = __privateGet$2(this, _parentDataSource).currentData;
|
|
1432
|
+
const selectedRows = selection.reduce(
|
|
1433
|
+
(rows, selected) => {
|
|
1434
|
+
if (Array.isArray(selected)) {
|
|
1435
|
+
for (let i = selected[0]; i <= selected[1]; i++) {
|
|
1436
|
+
const row = data[i];
|
|
1437
|
+
if (row) {
|
|
1438
|
+
rows.push(row);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
} else {
|
|
1442
|
+
const row = data[selected];
|
|
1443
|
+
if (row) {
|
|
1444
|
+
rows.push(row);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
return rows;
|
|
1448
|
+
},
|
|
1449
|
+
[]
|
|
1450
|
+
);
|
|
1451
|
+
const map = vuuUtils.buildColumnMap(__privateGet$2(this, _parentDataSource).columns);
|
|
1452
|
+
const set = /* @__PURE__ */ new Set();
|
|
1453
|
+
const colIndex = map[__privateGet$2(this, _parentColumnName)];
|
|
1454
|
+
for (const row of selectedRows) {
|
|
1455
|
+
set.add(row[colIndex]);
|
|
1456
|
+
}
|
|
1457
|
+
return Array.from(set);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
_childColumnName = new WeakMap();
|
|
1461
|
+
_childDataSource = new WeakMap();
|
|
1462
|
+
_parentColumnName = new WeakMap();
|
|
1463
|
+
_parentDataSource = new WeakMap();
|
|
1464
|
+
|
|
1465
|
+
var __defProp = Object.defineProperty;
|
|
1466
|
+
var __typeError$1 = (msg) => {
|
|
1467
|
+
throw TypeError(msg);
|
|
1468
|
+
};
|
|
1469
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1470
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1471
|
+
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
|
|
1472
|
+
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1473
|
+
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1474
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
1475
|
+
var _menus, _name, _runtimeVisualLinks, _schemas, _sessionTableMap, _tables, _tableServices, _visualLinks, _subscriptionMap, _moduleServices;
|
|
1476
|
+
const withParams = (rpcRequest) => "namedParams" in rpcRequest;
|
|
1477
|
+
const withNamedParams = (rpcRequest) => "namedParams" in rpcRequest;
|
|
1478
|
+
class VuuModule {
|
|
1479
|
+
constructor({
|
|
1480
|
+
menus,
|
|
1481
|
+
name,
|
|
1482
|
+
schemas,
|
|
1483
|
+
services,
|
|
1484
|
+
tables,
|
|
1485
|
+
vuuLinks: visualLinks
|
|
1486
|
+
}) {
|
|
1487
|
+
__privateAdd$1(this, _menus);
|
|
1488
|
+
__privateAdd$1(this, _name);
|
|
1489
|
+
__privateAdd$1(this, _runtimeVisualLinks, /* @__PURE__ */ new Map());
|
|
1490
|
+
__privateAdd$1(this, _schemas);
|
|
1491
|
+
__privateAdd$1(this, _sessionTableMap, {});
|
|
1492
|
+
__privateAdd$1(this, _tables);
|
|
1493
|
+
__privateAdd$1(this, _tableServices);
|
|
1494
|
+
__privateAdd$1(this, _visualLinks);
|
|
1495
|
+
__privateAdd$1(this, _subscriptionMap, /* @__PURE__ */ new Map());
|
|
1496
|
+
__publicField(this, "unregisterViewport", (viewportId) => {
|
|
1497
|
+
for (const [tableName, subscriptions] of __privateGet$1(this, _subscriptionMap)) {
|
|
1498
|
+
if (subscriptions[0].viewportId.toString() === viewportId) {
|
|
1499
|
+
__privateGet$1(this, _subscriptionMap).delete(tableName);
|
|
1500
|
+
} else {
|
|
1501
|
+
const links = subscriptions[0].dataSource.links;
|
|
1502
|
+
if (links) {
|
|
1503
|
+
for (let i = 0; i < links?.length; i++) {
|
|
1504
|
+
if (links[i].parentClientVpId === viewportId) {
|
|
1505
|
+
links.splice(i);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
subscriptions[0].dataSource.links = links;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
__publicField(this, "getLinks", (subscriptionMap, vuuLinks) => {
|
|
1514
|
+
const visualLinks = [];
|
|
1515
|
+
for (let i = 0; i < vuuLinks.length; i++) {
|
|
1516
|
+
const subscriptions = subscriptionMap.get(vuuLinks[i].toTable);
|
|
1517
|
+
if (subscriptions) {
|
|
1518
|
+
subscriptions.forEach(({ viewportId, dataSource: { status } }) => {
|
|
1519
|
+
if (status !== "suspended") {
|
|
1520
|
+
const newLink = {
|
|
1521
|
+
parentClientVpId: viewportId,
|
|
1522
|
+
parentVpId: viewportId,
|
|
1523
|
+
link: vuuLinks[i]
|
|
1524
|
+
};
|
|
1525
|
+
visualLinks.push(newLink);
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return visualLinks;
|
|
1531
|
+
});
|
|
1532
|
+
__publicField(this, "visualLinkService", (message) => new Promise((resolve) => {
|
|
1533
|
+
if (message.type === "CREATE_VISUAL_LINK") {
|
|
1534
|
+
const { childColumnName, childVpId, parentColumnName, parentVpId } = message;
|
|
1535
|
+
const childDataSource = this.getSubscribedDataSource(childVpId);
|
|
1536
|
+
const parentDataSource = this.getSubscribedDataSource(parentVpId);
|
|
1537
|
+
const runtimeVisualLink = new RuntimeVisualLink(
|
|
1538
|
+
childDataSource,
|
|
1539
|
+
parentDataSource,
|
|
1540
|
+
childColumnName,
|
|
1541
|
+
parentColumnName
|
|
1542
|
+
);
|
|
1543
|
+
__privateGet$1(this, _runtimeVisualLinks).set(childVpId, runtimeVisualLink);
|
|
1544
|
+
resolve({
|
|
1545
|
+
clientViewportId: childVpId,
|
|
1546
|
+
colName: childColumnName,
|
|
1547
|
+
parentColName: parentColumnName,
|
|
1548
|
+
parentViewportId: parentVpId,
|
|
1549
|
+
type: "vuu-link-created"
|
|
1550
|
+
});
|
|
1551
|
+
} else {
|
|
1552
|
+
const runtimeVisualLink = __privateGet$1(this, _runtimeVisualLinks).get(
|
|
1553
|
+
message.childVpId
|
|
1554
|
+
);
|
|
1555
|
+
if (runtimeVisualLink) {
|
|
1556
|
+
runtimeVisualLink.remove();
|
|
1557
|
+
__privateGet$1(this, _runtimeVisualLinks).delete(message.childVpId);
|
|
1558
|
+
} else {
|
|
1559
|
+
throw Error(
|
|
1560
|
+
`visualLinkService no visual link found for viewport #${message.childVpId}`
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
resolve();
|
|
1564
|
+
}
|
|
1565
|
+
}));
|
|
1566
|
+
__publicField(this, "createDataSource", (tableName, viewport, config) => {
|
|
1567
|
+
const getVisualLinks = (tableName2) => {
|
|
1568
|
+
const linksForTable = __privateGet$1(this, _visualLinks)?.[tableName2];
|
|
1569
|
+
return linksForTable === void 0 ? void 0 : this.getLinks(__privateGet$1(this, _subscriptionMap), linksForTable);
|
|
1570
|
+
};
|
|
1571
|
+
const columnDescriptors = this.getColumnDescriptors(tableName);
|
|
1572
|
+
const table = __privateGet$1(this, _tables)[tableName];
|
|
1573
|
+
const sessionTable = __privateGet$1(this, _sessionTableMap)[tableName];
|
|
1574
|
+
const dataSource = new TickingArrayDataSource({
|
|
1575
|
+
...config,
|
|
1576
|
+
columnDescriptors,
|
|
1577
|
+
getVisualLinks,
|
|
1578
|
+
keyColumn: __privateGet$1(this, _schemas)[tableName] === void 0 ? __privateGet$1(this, _sessionTableMap)[tableName].schema.key : __privateGet$1(this, _schemas)[tableName].key,
|
|
1579
|
+
table: table || sessionTable,
|
|
1580
|
+
menu: __privateGet$1(this, _menus)?.[tableName],
|
|
1581
|
+
rpcServices: this.getServices(tableName),
|
|
1582
|
+
sessionTables: __privateGet$1(this, _sessionTableMap),
|
|
1583
|
+
viewport,
|
|
1584
|
+
visualLinkService: this.visualLinkService
|
|
1585
|
+
});
|
|
1586
|
+
dataSource.on("unsubscribed", this.unregisterViewport);
|
|
1587
|
+
const existingSubscriptions = __privateGet$1(this, _subscriptionMap).get(tableName);
|
|
1588
|
+
const subscription = {
|
|
1589
|
+
viewportId: dataSource.viewport,
|
|
1590
|
+
dataSource
|
|
1591
|
+
};
|
|
1592
|
+
if (existingSubscriptions) {
|
|
1593
|
+
existingSubscriptions.push(subscription);
|
|
1594
|
+
} else {
|
|
1595
|
+
__privateGet$1(this, _subscriptionMap).set(tableName, [subscription]);
|
|
1596
|
+
}
|
|
1597
|
+
return dataSource;
|
|
1598
|
+
});
|
|
1599
|
+
__publicField(this, "suggestionFetcher", ([
|
|
1600
|
+
vuuTable,
|
|
1601
|
+
column,
|
|
1602
|
+
pattern
|
|
1603
|
+
]) => {
|
|
1604
|
+
const table = __privateGet$1(this, _tables)[vuuTable.table];
|
|
1605
|
+
if (table) {
|
|
1606
|
+
return makeSuggestions(table, column, pattern);
|
|
1607
|
+
} else {
|
|
1608
|
+
throw Error(
|
|
1609
|
+
`${__privateGet$1(this, _name)} suggestionFetcher, unknown table ${vuuTable.module} ${vuuTable.table}`
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
__publicField(this, "openBulkEdits", async (rpcRequest) => {
|
|
1614
|
+
if (withParams(rpcRequest)) {
|
|
1615
|
+
const { namedParams, vpId } = rpcRequest;
|
|
1616
|
+
const selectedRowIds = namedParams.selectedRowIds;
|
|
1617
|
+
const table = namedParams.table;
|
|
1618
|
+
if (selectedRowIds && table) {
|
|
1619
|
+
const dataTable = __privateGet$1(this, _tables)[table.table];
|
|
1620
|
+
if (dataTable) {
|
|
1621
|
+
const sessionTable = this.createSessionTableFromSelectedRows(
|
|
1622
|
+
dataTable,
|
|
1623
|
+
selectedRowIds
|
|
1624
|
+
);
|
|
1625
|
+
const sessionTableName = `session-${vuuUtils.uuid()}`;
|
|
1626
|
+
__privateGet$1(this, _sessionTableMap)[sessionTableName] = sessionTable;
|
|
1627
|
+
return {
|
|
1628
|
+
action: {
|
|
1629
|
+
renderComponent: "grid",
|
|
1630
|
+
table: {
|
|
1631
|
+
module: table.module,
|
|
1632
|
+
table: sessionTableName
|
|
1633
|
+
},
|
|
1634
|
+
tableSchema: dataTable.schema,
|
|
1635
|
+
type: "OPEN_DIALOG_ACTION"
|
|
1636
|
+
},
|
|
1637
|
+
rpcName: "VP_BULK_EDIT_BEGIN_RPC",
|
|
1638
|
+
type: "VIEW_PORT_MENU_RESP",
|
|
1639
|
+
vpId
|
|
1640
|
+
};
|
|
1641
|
+
} else {
|
|
1642
|
+
return {
|
|
1643
|
+
action: { type: "NO_ACTION" },
|
|
1644
|
+
clientViewportId: "na",
|
|
1645
|
+
error: "No Table found",
|
|
1646
|
+
rpcName: "VP_BULK_EDIT_REJECT",
|
|
1647
|
+
type: "VIEW_PORT_MENU_REJ",
|
|
1648
|
+
vpId
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
throw Error("openBulkEdits expects Table and selectedRowIds");
|
|
1654
|
+
});
|
|
1655
|
+
__publicField(this, "endEditSession", async (rpcRequest) => {
|
|
1656
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
1657
|
+
const { vpId } = rpcRequest;
|
|
1658
|
+
delete __privateGet$1(this, _sessionTableMap)[vpId];
|
|
1659
|
+
return {
|
|
1660
|
+
action: { type: "VP_RPC_SUCCESS" },
|
|
1661
|
+
method: "???",
|
|
1662
|
+
namedParams: {},
|
|
1663
|
+
params: [],
|
|
1664
|
+
type: "VIEW_PORT_RPC_REPONSE",
|
|
1665
|
+
vpId
|
|
1666
|
+
};
|
|
1667
|
+
} else {
|
|
1668
|
+
throw Error("endEditSession invalid request");
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
// Bulk-edit with input in session table
|
|
1672
|
+
__publicField(this, "applyBulkEdits", async (rpcRequest) => {
|
|
1673
|
+
if (withParams(rpcRequest)) {
|
|
1674
|
+
const { vpId } = rpcRequest;
|
|
1675
|
+
const sessionTable = this.getSessionTable(vpId);
|
|
1676
|
+
for (let i = 0; i < sessionTable.data.length; i++) {
|
|
1677
|
+
const newRow = sessionTable.data[i];
|
|
1678
|
+
const { column, value } = rpcRequest.namedParams;
|
|
1679
|
+
const keyIndex = sessionTable.map[sessionTable.schema.key];
|
|
1680
|
+
sessionTable.update(
|
|
1681
|
+
String(newRow[keyIndex]),
|
|
1682
|
+
column,
|
|
1683
|
+
value
|
|
1684
|
+
);
|
|
1685
|
+
}
|
|
1686
|
+
return {
|
|
1687
|
+
action: {
|
|
1688
|
+
type: "NO_ACTION"
|
|
1689
|
+
},
|
|
1690
|
+
rpcName: "VP_BULK_EDIT_COLUMN_CELLS_RPC",
|
|
1691
|
+
type: "VIEW_PORT_MENU_RESP",
|
|
1692
|
+
vpId
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
throw Error("applyBulkEdits expects column and value as namedParams");
|
|
1696
|
+
});
|
|
1697
|
+
// Save session table data to main table
|
|
1698
|
+
__publicField(this, "saveBulkEdits", async (rpcRequest) => {
|
|
1699
|
+
if (withParams(rpcRequest)) {
|
|
1700
|
+
const { vpId } = rpcRequest;
|
|
1701
|
+
const sessionTable = this.getSessionTable(vpId);
|
|
1702
|
+
const { table } = sessionTable.schema.table;
|
|
1703
|
+
const baseTable = __privateGet$1(this, _tables)[table];
|
|
1704
|
+
if (baseTable) {
|
|
1705
|
+
for (let i = 0; i < sessionTable.data.length; i++) {
|
|
1706
|
+
const newRow = sessionTable.data[i];
|
|
1707
|
+
baseTable.updateRow(newRow);
|
|
1708
|
+
}
|
|
1709
|
+
return {
|
|
1710
|
+
action: {
|
|
1711
|
+
type: "VP_RPC_SUCCESS"
|
|
1712
|
+
},
|
|
1713
|
+
requestId: "request_id",
|
|
1714
|
+
rpcName: "VP_BULK_EDIT_SUBMIT_RPC",
|
|
1715
|
+
type: "VIEW_PORT_MENU_RESP",
|
|
1716
|
+
vpId
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
throw Error("saveBulkEdits base table not found");
|
|
1721
|
+
});
|
|
1722
|
+
/**
|
|
1723
|
+
* These services are available on any table. The client must configure the appropriate
|
|
1724
|
+
* menu item(s) on Table(s). The services to implement these RPC calls are built-in to
|
|
1725
|
+
* VuuModule
|
|
1726
|
+
*/
|
|
1727
|
+
__privateAdd$1(this, _moduleServices, [
|
|
1728
|
+
{
|
|
1729
|
+
rpcName: "VP_BULK_EDIT_BEGIN_RPC",
|
|
1730
|
+
service: this.openBulkEdits
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
rpcName: "VP_BULK_EDIT_COLUMN_CELLS_RPC",
|
|
1734
|
+
service: this.applyBulkEdits
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
rpcName: "VP_BULK_EDIT_SUBMIT_RPC",
|
|
1738
|
+
service: this.saveBulkEdits
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
rpcName: "VP_BULK_EDIT_END_RPC",
|
|
1742
|
+
service: this.endEditSession
|
|
1743
|
+
}
|
|
1744
|
+
]);
|
|
1745
|
+
__privateSet(this, _menus, menus);
|
|
1746
|
+
__privateSet(this, _name, name);
|
|
1747
|
+
__privateSet(this, _schemas, schemas);
|
|
1748
|
+
__privateSet(this, _tableServices, services);
|
|
1749
|
+
__privateSet(this, _tables, tables);
|
|
1750
|
+
__privateSet(this, _visualLinks, visualLinks);
|
|
1751
|
+
}
|
|
1752
|
+
getSubscribedDataSource(vpId) {
|
|
1753
|
+
for (const subscriptions of __privateGet$1(this, _subscriptionMap).values()) {
|
|
1754
|
+
for (const { viewportId, dataSource } of subscriptions) {
|
|
1755
|
+
if (viewportId === vpId) {
|
|
1756
|
+
return dataSource;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
throw Error(`getSubscribedDataSource #${vpId} not in subscriptionMap`);
|
|
1761
|
+
}
|
|
1762
|
+
getServices(tableName) {
|
|
1763
|
+
const tableServices = __privateGet$1(this, _tableServices)?.[tableName];
|
|
1764
|
+
if (Array.isArray(tableServices)) {
|
|
1765
|
+
return __privateGet$1(this, _moduleServices).concat(tableServices);
|
|
1766
|
+
} else {
|
|
1767
|
+
return __privateGet$1(this, _moduleServices);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
get typeaheadHook() {
|
|
1771
|
+
return () => this.suggestionFetcher;
|
|
1772
|
+
}
|
|
1773
|
+
get sessionTableMap() {
|
|
1774
|
+
return __privateGet$1(this, _sessionTableMap);
|
|
1775
|
+
}
|
|
1776
|
+
get tables() {
|
|
1777
|
+
return __privateGet$1(this, _tables);
|
|
1778
|
+
}
|
|
1779
|
+
getSessionTable(sessionTableName) {
|
|
1780
|
+
const sessionTable = __privateGet$1(this, _sessionTableMap)[sessionTableName];
|
|
1781
|
+
if (sessionTable) {
|
|
1782
|
+
return sessionTable;
|
|
1783
|
+
} else {
|
|
1784
|
+
throw Error(
|
|
1785
|
+
`getSessionTable: no session table with name ${sessionTableName}`
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
getColumnDescriptors(tableName) {
|
|
1790
|
+
const schema = __privateGet$1(this, _schemas)[tableName] || this.getSessionTable(tableName)?.schema;
|
|
1791
|
+
if (schema) {
|
|
1792
|
+
return schema.columns;
|
|
1793
|
+
} else {
|
|
1794
|
+
throw Error(
|
|
1795
|
+
` no schema found for module ${__privateGet$1(this, _name)} table ${tableName}`
|
|
1796
|
+
);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
createSessionTableFromSelectedRows({ data, map, schema }, selectedRowIds) {
|
|
1800
|
+
const keyIndex = map[schema.key];
|
|
1801
|
+
const sessionData = [];
|
|
1802
|
+
for (let i = 0; i < selectedRowIds.length; i++) {
|
|
1803
|
+
for (let j = 0; j < data.length; j++) {
|
|
1804
|
+
if (data[j][keyIndex] === selectedRowIds[i]) {
|
|
1805
|
+
sessionData.push(data[j]);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
return new Table(schema, sessionData, buildDataColumnMapFromSchema(schema));
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
_menus = new WeakMap();
|
|
1813
|
+
_name = new WeakMap();
|
|
1814
|
+
_runtimeVisualLinks = new WeakMap();
|
|
1815
|
+
_schemas = new WeakMap();
|
|
1816
|
+
_sessionTableMap = new WeakMap();
|
|
1817
|
+
_tables = new WeakMap();
|
|
1818
|
+
_tableServices = new WeakMap();
|
|
1819
|
+
_visualLinks = new WeakMap();
|
|
1820
|
+
_subscriptionMap = new WeakMap();
|
|
1821
|
+
_moduleServices = new WeakMap();
|
|
1822
|
+
|
|
1823
|
+
const undefinedTables$1 = {
|
|
1824
|
+
algoType: void 0,
|
|
1825
|
+
basket: void 0,
|
|
1826
|
+
basketTrading: void 0,
|
|
1827
|
+
basketTradingConstituent: void 0,
|
|
1828
|
+
basketConstituent: void 0,
|
|
1829
|
+
basketTradingConstituentJoin: void 0,
|
|
1830
|
+
priceStrategyType: void 0
|
|
1831
|
+
};
|
|
1832
|
+
const buildDataColumnMap = (tableName) => Object.values(schemas$3[tableName].columns).reduce(
|
|
1833
|
+
(map, col, index) => {
|
|
1834
|
+
map[col.name] = index;
|
|
1835
|
+
return map;
|
|
1836
|
+
},
|
|
1837
|
+
{}
|
|
1838
|
+
);
|
|
1839
|
+
const tableMaps = {
|
|
1840
|
+
algoType: buildDataColumnMap("algoType"),
|
|
1841
|
+
basket: buildDataColumnMap("basket"),
|
|
1842
|
+
basketTrading: buildDataColumnMap("basketTrading"),
|
|
1843
|
+
basketTradingConstituent: buildDataColumnMap("basketTradingConstituent"),
|
|
1844
|
+
basketConstituent: buildDataColumnMap("basketConstituent"),
|
|
1845
|
+
basketTradingConstituentJoin: buildDataColumnMap(
|
|
1846
|
+
"basketTradingConstituentJoin"
|
|
1847
|
+
),
|
|
1848
|
+
priceStrategyType: buildDataColumnMap("priceStrategyType")
|
|
1849
|
+
};
|
|
1850
|
+
const basketConstituent = new Table(
|
|
1851
|
+
schemas$3.basketConstituent,
|
|
1852
|
+
basketConstituentData,
|
|
1853
|
+
tableMaps.basketConstituent
|
|
1854
|
+
);
|
|
1855
|
+
const basketTrading = new Table(
|
|
1856
|
+
schemas$3.basketTrading,
|
|
1857
|
+
[],
|
|
1858
|
+
tableMaps.basketTrading
|
|
1859
|
+
);
|
|
1860
|
+
let basketIncrement = 1;
|
|
1861
|
+
const basketTradingConstituent = new Table(
|
|
1862
|
+
schemas$3.basketTradingConstituent,
|
|
1863
|
+
[],
|
|
1864
|
+
tableMaps.basketTradingConstituent
|
|
1865
|
+
);
|
|
1866
|
+
const createBasketTradingRow = (basketId, basketName, side = "BUY", status = "OFF MARKET") => [
|
|
1867
|
+
basketId,
|
|
1868
|
+
basketName,
|
|
1869
|
+
0,
|
|
1870
|
+
1.25,
|
|
1871
|
+
`steve-${basketIncrement++}`,
|
|
1872
|
+
side,
|
|
1873
|
+
status,
|
|
1874
|
+
1e6,
|
|
1875
|
+
125e4,
|
|
1876
|
+
100
|
|
1877
|
+
];
|
|
1878
|
+
function createTradingBasket(basketId, basketName) {
|
|
1879
|
+
const basketTradingRow = createBasketTradingRow(basketId, basketName);
|
|
1880
|
+
basketTrading.insert(basketTradingRow);
|
|
1881
|
+
const { basketId: key } = buildDataColumnMap("basketConstituent");
|
|
1882
|
+
const constituents = basketConstituent.data.filter(
|
|
1883
|
+
(c) => c[key] === basketId
|
|
1884
|
+
);
|
|
1885
|
+
const { instanceId } = tableMaps.basketTrading;
|
|
1886
|
+
constituents.forEach(([, , description, , ric, , , quantity, weighting]) => {
|
|
1887
|
+
const algo = "";
|
|
1888
|
+
const algoParams = "";
|
|
1889
|
+
const limitPrice = 95;
|
|
1890
|
+
const notionalLocal = 0;
|
|
1891
|
+
const notionalUsd = 0;
|
|
1892
|
+
const pctFilled = 0;
|
|
1893
|
+
const priceSpread = 0;
|
|
1894
|
+
const priceStrategyId = "";
|
|
1895
|
+
const side = "BUY";
|
|
1896
|
+
const venue = "venue";
|
|
1897
|
+
const basketInstanceId = basketTradingRow[instanceId];
|
|
1898
|
+
const basketTradingConstituentRow = [
|
|
1899
|
+
algo,
|
|
1900
|
+
algoParams,
|
|
1901
|
+
basketId,
|
|
1902
|
+
description,
|
|
1903
|
+
basketInstanceId,
|
|
1904
|
+
`${basketInstanceId}-${ric}`,
|
|
1905
|
+
limitPrice,
|
|
1906
|
+
notionalLocal,
|
|
1907
|
+
notionalUsd,
|
|
1908
|
+
pctFilled,
|
|
1909
|
+
priceSpread,
|
|
1910
|
+
priceStrategyId,
|
|
1911
|
+
quantity,
|
|
1912
|
+
ric,
|
|
1913
|
+
side,
|
|
1914
|
+
venue,
|
|
1915
|
+
weighting
|
|
1916
|
+
];
|
|
1917
|
+
basketTradingConstituent.insert(basketTradingConstituentRow);
|
|
1918
|
+
});
|
|
1919
|
+
return basketTradingRow[instanceId];
|
|
1920
|
+
}
|
|
1921
|
+
const addConstituent = async (rpcRequest) => {
|
|
1922
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
1923
|
+
throw Error(`addConstituent not implemented`);
|
|
1924
|
+
} else {
|
|
1925
|
+
throw Error(`addConstituent invalid rpcRequest`);
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
const viewportRpcResponse = (params, vpId, action) => ({
|
|
1929
|
+
type: "VIEW_PORT_RPC_REPONSE",
|
|
1930
|
+
action: {
|
|
1931
|
+
type: "VP_RPC_SUCCESS",
|
|
1932
|
+
...action
|
|
1933
|
+
},
|
|
1934
|
+
method: "???",
|
|
1935
|
+
namedParams: {},
|
|
1936
|
+
params,
|
|
1937
|
+
vpId
|
|
1938
|
+
});
|
|
1939
|
+
const sendToMarket = async (rpcRequest) => {
|
|
1940
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
1941
|
+
const { params, vpId } = rpcRequest;
|
|
1942
|
+
const [basketInstanceId] = params;
|
|
1943
|
+
basketTrading.update(basketInstanceId, "status", "ON_MARKET");
|
|
1944
|
+
return viewportRpcResponse(params, vpId);
|
|
1945
|
+
} else {
|
|
1946
|
+
throw Error(`sendToMarket invalid rpcRequest`);
|
|
1947
|
+
}
|
|
1948
|
+
};
|
|
1949
|
+
const takeOffMarket = async (rpcRequest) => {
|
|
1950
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
1951
|
+
const { params, vpId } = rpcRequest;
|
|
1952
|
+
const [basketInstanceId] = params;
|
|
1953
|
+
basketTrading.update(basketInstanceId, "status", "OFF-MARKET");
|
|
1954
|
+
return viewportRpcResponse(params, vpId);
|
|
1955
|
+
} else {
|
|
1956
|
+
throw Error(`takeOffMarket invalid rpcRequest`);
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
const createNewBasket = async (rpcRequest) => {
|
|
1960
|
+
if (vuuUtils.isViewportRpcRequest(rpcRequest)) {
|
|
1961
|
+
const { params, vpId } = rpcRequest;
|
|
1962
|
+
const [basketId, basketName] = params;
|
|
1963
|
+
const key = createTradingBasket(basketId, basketName);
|
|
1964
|
+
return viewportRpcResponse(params, vpId, { key });
|
|
1965
|
+
} else {
|
|
1966
|
+
throw Error(`createNewBasket invalid rpcRequest`);
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
const tables$2 = {
|
|
1970
|
+
algoType: new Table(
|
|
1971
|
+
schemas$3.algoType,
|
|
1972
|
+
[
|
|
1973
|
+
["Sniper", 0],
|
|
1974
|
+
["Dark Liquidity", 1],
|
|
1975
|
+
["VWAP", 2],
|
|
1976
|
+
["POV", 3],
|
|
1977
|
+
["Dynamic Close", 4]
|
|
1978
|
+
],
|
|
1979
|
+
tableMaps.algoType
|
|
1980
|
+
),
|
|
1981
|
+
basket: new Table(
|
|
1982
|
+
schemas$3.basket,
|
|
1983
|
+
[
|
|
1984
|
+
[".NASDAQ100", ".NASDAQ100", 0, 0],
|
|
1985
|
+
[".HSI", ".HSI", 0, 0],
|
|
1986
|
+
[".FTSE100", ".FTSE100", 0, 0],
|
|
1987
|
+
[".SP500", ".SP500", 0, 0]
|
|
1988
|
+
],
|
|
1989
|
+
tableMaps.basket
|
|
1990
|
+
),
|
|
1991
|
+
basketConstituent,
|
|
1992
|
+
basketTrading,
|
|
1993
|
+
basketTradingConstituent,
|
|
1994
|
+
basketTradingConstituentJoin: joinTables(
|
|
1995
|
+
{ module: "BASKET", table: "basketTradingConstituentJoin" },
|
|
1996
|
+
basketTradingConstituent,
|
|
1997
|
+
pricesTable$1,
|
|
1998
|
+
"ric"
|
|
1999
|
+
),
|
|
2000
|
+
priceStrategyType: new Table(
|
|
2001
|
+
schemas$3.priceStrategyType,
|
|
2002
|
+
[
|
|
2003
|
+
["Peg to Near Touch", 0],
|
|
2004
|
+
["Far Touch", 1],
|
|
2005
|
+
["Limit", 2],
|
|
2006
|
+
["Algo", 3]
|
|
2007
|
+
],
|
|
2008
|
+
tableMaps.priceStrategyType
|
|
2009
|
+
)
|
|
2010
|
+
};
|
|
2011
|
+
const vuuLinks$1 = {
|
|
2012
|
+
...undefinedTables$1,
|
|
2013
|
+
basketConstituent: [
|
|
2014
|
+
{ fromColumn: "basketId", toColumn: "id", toTable: "basket" }
|
|
2015
|
+
]
|
|
2016
|
+
};
|
|
2017
|
+
const menus$1 = {
|
|
2018
|
+
...undefinedTables$1,
|
|
2019
|
+
basket: {
|
|
2020
|
+
name: "ROOT",
|
|
2021
|
+
menus: [
|
|
2022
|
+
{
|
|
2023
|
+
context: "selected-rows",
|
|
2024
|
+
filter: "",
|
|
2025
|
+
name: "Add Basket",
|
|
2026
|
+
rpcName: "CREATE_NEW_BASKET"
|
|
2027
|
+
}
|
|
2028
|
+
]
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
const services$1 = {
|
|
2032
|
+
...undefinedTables$1,
|
|
2033
|
+
basket: [
|
|
2034
|
+
{
|
|
2035
|
+
rpcName: "createBasket",
|
|
2036
|
+
service: createNewBasket
|
|
2037
|
+
}
|
|
2038
|
+
],
|
|
2039
|
+
basketTrading: [
|
|
2040
|
+
{
|
|
2041
|
+
rpcName: "sendToMarket",
|
|
2042
|
+
service: sendToMarket
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
rpcName: "takeOffMarket",
|
|
2046
|
+
service: takeOffMarket
|
|
2047
|
+
}
|
|
2048
|
+
],
|
|
2049
|
+
basketTradingConstituentJoin: [
|
|
2050
|
+
{
|
|
2051
|
+
rpcName: "addConstituent",
|
|
2052
|
+
service: addConstituent
|
|
2053
|
+
}
|
|
2054
|
+
]
|
|
2055
|
+
};
|
|
2056
|
+
const basketModule = new VuuModule({
|
|
2057
|
+
menus: menus$1,
|
|
2058
|
+
name: "BASKET",
|
|
2059
|
+
schemas: schemas$3,
|
|
2060
|
+
services: services$1,
|
|
2061
|
+
tables: tables$2,
|
|
2062
|
+
vuuLinks: vuuLinks$1
|
|
2063
|
+
});
|
|
2064
|
+
|
|
2065
|
+
var __typeError = (msg) => {
|
|
2066
|
+
throw TypeError(msg);
|
|
2067
|
+
};
|
|
2068
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
2069
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2070
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2071
|
+
var _services;
|
|
2072
|
+
class SimulModule extends VuuModule {
|
|
2073
|
+
constructor(props) {
|
|
2074
|
+
super(props);
|
|
2075
|
+
__privateAdd(this, _services, []);
|
|
2076
|
+
}
|
|
2077
|
+
getServices(tableName) {
|
|
2078
|
+
return __privateGet(this, _services).concat(super.getServices(tableName));
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
_services = new WeakMap();
|
|
2082
|
+
|
|
2083
|
+
const convertStringToBaseTenNumber = (value) => parseInt(value, 10);
|
|
2084
|
+
|
|
2085
|
+
const isOdd = (value) => value % 2 === 1;
|
|
2086
|
+
|
|
2087
|
+
const generateCusipCheckCode = (cusip) => {
|
|
2088
|
+
const cusipLength = cusip.length;
|
|
2089
|
+
let currentValue;
|
|
2090
|
+
let total = 0;
|
|
2091
|
+
for (let i = 0; i < cusipLength; i++) {
|
|
2092
|
+
currentValue = cusip[i];
|
|
2093
|
+
const currentNumberToBaseTen = convertStringToBaseTenNumber(currentValue);
|
|
2094
|
+
let currentNumberOrPosition = isNaN(currentNumberToBaseTen) ? currentValue.charCodeAt(0) - "A".charCodeAt(0) + 10 : parseInt(currentValue);
|
|
2095
|
+
if (isOdd(i)) {
|
|
2096
|
+
currentNumberOrPosition = currentNumberOrPosition * 2;
|
|
2097
|
+
}
|
|
2098
|
+
total = total + Math.floor(currentNumberOrPosition / 10) + currentNumberOrPosition % 10;
|
|
2099
|
+
}
|
|
2100
|
+
const check = (10 - total % 10) % 10;
|
|
2101
|
+
return check;
|
|
2102
|
+
};
|
|
2103
|
+
|
|
2104
|
+
const alphabet = [
|
|
2105
|
+
"A",
|
|
2106
|
+
"B",
|
|
2107
|
+
"C",
|
|
2108
|
+
"D",
|
|
2109
|
+
"E",
|
|
2110
|
+
"F",
|
|
2111
|
+
"G",
|
|
2112
|
+
"H",
|
|
2113
|
+
"J",
|
|
2114
|
+
"K",
|
|
2115
|
+
"L",
|
|
2116
|
+
"M",
|
|
2117
|
+
"N",
|
|
2118
|
+
"P",
|
|
2119
|
+
"Q",
|
|
2120
|
+
"R",
|
|
2121
|
+
"S",
|
|
2122
|
+
"T",
|
|
2123
|
+
"U",
|
|
2124
|
+
"V",
|
|
2125
|
+
"W",
|
|
2126
|
+
"X",
|
|
2127
|
+
"Y",
|
|
2128
|
+
"Z"
|
|
2129
|
+
];
|
|
2130
|
+
|
|
2131
|
+
const baseTenNumbers = [
|
|
2132
|
+
0,
|
|
2133
|
+
1,
|
|
2134
|
+
2,
|
|
2135
|
+
3,
|
|
2136
|
+
4,
|
|
2137
|
+
5,
|
|
2138
|
+
6,
|
|
2139
|
+
7,
|
|
2140
|
+
8,
|
|
2141
|
+
9
|
|
2142
|
+
];
|
|
2143
|
+
|
|
2144
|
+
const alphanumeric = [...alphabet, ...baseTenNumbers];
|
|
2145
|
+
|
|
2146
|
+
const generateRandomAlphanumeric = () => alphanumeric[Math.floor(Math.random() * alphanumeric.length)];
|
|
2147
|
+
|
|
2148
|
+
const generateRandomStringOfAlphanumericChars = () => {
|
|
2149
|
+
let string = "";
|
|
2150
|
+
for (let i = 0; i < 2; i++) {
|
|
2151
|
+
string = string + generateRandomAlphanumeric();
|
|
2152
|
+
}
|
|
2153
|
+
return string;
|
|
2154
|
+
};
|
|
2155
|
+
|
|
2156
|
+
const generateRandomBaseTenNumber = () => Math.floor(Math.random() * 10);
|
|
2157
|
+
|
|
2158
|
+
const generateRandomStringOfBaseTenChars = () => {
|
|
2159
|
+
let string = "";
|
|
2160
|
+
for (let i = 0; i < 6; i++) {
|
|
2161
|
+
string = string + generateRandomBaseTenNumber();
|
|
2162
|
+
}
|
|
2163
|
+
return string;
|
|
2164
|
+
};
|
|
2165
|
+
|
|
2166
|
+
const generateCusipWithoutCheckCode = () => {
|
|
2167
|
+
const randomBaseTenString = generateRandomStringOfBaseTenChars();
|
|
2168
|
+
const randomAlphanumericString = generateRandomStringOfAlphanumericChars();
|
|
2169
|
+
return randomBaseTenString + randomAlphanumericString;
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
const generateCusip = () => {
|
|
2173
|
+
const cusip = generateCusipWithoutCheckCode();
|
|
2174
|
+
const check = generateCusipCheckCode(cusip);
|
|
2175
|
+
return cusip + check;
|
|
2176
|
+
};
|
|
2177
|
+
|
|
2178
|
+
const countryCodes = [
|
|
2179
|
+
"AD",
|
|
2180
|
+
"AE",
|
|
2181
|
+
"AF",
|
|
2182
|
+
"AG",
|
|
2183
|
+
"AI",
|
|
2184
|
+
"AL",
|
|
2185
|
+
"AM",
|
|
2186
|
+
"AO",
|
|
2187
|
+
"AQ",
|
|
2188
|
+
"AR",
|
|
2189
|
+
"AS",
|
|
2190
|
+
"AT",
|
|
2191
|
+
"AU",
|
|
2192
|
+
"AW",
|
|
2193
|
+
"AX",
|
|
2194
|
+
"AZ",
|
|
2195
|
+
"BA",
|
|
2196
|
+
"BB",
|
|
2197
|
+
"BD",
|
|
2198
|
+
"BE",
|
|
2199
|
+
"BF",
|
|
2200
|
+
"BG",
|
|
2201
|
+
"BH",
|
|
2202
|
+
"BI",
|
|
2203
|
+
"BJ",
|
|
2204
|
+
"BL",
|
|
2205
|
+
"BM",
|
|
2206
|
+
"BN",
|
|
2207
|
+
"BO",
|
|
2208
|
+
"BQ",
|
|
2209
|
+
"BR",
|
|
2210
|
+
"BS",
|
|
2211
|
+
"BT",
|
|
2212
|
+
"BV",
|
|
2213
|
+
"BW",
|
|
2214
|
+
"BY",
|
|
2215
|
+
"BZ",
|
|
2216
|
+
"CA",
|
|
2217
|
+
"CC",
|
|
2218
|
+
"CD",
|
|
2219
|
+
"CF",
|
|
2220
|
+
"CG",
|
|
2221
|
+
"CH",
|
|
2222
|
+
"CI",
|
|
2223
|
+
"CK",
|
|
2224
|
+
"CL",
|
|
2225
|
+
"CM",
|
|
2226
|
+
"CN",
|
|
2227
|
+
"CO",
|
|
2228
|
+
"CR",
|
|
2229
|
+
"CU",
|
|
2230
|
+
"CV",
|
|
2231
|
+
"CW",
|
|
2232
|
+
"CX",
|
|
2233
|
+
"CY",
|
|
2234
|
+
"CZ",
|
|
2235
|
+
"DE",
|
|
2236
|
+
"DJ",
|
|
2237
|
+
"DK",
|
|
2238
|
+
"DM",
|
|
2239
|
+
"DO",
|
|
2240
|
+
"DZ",
|
|
2241
|
+
"EC",
|
|
2242
|
+
"EE",
|
|
2243
|
+
"EG",
|
|
2244
|
+
"EH",
|
|
2245
|
+
"ER",
|
|
2246
|
+
"ES",
|
|
2247
|
+
"ET",
|
|
2248
|
+
"FI",
|
|
2249
|
+
"FJ",
|
|
2250
|
+
"FK",
|
|
2251
|
+
"FM",
|
|
2252
|
+
"FO",
|
|
2253
|
+
"FR",
|
|
2254
|
+
"GA",
|
|
2255
|
+
"GB",
|
|
2256
|
+
"GD",
|
|
2257
|
+
"GE",
|
|
2258
|
+
"GF",
|
|
2259
|
+
"GG",
|
|
2260
|
+
"GH",
|
|
2261
|
+
"GI",
|
|
2262
|
+
"GL",
|
|
2263
|
+
"GM",
|
|
2264
|
+
"GN",
|
|
2265
|
+
"GP",
|
|
2266
|
+
"GQ",
|
|
2267
|
+
"GR",
|
|
2268
|
+
"GS",
|
|
2269
|
+
"GT",
|
|
2270
|
+
"GU",
|
|
2271
|
+
"GW",
|
|
2272
|
+
"GY",
|
|
2273
|
+
"HK",
|
|
2274
|
+
"HM",
|
|
2275
|
+
"HN",
|
|
2276
|
+
"HR",
|
|
2277
|
+
"HT",
|
|
2278
|
+
"HU",
|
|
2279
|
+
"ID",
|
|
2280
|
+
"IE",
|
|
2281
|
+
"IL",
|
|
2282
|
+
"IM",
|
|
2283
|
+
"IN",
|
|
2284
|
+
"IO",
|
|
2285
|
+
"IQ",
|
|
2286
|
+
"IR",
|
|
2287
|
+
"IS",
|
|
2288
|
+
"IT",
|
|
2289
|
+
"JE",
|
|
2290
|
+
"JM",
|
|
2291
|
+
"JO",
|
|
2292
|
+
"JP",
|
|
2293
|
+
"KE",
|
|
2294
|
+
"KG",
|
|
2295
|
+
"KH",
|
|
2296
|
+
"KI",
|
|
2297
|
+
"KM",
|
|
2298
|
+
"KN",
|
|
2299
|
+
"KP",
|
|
2300
|
+
"KR",
|
|
2301
|
+
"KW",
|
|
2302
|
+
"KY",
|
|
2303
|
+
"KZ",
|
|
2304
|
+
"LA",
|
|
2305
|
+
"LB",
|
|
2306
|
+
"LC",
|
|
2307
|
+
"LI",
|
|
2308
|
+
"LK",
|
|
2309
|
+
"LR",
|
|
2310
|
+
"LS",
|
|
2311
|
+
"LT",
|
|
2312
|
+
"LU",
|
|
2313
|
+
"LV",
|
|
2314
|
+
"LY",
|
|
2315
|
+
"MA",
|
|
2316
|
+
"MC",
|
|
2317
|
+
"MD",
|
|
2318
|
+
"ME",
|
|
2319
|
+
"MF",
|
|
2320
|
+
"MG",
|
|
2321
|
+
"MH",
|
|
2322
|
+
"MK",
|
|
2323
|
+
"ML",
|
|
2324
|
+
"MM",
|
|
2325
|
+
"MN",
|
|
2326
|
+
"MO",
|
|
2327
|
+
"MP",
|
|
2328
|
+
"MQ",
|
|
2329
|
+
"MR",
|
|
2330
|
+
"MS",
|
|
2331
|
+
"MT",
|
|
2332
|
+
"MU",
|
|
2333
|
+
"MV",
|
|
2334
|
+
"MW",
|
|
2335
|
+
"MX",
|
|
2336
|
+
"MY",
|
|
2337
|
+
"MZ",
|
|
2338
|
+
"NA",
|
|
2339
|
+
"NC",
|
|
2340
|
+
"NE",
|
|
2341
|
+
"NF",
|
|
2342
|
+
"NG",
|
|
2343
|
+
"NI",
|
|
2344
|
+
"NL",
|
|
2345
|
+
"NO",
|
|
2346
|
+
"NP",
|
|
2347
|
+
"NR",
|
|
2348
|
+
"NU",
|
|
2349
|
+
"NZ",
|
|
2350
|
+
"OM",
|
|
2351
|
+
"PA",
|
|
2352
|
+
"PE",
|
|
2353
|
+
"PF",
|
|
2354
|
+
"PG",
|
|
2355
|
+
"PH",
|
|
2356
|
+
"PK",
|
|
2357
|
+
"PL",
|
|
2358
|
+
"PM",
|
|
2359
|
+
"PN",
|
|
2360
|
+
"PR",
|
|
2361
|
+
"PS",
|
|
2362
|
+
"PT",
|
|
2363
|
+
"PW",
|
|
2364
|
+
"PY",
|
|
2365
|
+
"QA",
|
|
2366
|
+
"RE",
|
|
2367
|
+
"RO",
|
|
2368
|
+
"RS",
|
|
2369
|
+
"RU",
|
|
2370
|
+
"RW",
|
|
2371
|
+
"SA",
|
|
2372
|
+
"SB",
|
|
2373
|
+
"SC",
|
|
2374
|
+
"SD",
|
|
2375
|
+
"SE",
|
|
2376
|
+
"SG",
|
|
2377
|
+
"SH",
|
|
2378
|
+
"SI",
|
|
2379
|
+
"SJ",
|
|
2380
|
+
"SK",
|
|
2381
|
+
"SL",
|
|
2382
|
+
"SM",
|
|
2383
|
+
"SN",
|
|
2384
|
+
"SO",
|
|
2385
|
+
"SR",
|
|
2386
|
+
"SS",
|
|
2387
|
+
"ST",
|
|
2388
|
+
"SV",
|
|
2389
|
+
"SX",
|
|
2390
|
+
"SY",
|
|
2391
|
+
"SZ",
|
|
2392
|
+
"TC",
|
|
2393
|
+
"TD",
|
|
2394
|
+
"TF",
|
|
2395
|
+
"TG",
|
|
2396
|
+
"TH",
|
|
2397
|
+
"TJ",
|
|
2398
|
+
"TK",
|
|
2399
|
+
"TL",
|
|
2400
|
+
"TM",
|
|
2401
|
+
"TN",
|
|
2402
|
+
"TO",
|
|
2403
|
+
"TR",
|
|
2404
|
+
"TT",
|
|
2405
|
+
"TV",
|
|
2406
|
+
"TW",
|
|
2407
|
+
"TZ",
|
|
2408
|
+
"UA",
|
|
2409
|
+
"UG",
|
|
2410
|
+
"UM",
|
|
2411
|
+
"US",
|
|
2412
|
+
"UY",
|
|
2413
|
+
"UZ",
|
|
2414
|
+
"VA",
|
|
2415
|
+
"VC",
|
|
2416
|
+
"VE",
|
|
2417
|
+
"VG",
|
|
2418
|
+
"VI",
|
|
2419
|
+
"VN",
|
|
2420
|
+
"VU",
|
|
2421
|
+
"WF",
|
|
2422
|
+
"WS",
|
|
2423
|
+
"YE",
|
|
2424
|
+
"YT",
|
|
2425
|
+
"ZA",
|
|
2426
|
+
"ZM",
|
|
2427
|
+
"ZW"
|
|
2428
|
+
];
|
|
2429
|
+
const cusip = generateCusip();
|
|
2430
|
+
const generateIsin = (cusip2) => {
|
|
2431
|
+
const code = countryCodes[Math.floor(Math.random() * countryCodes.length)];
|
|
2432
|
+
const isin = code + cusip2 + generateIsinCheckDigit(code + cusip2 + "0");
|
|
2433
|
+
return isin;
|
|
2434
|
+
};
|
|
2435
|
+
const generateIsinCheckDigit = (isin) => {
|
|
2436
|
+
if (isin.length != 12) return false;
|
|
2437
|
+
const v = [];
|
|
2438
|
+
for (let i = isin.length - 2; i >= 0; i--) {
|
|
2439
|
+
const c = isin.charAt(i);
|
|
2440
|
+
if (isNaN(parseInt(c))) {
|
|
2441
|
+
const letterCode = isin.charCodeAt(i) - 55;
|
|
2442
|
+
v.push(letterCode % 10);
|
|
2443
|
+
if (letterCode > 9) {
|
|
2444
|
+
v.push(Math.floor(letterCode / 10));
|
|
2445
|
+
}
|
|
2446
|
+
} else {
|
|
2447
|
+
v.push(Number(c));
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
let sum = 0;
|
|
2451
|
+
const l = v.length;
|
|
2452
|
+
for (let i = 0; i < l; i++) {
|
|
2453
|
+
if (i % 2 == 0) {
|
|
2454
|
+
const d = v[i] * 2;
|
|
2455
|
+
sum += Math.floor(d / 10);
|
|
2456
|
+
sum += d % 10;
|
|
2457
|
+
} else {
|
|
2458
|
+
sum += v[i];
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
return (10 - sum % 10) % 10;
|
|
2462
|
+
};
|
|
2463
|
+
const isinGenerator = () => {
|
|
2464
|
+
return generateIsin(cusip);
|
|
2465
|
+
};
|
|
2466
|
+
|
|
2467
|
+
const currencies = ["CAD", "GBX", "USD", "EUR", "GBP"];
|
|
2468
|
+
|
|
2469
|
+
const locations = {
|
|
2470
|
+
L: ["London PLC", "XLON/LSE-SETS"],
|
|
2471
|
+
N: ["Corporation", "XNGS/NAS-GSM"],
|
|
2472
|
+
AS: ["B.V.", "XAMS/ENA-MAIN"],
|
|
2473
|
+
OQ: ["Co.", "XNYS/NYS-MAIN"],
|
|
2474
|
+
PA: ["Paris", "PAR/EUR_FR"],
|
|
2475
|
+
MI: ["Milan", "MIL/EUR_IT"],
|
|
2476
|
+
FR: ["Frankfurt", "FR/EUR_DE"],
|
|
2477
|
+
AT: ["Athens", "AT/EUR_GR"]
|
|
2478
|
+
};
|
|
2479
|
+
const suffixes = ["L", "N", "OQ", "AS", "PA", "MI", "FR", "AT"];
|
|
2480
|
+
|
|
2481
|
+
const lotsizes = [
|
|
2482
|
+
1,
|
|
2483
|
+
2,
|
|
2484
|
+
5,
|
|
2485
|
+
10,
|
|
2486
|
+
50,
|
|
2487
|
+
50,
|
|
2488
|
+
70,
|
|
2489
|
+
100,
|
|
2490
|
+
100,
|
|
2491
|
+
100,
|
|
2492
|
+
120,
|
|
2493
|
+
150,
|
|
2494
|
+
150,
|
|
2495
|
+
200,
|
|
2496
|
+
500,
|
|
2497
|
+
700,
|
|
2498
|
+
1e3,
|
|
2499
|
+
2e3,
|
|
2500
|
+
2500,
|
|
2501
|
+
5e3,
|
|
2502
|
+
1e4
|
|
2503
|
+
];
|
|
2504
|
+
|
|
2505
|
+
const InstrumentColumnMap = {
|
|
2506
|
+
bbg: 0,
|
|
2507
|
+
currency: 1,
|
|
2508
|
+
description: 2,
|
|
2509
|
+
exchange: 3,
|
|
2510
|
+
string: 4,
|
|
2511
|
+
number: 5,
|
|
2512
|
+
ric: 6,
|
|
2513
|
+
price: 7,
|
|
2514
|
+
date: 8
|
|
2515
|
+
};
|
|
2516
|
+
const instrumentsData = [];
|
|
2517
|
+
const chars1 = Array.from("ABCEFGHKMN");
|
|
2518
|
+
const chars2 = Array.from("ABCEFGHKMN");
|
|
2519
|
+
const chars3 = Array.from("OPQRTUVWYZ");
|
|
2520
|
+
const chars4 = Array.from("OPQRTUVWYZ");
|
|
2521
|
+
const randomPrice = () => {
|
|
2522
|
+
const price = random(0, 1e4);
|
|
2523
|
+
const multiplier = random(1, 10);
|
|
2524
|
+
return price / multiplier;
|
|
2525
|
+
};
|
|
2526
|
+
let count = 0;
|
|
2527
|
+
for (const char1 of chars1) {
|
|
2528
|
+
for (const char2 of chars2) {
|
|
2529
|
+
for (const char3 of chars3) {
|
|
2530
|
+
for (const char4 of chars4) {
|
|
2531
|
+
const suffix = suffixes[count % 8];
|
|
2532
|
+
const ric = char1 + char2 + char3 + char4 + "." + suffix;
|
|
2533
|
+
const bbg = char1 + char2 + char3 + char4 + " " + suffix;
|
|
2534
|
+
const description = `${ric} description`;
|
|
2535
|
+
const currency = currencies[random(0, 4)];
|
|
2536
|
+
const isin = isinGenerator();
|
|
2537
|
+
const lotSize = lotsizes[random(0, lotsizes.length - 1)];
|
|
2538
|
+
const exchange = locations[suffix][1];
|
|
2539
|
+
const price = randomPrice();
|
|
2540
|
+
const date = (/* @__PURE__ */ new Date()).getTime();
|
|
2541
|
+
instrumentsData.push([
|
|
2542
|
+
bbg,
|
|
2543
|
+
currency,
|
|
2544
|
+
description,
|
|
2545
|
+
exchange,
|
|
2546
|
+
String(isin),
|
|
2547
|
+
lotSize,
|
|
2548
|
+
ric,
|
|
2549
|
+
price,
|
|
2550
|
+
date
|
|
2551
|
+
]);
|
|
2552
|
+
count++;
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
const getRic = (defaultRic) => {
|
|
2558
|
+
const row = instrumentsData.at(random(0, instrumentsData.length));
|
|
2559
|
+
return row?.[InstrumentColumnMap.ric] ?? defaultRic;
|
|
2560
|
+
};
|
|
2561
|
+
const instrumentsTable = new Table(
|
|
2562
|
+
schemas$2.instruments,
|
|
2563
|
+
instrumentsData,
|
|
2564
|
+
buildDataColumnMap$1(schemas$2, "instruments")
|
|
2565
|
+
);
|
|
2566
|
+
|
|
2567
|
+
const instrumentsExtendedData = instrumentsData.map(
|
|
2568
|
+
(row) => row.slice(0, -1).concat([random(0, 1) === 1, random(0, 1) === 1, (/* @__PURE__ */ new Date()).getTime()])
|
|
2569
|
+
);
|
|
2570
|
+
const instrumentsExtendedTable = new Table(
|
|
2571
|
+
schemas$2.instrumentsExtended,
|
|
2572
|
+
instrumentsExtendedData,
|
|
2573
|
+
buildDataColumnMap$1(schemas$2, "instrumentsExtended")
|
|
2574
|
+
);
|
|
2575
|
+
|
|
2576
|
+
const sides = ["BUY", "SELL"];
|
|
2577
|
+
|
|
2578
|
+
const traders = ["Trader A", "Trader B", "Trader C"];
|
|
2579
|
+
const orderStatus$1 = [
|
|
2580
|
+
"Filled",
|
|
2581
|
+
"Cancelled",
|
|
2582
|
+
"New",
|
|
2583
|
+
"Partial Exec",
|
|
2584
|
+
"Booked",
|
|
2585
|
+
"All Done"
|
|
2586
|
+
];
|
|
2587
|
+
const isComplete = (status) => ["Filled", "All Done", "Booked"].includes(status);
|
|
2588
|
+
const ordersData = [];
|
|
2589
|
+
const now = +/* @__PURE__ */ new Date();
|
|
2590
|
+
for (let i = 0; i < 100; i++) {
|
|
2591
|
+
const status = orderStatus$1[random(0, orderStatus$1.length - 1)];
|
|
2592
|
+
const ccy = currencies[random(0, currencies.length - 1)];
|
|
2593
|
+
const created = now;
|
|
2594
|
+
const lastUpdate = now;
|
|
2595
|
+
const orderId = `ORD${("0000" + i).slice(-4)}`;
|
|
2596
|
+
const quantity = random(1e3, 1e4);
|
|
2597
|
+
const filledQuantity = isComplete(status) ? quantity : status === "New" ? 0 : random(0, quantity);
|
|
2598
|
+
const ric = getRic("AAP.L");
|
|
2599
|
+
const side = sides[random(0, sides.length - 1)];
|
|
2600
|
+
const trader = traders[random(0, traders.length - 1)];
|
|
2601
|
+
ordersData.push([
|
|
2602
|
+
status,
|
|
2603
|
+
ccy,
|
|
2604
|
+
created,
|
|
2605
|
+
filledQuantity,
|
|
2606
|
+
lastUpdate,
|
|
2607
|
+
orderId,
|
|
2608
|
+
quantity,
|
|
2609
|
+
ric,
|
|
2610
|
+
side,
|
|
2611
|
+
trader
|
|
2612
|
+
]);
|
|
2613
|
+
}
|
|
2614
|
+
const ordersTable = new Table(
|
|
2615
|
+
schemas$2.orders,
|
|
2616
|
+
ordersData,
|
|
2617
|
+
buildDataColumnMap$1(schemas$2, "orders")
|
|
2618
|
+
);
|
|
2619
|
+
|
|
2620
|
+
const { bid, bidSize, ask, askSize } = buildDataColumnMap$1(schemas$2, "prices");
|
|
2621
|
+
const pricesUpdateGenerator = new BaseUpdateGenerator({
|
|
2622
|
+
bid,
|
|
2623
|
+
bidSize,
|
|
2624
|
+
ask,
|
|
2625
|
+
askSize
|
|
2626
|
+
});
|
|
2627
|
+
const requiredInstrumentFields = ["ric", "price"];
|
|
2628
|
+
const pricesData = instrumentsData.map((instrument) => {
|
|
2629
|
+
const { ric, price: priceSeed } = requiredInstrumentFields.reduce(
|
|
2630
|
+
(obj, f) => ({ ...obj, [f]: instrument[InstrumentColumnMap[f]] }),
|
|
2631
|
+
{}
|
|
2632
|
+
);
|
|
2633
|
+
const spread = random(0, 10);
|
|
2634
|
+
const ask2 = priceSeed + spread / 2;
|
|
2635
|
+
const askSize2 = random(1e3, 3e3);
|
|
2636
|
+
const bid2 = priceSeed - spread / 2;
|
|
2637
|
+
const bidSize2 = random(1e3, 3e3);
|
|
2638
|
+
const close = priceSeed + random(0, 1) / 10;
|
|
2639
|
+
const last = priceSeed + random(0, 1) / 10;
|
|
2640
|
+
const open = priceSeed + random(0, 1) / 10;
|
|
2641
|
+
const phase = "C";
|
|
2642
|
+
const scenario = "close";
|
|
2643
|
+
return [ask2, askSize2, bid2, bidSize2, close, last, open, phase, ric, scenario];
|
|
2644
|
+
});
|
|
2645
|
+
for (const [, , , lastTrade, ric] of basketConstituentData) {
|
|
2646
|
+
const priceSeed = parseFloat(String(lastTrade));
|
|
2647
|
+
if (!isNaN(priceSeed)) {
|
|
2648
|
+
const spread = random(0, 10);
|
|
2649
|
+
const ask2 = priceSeed + spread / 2;
|
|
2650
|
+
const askSize2 = random(1e3, 3e3);
|
|
2651
|
+
const bid2 = priceSeed - spread / 2;
|
|
2652
|
+
const bidSize2 = random(1e3, 3e3);
|
|
2653
|
+
const close = priceSeed + random(0, 1) / 10;
|
|
2654
|
+
const last = priceSeed + random(0, 1) / 10;
|
|
2655
|
+
const open = priceSeed + random(0, 1) / 10;
|
|
2656
|
+
const phase = "C";
|
|
2657
|
+
const scenario = "close";
|
|
2658
|
+
pricesData.push([
|
|
2659
|
+
ask2,
|
|
2660
|
+
askSize2,
|
|
2661
|
+
bid2,
|
|
2662
|
+
bidSize2,
|
|
2663
|
+
close,
|
|
2664
|
+
last,
|
|
2665
|
+
open,
|
|
2666
|
+
phase,
|
|
2667
|
+
ric,
|
|
2668
|
+
scenario
|
|
2669
|
+
]);
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
const pricesTable = new Table(
|
|
2673
|
+
schemas$2.prices,
|
|
2674
|
+
pricesData,
|
|
2675
|
+
buildDataColumnMap$1(schemas$2, "prices"),
|
|
2676
|
+
pricesUpdateGenerator
|
|
2677
|
+
);
|
|
2678
|
+
|
|
2679
|
+
const accounts = [
|
|
2680
|
+
"Account 01",
|
|
2681
|
+
"Account 02",
|
|
2682
|
+
"Account 03",
|
|
2683
|
+
"Account 04",
|
|
2684
|
+
"Account 105",
|
|
2685
|
+
"Account 06",
|
|
2686
|
+
"Account 07",
|
|
2687
|
+
"Account 08",
|
|
2688
|
+
"Account 09",
|
|
2689
|
+
"Account 10",
|
|
2690
|
+
"Account 11",
|
|
2691
|
+
"Account 12",
|
|
2692
|
+
"Account 13",
|
|
2693
|
+
"Account 14",
|
|
2694
|
+
"Account 15",
|
|
2695
|
+
"Account 16",
|
|
2696
|
+
"Account 17",
|
|
2697
|
+
"Account 18",
|
|
2698
|
+
"Account 19",
|
|
2699
|
+
"Account 20"
|
|
2700
|
+
];
|
|
2701
|
+
|
|
2702
|
+
const orderStatus = ["NEW", "CANCELLED", "FILLED"];
|
|
2703
|
+
|
|
2704
|
+
const algos = ["DARKLIQ", "IS", "SURESHOT", "VWAP", "LITLIQ", "TWAP"];
|
|
2705
|
+
|
|
2706
|
+
const childOrderData = [];
|
|
2707
|
+
const parentOrderData = [];
|
|
2708
|
+
const instrumentMap = buildDataColumnMap$1(schemas$2, "instruments");
|
|
2709
|
+
const PARENT_ORDER_COUNT = 75e3;
|
|
2710
|
+
const CHILD_ORDER_COUNT = 2e5;
|
|
2711
|
+
const avgChildOrderPerOrder = Math.round(
|
|
2712
|
+
CHILD_ORDER_COUNT / PARENT_ORDER_COUNT
|
|
2713
|
+
);
|
|
2714
|
+
const childMaxMultiple = 10;
|
|
2715
|
+
const start = performance.now();
|
|
2716
|
+
let childOrderId = 0;
|
|
2717
|
+
for (let i = 0; i < PARENT_ORDER_COUNT; i++) {
|
|
2718
|
+
const now = +/* @__PURE__ */ new Date();
|
|
2719
|
+
const instrument = instrumentsData[random(0, instrumentsData.length - 1)];
|
|
2720
|
+
const orderQuantity = 1e3 * random(1, 100);
|
|
2721
|
+
const orderStatus$1 = orderStatus[random(0, orderStatus.length - 1)];
|
|
2722
|
+
const filledQty = orderStatus$1 === "FILLED" ? orderQuantity : orderStatus$1 === "NEW" ? 0 : orderQuantity - random(100, orderQuantity);
|
|
2723
|
+
const openQty = orderQuantity - filledQty;
|
|
2724
|
+
const account = accounts[random(0, accounts.length - 1)];
|
|
2725
|
+
const algo = algos[random(0, algos.length - 1)];
|
|
2726
|
+
const averagePrice = 0;
|
|
2727
|
+
const ccy = "GBP";
|
|
2728
|
+
const exchange = instrument[instrumentMap.exchange];
|
|
2729
|
+
const parentOrderIdAsInt = i;
|
|
2730
|
+
const parentOrderId = `${parentOrderIdAsInt}`;
|
|
2731
|
+
const lastUpdate = now;
|
|
2732
|
+
const price = 100;
|
|
2733
|
+
const quantity = orderQuantity;
|
|
2734
|
+
const ric = instrument[instrumentMap.ric];
|
|
2735
|
+
const side = sides[random(0, sides.length - 1)];
|
|
2736
|
+
const status = orderStatus$1;
|
|
2737
|
+
const volLimit = 100;
|
|
2738
|
+
const childOrderCount = random(
|
|
2739
|
+
0,
|
|
2740
|
+
avgChildOrderPerOrder * random(1, childMaxMultiple)
|
|
2741
|
+
);
|
|
2742
|
+
let remainingQty = orderQuantity;
|
|
2743
|
+
for (let j = 0; j < childOrderCount; j++) {
|
|
2744
|
+
const childOrderQuantity = Math.round(remainingQty / (childOrderCount - j));
|
|
2745
|
+
remainingQty -= childOrderQuantity;
|
|
2746
|
+
const childOrderStatus = orderStatus[random(0, orderStatus.length - 1)];
|
|
2747
|
+
const childFilledQty = orderStatus$1 === "FILLED" ? childOrderQuantity : childOrderStatus === "NEW" ? 0 : childOrderQuantity - random(100, childOrderQuantity);
|
|
2748
|
+
const childOpenQty = childOrderQuantity - childFilledQty;
|
|
2749
|
+
const averagePrice2 = 0;
|
|
2750
|
+
const childIdAsInt = childOrderId++;
|
|
2751
|
+
const childId = `${childIdAsInt}`;
|
|
2752
|
+
const lastUpdate2 = 0;
|
|
2753
|
+
const price2 = 100;
|
|
2754
|
+
const strategy = 0;
|
|
2755
|
+
const row2 = [
|
|
2756
|
+
account,
|
|
2757
|
+
averagePrice2,
|
|
2758
|
+
ccy,
|
|
2759
|
+
exchange,
|
|
2760
|
+
childFilledQty,
|
|
2761
|
+
childId,
|
|
2762
|
+
childIdAsInt,
|
|
2763
|
+
lastUpdate2,
|
|
2764
|
+
childOpenQty,
|
|
2765
|
+
parentOrderId,
|
|
2766
|
+
price2,
|
|
2767
|
+
childOrderQuantity,
|
|
2768
|
+
ric,
|
|
2769
|
+
side,
|
|
2770
|
+
childOrderStatus,
|
|
2771
|
+
strategy,
|
|
2772
|
+
volLimit
|
|
2773
|
+
];
|
|
2774
|
+
childOrderData.push(row2);
|
|
2775
|
+
}
|
|
2776
|
+
const row = [
|
|
2777
|
+
account,
|
|
2778
|
+
algo,
|
|
2779
|
+
averagePrice,
|
|
2780
|
+
ccy,
|
|
2781
|
+
childOrderCount,
|
|
2782
|
+
exchange,
|
|
2783
|
+
filledQty,
|
|
2784
|
+
parentOrderId,
|
|
2785
|
+
parentOrderIdAsInt,
|
|
2786
|
+
lastUpdate,
|
|
2787
|
+
openQty,
|
|
2788
|
+
price,
|
|
2789
|
+
quantity,
|
|
2790
|
+
ric,
|
|
2791
|
+
side,
|
|
2792
|
+
status,
|
|
2793
|
+
volLimit
|
|
2794
|
+
];
|
|
2795
|
+
parentOrderData.push(row);
|
|
2796
|
+
}
|
|
2797
|
+
const end = performance.now();
|
|
2798
|
+
console.log(
|
|
2799
|
+
`took ${end - start} to create ${parentOrderData.length} orders and ${childOrderData.length} child orders`
|
|
2800
|
+
);
|
|
2801
|
+
const parentOrdersTable = new Table(
|
|
2802
|
+
schemas$2.parentOrders,
|
|
2803
|
+
parentOrderData,
|
|
2804
|
+
buildDataColumnMap$1(schemas$2, "parentOrders")
|
|
2805
|
+
);
|
|
2806
|
+
const childOrdersTable = new Table(
|
|
2807
|
+
schemas$2.childOrders,
|
|
2808
|
+
childOrderData,
|
|
2809
|
+
buildDataColumnMap$1(schemas$2, "childOrders")
|
|
2810
|
+
);
|
|
2811
|
+
|
|
2812
|
+
const undefinedTables = {
|
|
2813
|
+
childOrders: void 0,
|
|
2814
|
+
instruments: void 0,
|
|
2815
|
+
instrumentsExtended: void 0,
|
|
2816
|
+
instrumentPrices: void 0,
|
|
2817
|
+
orders: void 0,
|
|
2818
|
+
parentOrders: void 0,
|
|
2819
|
+
prices: void 0
|
|
2820
|
+
};
|
|
2821
|
+
const tables$1 = {
|
|
2822
|
+
childOrders: childOrdersTable,
|
|
2823
|
+
instruments: instrumentsTable,
|
|
2824
|
+
instrumentsExtended: instrumentsExtendedTable,
|
|
2825
|
+
instrumentPrices: joinTables(
|
|
2826
|
+
{ module: "SIMUL", table: "instrumentPrices" },
|
|
2827
|
+
instrumentsTable,
|
|
2828
|
+
pricesTable,
|
|
2829
|
+
"ric"
|
|
2830
|
+
),
|
|
2831
|
+
orders: ordersTable,
|
|
2832
|
+
parentOrders: parentOrdersTable,
|
|
2833
|
+
prices: pricesTable
|
|
2834
|
+
};
|
|
2835
|
+
const vuuLinks = {
|
|
2836
|
+
...undefinedTables,
|
|
2837
|
+
childOrders: [
|
|
2838
|
+
{ fromColumn: "parentOrderId", toColumn: "id", toTable: "parentOrders" }
|
|
2839
|
+
],
|
|
2840
|
+
parentOrders: [
|
|
2841
|
+
{ fromColumn: "ric", toColumn: "ric", toTable: "instruments" }
|
|
2842
|
+
]
|
|
2843
|
+
};
|
|
2844
|
+
const menus = {
|
|
2845
|
+
childOrders: void 0,
|
|
2846
|
+
instruments: {
|
|
2847
|
+
name: "ROOT",
|
|
2848
|
+
menus: [
|
|
2849
|
+
{
|
|
2850
|
+
context: "selected-rows",
|
|
2851
|
+
filter: "",
|
|
2852
|
+
name: "Add Instruments To Order",
|
|
2853
|
+
rpcName: "ADD_INSTRUMENTS_TO_ORDER"
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
context: "selected-rows",
|
|
2857
|
+
filter: "",
|
|
2858
|
+
name: "Edit Row",
|
|
2859
|
+
rpcName: "EDIT_ROW"
|
|
2860
|
+
},
|
|
2861
|
+
{
|
|
2862
|
+
context: "selected-rows",
|
|
2863
|
+
filter: "",
|
|
2864
|
+
name: "Edit Rows",
|
|
2865
|
+
rpcName: "VP_BULK_EDIT_BEGIN_RPC"
|
|
2866
|
+
}
|
|
2867
|
+
]
|
|
2868
|
+
},
|
|
2869
|
+
instrumentsExtended: void 0,
|
|
2870
|
+
instrumentPrices: void 0,
|
|
2871
|
+
orders: {
|
|
2872
|
+
name: "ROOT",
|
|
2873
|
+
menus: [
|
|
2874
|
+
{
|
|
2875
|
+
context: "row",
|
|
2876
|
+
filter: `status in ["New","Partial Exec"]`,
|
|
2877
|
+
name: "Cancel Order",
|
|
2878
|
+
rpcName: "CANCEL_ORDER"
|
|
2879
|
+
}
|
|
2880
|
+
]
|
|
2881
|
+
},
|
|
2882
|
+
parentOrders: void 0,
|
|
2883
|
+
prices: void 0
|
|
2884
|
+
};
|
|
2885
|
+
const cancelOrder = async (rpcRequest) => {
|
|
2886
|
+
if (vuuUtils.isVuuMenuRpcRequest(rpcRequest)) {
|
|
2887
|
+
const { rowKey, vpId } = rpcRequest;
|
|
2888
|
+
const table = tables$1.orders;
|
|
2889
|
+
const row = table.findByKey(rowKey);
|
|
2890
|
+
row[table.map.status] = "Cancelled";
|
|
2891
|
+
table.updateRow(row);
|
|
2892
|
+
return {
|
|
2893
|
+
action: {
|
|
2894
|
+
type: "SHOW_NOTIFICATION_ACTION",
|
|
2895
|
+
message: `Order id: ${rowKey}`,
|
|
2896
|
+
title: "Order cancelled"
|
|
2897
|
+
},
|
|
2898
|
+
rpcName: "CANCEL_ORDER",
|
|
2899
|
+
type: "VIEW_PORT_MENU_RESP",
|
|
2900
|
+
vpId
|
|
2901
|
+
};
|
|
2902
|
+
} else {
|
|
2903
|
+
throw Error("cancelOrder invalid rpcRequest");
|
|
2904
|
+
}
|
|
2905
|
+
};
|
|
2906
|
+
const services = {
|
|
2907
|
+
...undefinedTables,
|
|
2908
|
+
orders: [
|
|
2909
|
+
{
|
|
2910
|
+
rpcName: "CANCEL_ORDER",
|
|
2911
|
+
service: cancelOrder
|
|
2912
|
+
}
|
|
2913
|
+
]
|
|
2914
|
+
};
|
|
2915
|
+
const simulModule = new SimulModule({
|
|
2916
|
+
menus,
|
|
2917
|
+
name: "SIMUL",
|
|
2918
|
+
schemas: schemas$2,
|
|
2919
|
+
services,
|
|
2920
|
+
tables: tables$1,
|
|
2921
|
+
vuuLinks
|
|
2922
|
+
});
|
|
2923
|
+
|
|
2924
|
+
const { RowGenerator } = defaultGenerators;
|
|
2925
|
+
const manyColumnGenerator = RowGenerator(
|
|
2926
|
+
schemas$1.TwoHundredColumns.columns.map((c) => c.name)
|
|
2927
|
+
);
|
|
2928
|
+
const tables = {
|
|
2929
|
+
TwoHundredColumns: new Table(
|
|
2930
|
+
schemas$1.TwoHundredColumns,
|
|
2931
|
+
new Array(100).fill(1).map((_, i) => manyColumnGenerator(i)),
|
|
2932
|
+
buildDataColumnMap$1(schemas$1, "TwoHundredColumns")
|
|
2933
|
+
)
|
|
2934
|
+
};
|
|
2935
|
+
const testModule = new VuuModule({
|
|
2936
|
+
name: "TEST",
|
|
2937
|
+
schemas: schemas$1,
|
|
2938
|
+
tables
|
|
2939
|
+
});
|
|
2940
|
+
|
|
2941
|
+
const vuuModules = {
|
|
2942
|
+
BASKET: basketModule,
|
|
2943
|
+
SIMUL: simulModule,
|
|
2944
|
+
TEST: testModule
|
|
2945
|
+
};
|
|
2946
|
+
const vuuModule = (moduleName) => vuuModules[moduleName];
|
|
2947
|
+
|
|
2948
|
+
const serverAPI = {
|
|
2949
|
+
getTableList: async () => {
|
|
2950
|
+
return {
|
|
2951
|
+
tables: Object.values(schemas$2).concat(Object.values(schemas$3)).map((schema) => schema.table)
|
|
2952
|
+
};
|
|
2953
|
+
},
|
|
2954
|
+
getTableSchema: async (vuuTable) => {
|
|
2955
|
+
if (isSimulTable(vuuTable)) {
|
|
2956
|
+
return schemas$2[vuuTable.table];
|
|
2957
|
+
} else if (isBasketTable(vuuTable)) {
|
|
2958
|
+
return schemas$3[vuuTable.table];
|
|
2959
|
+
} else {
|
|
2960
|
+
throw Error(
|
|
2961
|
+
`unsupported module/table ${vuuTable.module}/${vuuTable.table}`
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
rpcCall: async (message) => {
|
|
2966
|
+
if (message.type === "RPC_CALL" && message.service === "TypeAheadRpcHandler") {
|
|
2967
|
+
const [vuuTable] = message.params;
|
|
2968
|
+
if (isSimulTable(vuuTable)) {
|
|
2969
|
+
const typeahead = simulModule.typeaheadHook();
|
|
2970
|
+
return typeahead(message.params);
|
|
2971
|
+
} else if (isBasketTable(vuuTable)) {
|
|
2972
|
+
const typeahead = basketModule.typeaheadHook();
|
|
2973
|
+
return typeahead(message.params);
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
throw Error("LocalDataSource provider only handles TypeAhead rpc calls");
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
const getServerAPI = async () => serverAPI;
|
|
2980
|
+
class VuuDataSource {
|
|
2981
|
+
constructor({
|
|
2982
|
+
aggregations,
|
|
2983
|
+
columns,
|
|
2984
|
+
filterSpec,
|
|
2985
|
+
groupBy,
|
|
2986
|
+
sort,
|
|
2987
|
+
table,
|
|
2988
|
+
viewport,
|
|
2989
|
+
visualLink
|
|
2990
|
+
}) {
|
|
2991
|
+
const config = {
|
|
2992
|
+
aggregations,
|
|
2993
|
+
columns,
|
|
2994
|
+
filterSpec,
|
|
2995
|
+
groupBy,
|
|
2996
|
+
sort,
|
|
2997
|
+
visualLink
|
|
2998
|
+
};
|
|
2999
|
+
if (isSimulTable(table)) {
|
|
3000
|
+
return simulModule.createDataSource(table.table, viewport, config);
|
|
3001
|
+
} else if (isBasketTable(table)) {
|
|
3002
|
+
return basketModule.createDataSource(table.table, viewport, config);
|
|
3003
|
+
} else {
|
|
3004
|
+
throw Error(`unsupported module/table ${table.module}/${table.table}`);
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
const LocalDataSourceProvider = ({
|
|
3009
|
+
children
|
|
3010
|
+
}) => {
|
|
3011
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3012
|
+
vuuUtils.DataProvider,
|
|
3013
|
+
{
|
|
3014
|
+
VuuDataSource,
|
|
3015
|
+
getServerAPI,
|
|
3016
|
+
children
|
|
3017
|
+
}
|
|
3018
|
+
);
|
|
3019
|
+
};
|
|
3020
|
+
|
|
3021
|
+
exports.ArrayProxy = ArrayProxy;
|
|
3022
|
+
exports.DefaultColumnGenerator = DefaultColumnGenerator;
|
|
3023
|
+
exports.DefaultRowGenerator = DefaultRowGenerator;
|
|
3024
|
+
exports.LocalDataSourceProvider = LocalDataSourceProvider;
|
|
3025
|
+
exports.Table = Table;
|
|
3026
|
+
exports.TickingArrayDataSource = TickingArrayDataSource;
|
|
3027
|
+
exports.VuuModule = VuuModule;
|
|
3028
|
+
exports.basketModule = basketModule;
|
|
3029
|
+
exports.basketSchemas = schemas$3;
|
|
3030
|
+
exports.buildDataColumnMap = buildDataColumnMap$1;
|
|
3031
|
+
exports.buildDataColumnMapFromSchema = buildDataColumnMapFromSchema;
|
|
3032
|
+
exports.createBasketTradingRow = createBasketTradingRow;
|
|
3033
|
+
exports.defaultGenerators = defaultGenerators;
|
|
3034
|
+
exports.getAllSchemas = getAllSchemas;
|
|
3035
|
+
exports.getColumnAndRowGenerator = getColumnAndRowGenerator;
|
|
3036
|
+
exports.getSchema = getSchema;
|
|
3037
|
+
exports.isBasketTable = isBasketTable;
|
|
3038
|
+
exports.isSimulTable = isSimulTable;
|
|
3039
|
+
exports.joinTables = joinTables;
|
|
3040
|
+
exports.makeSuggestions = makeSuggestions;
|
|
3041
|
+
exports.populateArray = populateArray;
|
|
3042
|
+
exports.schemas = schemas;
|
|
3043
|
+
exports.simulModule = simulModule;
|
|
3044
|
+
exports.simulSchemas = schemas$2;
|
|
3045
|
+
exports.tables = tables$2;
|
|
3046
|
+
exports.testModule = testModule;
|
|
3047
|
+
exports.vuuModule = vuuModule;
|
|
3048
|
+
exports.withNamedParams = withNamedParams;
|
|
3049
|
+
exports.withParams = withParams;
|
|
49
3050
|
//# sourceMappingURL=index.js.map
|