Task/ignore nested ETFs when fetching top holdings in Yahoo Finance service (#6319)

* Ignore nested ETFs in top holdings

* Update changelog
pull/5799/merge
Thomas Kaul 4 days ago committed by GitHub
parent c489a1cc00
commit 8a98c0a3f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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 ?? []

Loading…
Cancel
Save