Browse Source
Merge pull request #23 from dandevaud/feature/better-data-enhancing-handling
Better trackinsight inaccuracy handling
pull/5027/head
dandevaud
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
5 deletions
-
apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts
|
|
@ -26,9 +26,7 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { |
|
|
|
response: Partial<SymbolProfile>; |
|
|
|
symbol: string; |
|
|
|
}): Promise<Partial<SymbolProfile>> { |
|
|
|
if ( |
|
|
|
!(response.assetClass === 'EQUITY' && response.assetSubClass === 'ETF') |
|
|
|
) { |
|
|
|
if (!(response.assetSubClass === 'ETF')) { |
|
|
|
return response; |
|
|
|
} |
|
|
|
|
|
|
@ -70,8 +68,8 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (holdings?.weight < 0.95) { |
|
|
|
// Skip if data is inaccurate
|
|
|
|
if (holdings?.weight < 1 - Math.min(holdings?.count * 0.000015, 0.95)) { |
|
|
|
// Skip if data is inaccurate, dependent on holdings count there might be rounding issues
|
|
|
|
return response; |
|
|
|
} |
|
|
|
|
|
|
|