@sonarwatch/portfolio-core 0.16.107 → 0.16.110

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/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.16.110](https://github.com/sonarwatch/portfolio/compare/core-0.16.109...core-0.16.110) (2026-01-06)
6
+
7
+
8
+
9
+ ## [0.16.109](https://github.com/sonarwatch/portfolio/compare/core-0.16.108...core-0.16.109) (2026-01-06)
10
+
11
+
12
+
13
+ ## [0.16.108](https://github.com/sonarwatch/portfolio/compare/core-0.16.107...core-0.16.108) (2026-01-06)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **core:** dont use isProtocoleSource in getPriceInfoFromSources ([108e944](https://github.com/sonarwatch/portfolio/commit/108e944794b4a2f12a0cea48af0ec77760642c2f))
19
+ * **core:** prioritize first source directly in getPriceFromSources ([578ff9d](https://github.com/sonarwatch/portfolio/commit/578ff9d319c24ec9abe8c5e85aab30c760c1ca37))
20
+ * **plugins:** field is now addToMissingToken ([ac0ae37](https://github.com/sonarwatch/portfolio/commit/ac0ae37871edc1298fecc649a532d8e277c23eec))
21
+
22
+
23
+ ### Features
24
+
25
+ * **core:** update TokenPrice comment for missing tokens ([1ba1265](https://github.com/sonarwatch/portfolio/commit/1ba126554aab4bbf6c4374612ce372e4d7b1e3d4))
26
+ * **plugins:** unify and prioritize token price sources with isProtocolSource flag ([3be53c7](https://github.com/sonarwatch/portfolio/commit/3be53c75943c837fc18da7cee05cd75f6502016a))
27
+
28
+
29
+
30
+ ## [0.16.108](https://github.com/sonarwatch/portfolio/compare/core-0.16.107...core-0.16.108) (2026-01-06)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **core:** dont use isProtocoleSource in getPriceInfoFromSources ([108e944](https://github.com/sonarwatch/portfolio/commit/108e944794b4a2f12a0cea48af0ec77760642c2f))
36
+ * **core:** prioritize first source directly in getPriceFromSources ([578ff9d](https://github.com/sonarwatch/portfolio/commit/578ff9d319c24ec9abe8c5e85aab30c760c1ca37))
37
+ * **plugins:** field is now addToMissingToken ([ac0ae37](https://github.com/sonarwatch/portfolio/commit/ac0ae37871edc1298fecc649a532d8e277c23eec))
38
+
39
+
40
+ ### Features
41
+
42
+ * **core:** update TokenPrice comment for missing tokens ([1ba1265](https://github.com/sonarwatch/portfolio/commit/1ba126554aab4bbf6c4374612ce372e4d7b1e3d4))
43
+ * **plugins:** unify and prioritize token price sources with isProtocolSource flag ([3be53c7](https://github.com/sonarwatch/portfolio/commit/3be53c75943c837fc18da7cee05cd75f6502016a))
44
+
45
+
46
+
5
47
  ## [0.16.107](https://github.com/sonarwatch/portfolio/compare/core-0.16.106...core-0.16.107) (2026-01-05)
6
48
 
7
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-core",
3
- "version": "0.16.107",
3
+ "version": "0.16.110",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "repository": {
@@ -48,6 +48,10 @@ export type TokenPriceSource = {
48
48
  timestamp: number;
49
49
  sourceRefs?: SourceRef[];
50
50
  link?: string;
51
+ /**
52
+ * Token will be added to the missing tokens list, and price will be sent to datapi
53
+ */
54
+ addToMissingToken?: boolean;
51
55
  };
52
56
  export type TokenPrice = {
53
57
  address: string;
@@ -70,6 +74,7 @@ export declare function pushTokenPriceSource(sources: TokenPriceSource[], source
70
74
  export declare function updateTokenPriceSources(sources: TokenPriceSource[]): TokenPriceSource[] | undefined;
71
75
  export declare function getTokenPriceUnderlyingFromTokenPrice(tokenPrice: TokenPrice, amountPerLp: number): TokenPriceUnderlying;
72
76
  export declare function getTokenPricesUnderlyingsFromTokensPrices(tokensPrices: TokenPrice[], amountsPerLp: number[]): TokenPriceUnderlying[];
77
+ export declare function getHighestPrioritisedSource(sources: TokenPriceSource[]): TokenPriceSource | undefined;
73
78
  /**
74
79
  * Get the price information from a list of sources.
75
80
  * The price is determined by prioritising sources present in the prioritisedSourceIds list
@@ -79,4 +84,5 @@ export declare function getTokenPricesUnderlyingsFromTokensPrices(tokensPrices:
79
84
  export declare function getPriceInfoFromSources(sources: TokenPriceSource[]): {
80
85
  price: number;
81
86
  priceChange24h?: number;
87
+ timestamp: number;
82
88
  };
package/src/TokenPrice.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPriceInfoFromSources = exports.getTokenPricesUnderlyingsFromTokensPrices = exports.getTokenPriceUnderlyingFromTokenPrice = exports.updateTokenPriceSources = exports.pushTokenPriceSource = exports.tokenPriceFromSources = exports.tokenPriceSourceTtl = exports.prioritisedSourceIds = exports.flashSourceId = exports.solvSourceId = exports.jupiterSourceId = exports.coingeckoSourceId = exports.piggyBankSourceId = exports.xStakingSourceId = exports.sandglassSourceId = exports.usdcPlusSourceId = exports.rainSourceId = exports.xOrcaSourceId = exports.jupLendSourceId = exports.jitoSourceId = exports.fragmetricSourceId = exports.fragmetricApiSourceId = exports.exponentSourceId = exports.adrenaSourceId = exports.adrasteaSourceId = exports.hyloSourceId = void 0;
3
+ exports.getPriceInfoFromSources = exports.getHighestPrioritisedSource = exports.getTokenPricesUnderlyingsFromTokensPrices = exports.getTokenPriceUnderlyingFromTokenPrice = exports.updateTokenPriceSources = exports.pushTokenPriceSource = exports.tokenPriceFromSources = exports.tokenPriceSourceTtl = exports.prioritisedSourceIds = exports.flashSourceId = exports.solvSourceId = exports.jupiterSourceId = exports.coingeckoSourceId = exports.piggyBankSourceId = exports.xStakingSourceId = exports.sandglassSourceId = exports.usdcPlusSourceId = exports.rainSourceId = exports.xOrcaSourceId = exports.jupLendSourceId = exports.jitoSourceId = exports.fragmetricSourceId = exports.fragmetricApiSourceId = exports.exponentSourceId = exports.adrenaSourceId = exports.adrasteaSourceId = exports.hyloSourceId = void 0;
4
4
  const helpers_1 = require("./helpers");
5
5
  const constants_1 = require("./constants");
6
6
  exports.hyloSourceId = 'hylo-tokens-pricing';
@@ -42,8 +42,8 @@ exports.prioritisedSourceIds = [
42
42
  exports.xStakingSourceId,
43
43
  exports.piggyBankSourceId,
44
44
  exports.flashSourceId,
45
- exports.jupiterSourceId,
46
45
  exports.solvSourceId,
46
+ exports.jupiterSourceId,
47
47
  // Always leave coingeckoSourceId at the end to use it as fallback
48
48
  exports.coingeckoSourceId,
49
49
  ];
@@ -69,7 +69,7 @@ function tokenPriceFromSources(sources) {
69
69
  return current;
70
70
  return prev;
71
71
  });
72
- const { price, priceChange24h } = getPriceInfoFromSources(updatedSources);
72
+ const { price, priceChange24h, timestamp } = getPriceInfoFromSources(updatedSources);
73
73
  return {
74
74
  address: displaySource.address,
75
75
  networkId: displaySource.networkId,
@@ -81,9 +81,9 @@ function tokenPriceFromSources(sources) {
81
81
  link: displaySource.link,
82
82
  decimals: displaySource.decimals,
83
83
  sourceRefs: displaySource.sourceRefs,
84
- price: price,
84
+ price,
85
85
  priceChange24h,
86
- timestamp: Date.now(),
86
+ timestamp,
87
87
  sources: updatedSources,
88
88
  };
89
89
  }
@@ -136,6 +136,29 @@ function getTokenPricesUnderlyingsFromTokensPrices(tokensPrices, amountsPerLp) {
136
136
  }));
137
137
  }
138
138
  exports.getTokenPricesUnderlyingsFromTokensPrices = getTokenPricesUnderlyingsFromTokensPrices;
139
+ function getWeightedPriceFromSources(sources) {
140
+ const [priceSum, weightSum] = sources.reduce(([cPriceSum, cWeightSum], source) => [
141
+ cPriceSum + source.price * source.weight,
142
+ cWeightSum + source.weight,
143
+ ], [0, 0]);
144
+ return weightSum === 0 ? 0 : priceSum / weightSum;
145
+ }
146
+ function getHighestPrioritisedSource(sources) {
147
+ for (const priorityId of exports.prioritisedSourceIds) {
148
+ const source = sources.find((s) => s.id === priorityId);
149
+ if (source)
150
+ return source;
151
+ }
152
+ return undefined;
153
+ }
154
+ exports.getHighestPrioritisedSource = getHighestPrioritisedSource;
155
+ function getOldestTimestamp(sources) {
156
+ if (sources.length === 0)
157
+ return Date.now();
158
+ return sources.reduce((oldest, source) => {
159
+ return source.timestamp < oldest ? source.timestamp : oldest;
160
+ }, Date.now());
161
+ }
139
162
  /**
140
163
  * Get the price information from a list of sources.
141
164
  * The price is determined by prioritising sources present in the prioritisedSourceIds list
@@ -143,44 +166,16 @@ exports.getTokenPricesUnderlyingsFromTokensPrices = getTokenPricesUnderlyingsFro
143
166
  * @sources : list of TokenPriceSources
144
167
  */
145
168
  function getPriceInfoFromSources(sources) {
146
- const prioritisedSources = [];
147
- let price;
148
- let priceChange24h;
149
- sources.forEach((s) => {
150
- if (exports.prioritisedSourceIds.includes(s.id)) {
151
- prioritisedSources.push(s);
152
- }
153
- // Get jupiter price change 24h if available
154
- if (s.id === exports.jupiterSourceId) {
155
- priceChange24h = s.priceChange24h;
156
- }
157
- });
158
- const [priceSum, weightSum] = sources.reduce(([cPriceSum, cWeightSum], source) => [
159
- cPriceSum + source.price * source.weight,
160
- cWeightSum + source.weight,
161
- ], [0, 0]);
162
- price = weightSum === 0 ? 0 : priceSum / weightSum;
163
- // If there is no high priority sources, return the weighted average of all sources price
164
- if (!prioritisedSources)
165
- return {
166
- price,
167
- priceChange24h,
168
- };
169
- // Else, find the highest priority source available and use its price
170
- let highestPrioritySource;
171
- let highestSourceIndex = Number.MAX_SAFE_INTEGER;
172
- for (const prioritySource of prioritisedSources) {
173
- const sourceIndex = exports.prioritisedSourceIds.indexOf(prioritySource.id);
174
- if (sourceIndex !== -1 && sourceIndex < highestSourceIndex) {
175
- highestPrioritySource = prioritySource;
176
- highestSourceIndex = sourceIndex;
177
- }
178
- }
179
- if (highestPrioritySource)
180
- price = highestPrioritySource.price;
169
+ const firstPrioritisedSource = getHighestPrioritisedSource(sources);
170
+ const jupiterSource = sources.find((s) => s.id === exports.jupiterSourceId);
181
171
  return {
182
- price,
183
- priceChange24h,
172
+ price: firstPrioritisedSource
173
+ ? firstPrioritisedSource.price
174
+ : getWeightedPriceFromSources(sources),
175
+ priceChange24h: jupiterSource ? jupiterSource.priceChange24h : undefined,
176
+ timestamp: firstPrioritisedSource
177
+ ? firstPrioritisedSource.timestamp
178
+ : getOldestTimestamp(sources),
184
179
  };
185
180
  }
186
181
  exports.getPriceInfoFromSources = getPriceInfoFromSources;
@@ -1 +1 @@
1
- {"version":3,"file":"TokenPrice.js","sourceRoot":"","sources":["../../../../packages/core/src/TokenPrice.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AACtC,2CAAqD;AAGxC,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,gBAAgB,GAAG,sBAAsB,CAAC;AAC1C,QAAA,cAAc,GAAG,sBAAsB,CAAC;AACxC,QAAA,gBAAgB,GAAG,wBAAwB,CAAC;AAC5C,QAAA,qBAAqB,GAAG,wBAAwB,CAAC;AACjD,QAAA,kBAAkB,GAAG,iCAAiC,CAAC;AACvD,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,eAAe,GAAG,yBAAyB,CAAC;AAC5C,QAAA,aAAa,GAAG,gBAAgB,CAAC;AACjC,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,gBAAgB,GAAG,2BAA2B,CAAC;AAC/C,QAAA,iBAAiB,GAAG,2BAA2B,CAAC;AAChD,QAAA,gBAAgB,GAAG,mBAAmB,CAAC;AACvC,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AACzC,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAChC,QAAA,eAAe,GAAG,gBAAgB,CAAC;AACnC,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,aAAa,GAAG,aAAa,CAAC;AAC3C;;;;GAIG;AACU,QAAA,oBAAoB,GAAa;IAC5C,oBAAY;IACZ,wBAAgB;IAChB,sBAAc;IACd,wBAAgB;IAChB,6BAAqB;IACrB,0BAAkB;IAClB,oBAAY;IACZ,uBAAe;IACf,qBAAa;IACb,oBAAY;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