Browse Source
Task/ignore nested ETFs when fetching top holdings in Yahoo Finance service (#6319)
* Ignore nested ETFs in top holdings
* Update changelog
pull/6322/head
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
4 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
|
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Ignored nested ETFs when fetching top holdings for ETF and mutual fund assets from _Yahoo Finance_ |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Added the missing `valueInBaseCurrency` to the response of the import activities endpoint |
|
|
|
|
|
|
|
@ -207,14 +207,16 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
|
|
|
|
|
if (['ETF', 'MUTUALFUND'].includes(assetSubClass)) { |
|
|
|
response.holdings = |
|
|
|
assetProfile.topHoldings?.holdings?.map( |
|
|
|
({ holdingName, holdingPercent }) => { |
|
|
|
assetProfile.topHoldings?.holdings |
|
|
|
?.filter(({ holdingName }) => { |
|
|
|
return !holdingName?.includes('ETF'); |
|
|
|
}) |
|
|
|
?.map(({ holdingName, holdingPercent }) => { |
|
|
|
return { |
|
|
|
name: this.formatName({ longName: holdingName }), |
|
|
|
weight: holdingPercent |
|
|
|
}; |
|
|
|
} |
|
|
|
) ?? []; |
|
|
|
}) ?? []; |
|
|
|
|
|
|
|
response.sectors = ( |
|
|
|
assetProfile.topHoldings?.sectorWeightings ?? [] |
|
|
|
|