aiden-shared-calculations-unified 1.0.88 → 1.0.89

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.
@@ -56,7 +56,7 @@ class AssetPnlStatus {
56
56
  if (pnl === 0) continue;
57
57
 
58
58
  const ticker = mappings.instrumentToTicker[instId];
59
- const sector = mappings.sectorMapping[instId];
59
+ const sector = mappings.instrumentToSector[instId];
60
60
  const isWinner = pnl > 0;
61
61
 
62
62
  if (ticker) {
@@ -57,7 +57,7 @@ class AssetPositionSize {
57
57
  if (!instId) continue;
58
58
 
59
59
  const ticker = mappings.instrumentToTicker[instId];
60
- const sector = mappings.sectorMapping[instId];
60
+ const sector = mappings.instrumentToSector[instId];
61
61
 
62
62
  if (ticker) {
63
63
  this._init(this.tickerBuckets, ticker);
@@ -42,7 +42,7 @@ class AverageDailyPnlPerSector {
42
42
  process(context) {
43
43
  const { extract } = context.math;
44
44
  const { mappings, user } = context;
45
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
45
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
46
46
 
47
47
  const positions = extract.getPositions(user.portfolio.today, user.type);
48
48
  const userSectorPnL = new Map();
@@ -41,7 +41,7 @@ class PlatformOwnershipPerSector {
41
41
  process(context) {
42
42
  const { extract } = context.math;
43
43
  const { mappings, user } = context;
44
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
44
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
45
45
 
46
46
  const positions = extract.getPositions(user.portfolio.today, user.type);
47
47
 
@@ -42,7 +42,7 @@ class ProfitabilityRatioPerSector {
42
42
  process(context) {
43
43
  const { extract } = context.math;
44
44
  const { mappings, user } = context;
45
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
45
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
46
46
 
47
47
  const positions = extract.getPositions(user.portfolio.today, user.type);
48
48
 
@@ -41,7 +41,7 @@ class SpeculatorLeveragePerSector {
41
41
  process(context) {
42
42
  const { extract } = context.math;
43
43
  const { mappings, user } = context;
44
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
44
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
45
45
 
46
46
  const positions = extract.getPositions(user.portfolio.today, user.type);
47
47
 
@@ -46,7 +46,7 @@ class SpeculatorSLDistanceSectorBreakdown {
46
46
  process(context) {
47
47
  const { extract } = context.math;
48
48
  const { mappings, user } = context;
49
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
49
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
50
50
 
51
51
  const positions = extract.getPositions(user.portfolio.today, user.type);
52
52
 
@@ -41,7 +41,7 @@ class TotalLongPerSector {
41
41
  process(context) {
42
42
  const { extract } = context.math;
43
43
  const { mappings, user } = context;
44
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
44
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
45
45
 
46
46
  const positions = extract.getPositions(user.portfolio.today, user.type);
47
47
 
@@ -41,7 +41,7 @@ class TotalShortPerSector {
41
41
  process(context) {
42
42
  const { extract } = context.math;
43
43
  const { mappings, user } = context;
44
- if (!this.sectorMap) this.sectorMap = mappings.sectorMapping;
44
+ if (!this.sectorMap) this.sectorMap = mappings.instrumentToSector;
45
45
 
46
46
  const positions = extract.getPositions(user.portfolio.today, user.type);
47
47
 
@@ -50,7 +50,7 @@ class RiskAppetiteIndex {
50
50
 
51
51
  if (!this.tickerMap) {
52
52
  this.tickerMap = mappings.instrumentToTicker;
53
- this.sectorMap = mappings.sectorMapping;
53
+ this.sectorMap = mappings.instrumentToSector;
54
54
  }
55
55
 
56
56
  const positions = extract.getPositions(user.portfolio.today, user.type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [