Anatoly Popov
fc5611d19c
feat: support security from MOEX via MOEX api
**Justification**
My main portfolio is on MOEX, so I need a way to manage it. Ghostfolio looks
cool but there's no way to proper manage assets on MOEX. So, first I've found
`moex-iss-api` npm package. Turns out it needed some help, so couple of PR
there. After that I was ready to work on ghostfolio.
This commit implements full `DataProviderInterface` spec:
- Disabled by default, so only those who need it would enabled it.
- We `canHandle` all symbols
- We aren't premium feature
- `getQuotes`, `getHistorical` and `search` were pretty straightforward
- `getTestSymbol` return `SBER` because if something happens to `SBER` stocks
then MOEX would definetely doesn't matter anymore for sometime.
- `getAssetProfile` and `getDividends` proved to be tricky to implement, so
I'll cover them below separately.
**getAssetProfile**
**Currency**
This is main method to get info about assets. Unfortunately, due to fall of
USSR and ruble denomination in 1998, we have three currency tickers: 'RUR',
'SUR', 'RUB' For convenience we use 'RUB' instead of all of them. I don't see
practical value to differentiate between them here, but I'm open to suggestions.
Also, some of the tickers do not return currency in which they're listed on
MOEX. Assumed that it's also 'RUB'.
**Name**
Every asset can have several things to identify it. And all of them are
optional in MOEX API, except `secid` which is `Security ID`. So we use them
for name in this order of preference:
1. Latin (usually English) name.
2. Latin short name.
3. Russian name.
4. Security ID.
**Country**
I try to detect country, parsing ISIN: first two letters should be country code.
**Sectors**
MOEX supports some industry related indices, so when we first encounter some
symbol, I check whether it's in those indices and assign sectors accordingly.
**AssetClass and AssetSubClass**
At first, I was tempted to leave them empty, but finally decided to look into.
I downloaded all asset types from MOEX and tried to best of my knowledge assign
asset classes and subclasses. If I wasn't able to find proper relation, I left
the cell empty. After that I took the table (you can check it in the comments
in the code) and made `SecurityTypeMap` interface.
**getDividends**
MOEX API for dividends isn't documented at all (or probably I didn't find
proper docs) and sometimes it doesn't return the newest dividends. Surprisingly,
you can get dividends for MOEX-related assets from YAHOO, but the date can
differ. So, there is heurestic implemented: if those date are no more than two
days apart and payout is the same, then it's the exact same payout and we
merge them.
Signed-off-by: Anatoly Popov <me@aensidhe.ru>
8 months ago
Anatoly Popov
7e7008bd1b
fix: don't fail whole request if one of providers fails, but log it
Signed-off-by: Anatoly Popov <me@aensidhe.ru>
8 months ago
Kenrick Tandrian
4adc9dc9b1
Feature/upgrade to node-yahoo-finance2 version 3 ( #4695 )
* Upgrade node-yahoo-finance2 from version 2.11.3 to 3.3.1
* Update changelog
8 months ago
Kenrick Tandrian
2932d57c1e
Feature/improve language localization for ZH 20250510 ( #4701 )
* Improve language localization for ZH 20250510
* Update changelog
8 months ago
Thomas Kaul
480709c32a
Bugfix/add missing permission guard in create watchlist item endpoint ( #4686 )
* Add missing permission guard
* Update changelog
8 months ago
Thomas Kaul
11629ffd26
Feature/clean up unused interfaces ( #4685 )
* Clean up unused interfaces
8 months ago
Thomas Kaul
037d3b1a60
Feature/rename Order to activities in User database schema ( #4669 )
* Rename Order to activities in User database schema
* Update changelog
8 months ago
andiz2
1215803a40
Bugfix/fix ApiKeyStrategy error ( #4682 )
* Fix ApiKeyStrategy error
8 months ago
Felix Jordan
aadd9f56a0
Feature/extend admin endpoint by asset profile count per data provider ( #4676 )
* Extend admin endpoint by asset profile count per data provider
* Update changelog
8 months ago
Haruka Kishida
828bd5f172
Feature/upgrade to NestJS 11 ( #4270 )
* Upgrade to NestJS 11
* Update changelog
8 months ago
Thomas Kaul
67db1b0de4
Feature/rename Order to activities in SymbolProfile database schema ( #4661 )
* Rename Order to activities
* Update changelog
8 months ago
Kenrick Tandrian
c38dab5ab0
Feature/extend holding endpoint by performances ( #4660 )
* Extend holding endpoint by performances
* Update changelog
8 months ago
Kenrick Tandrian
40d3eaa023
Bugfix/fix performance calculation on date of activity when unit price differs from market price ( #4650 )
* Fix performance calculation on date of activity when unit price differs from market price
* Update changelog
8 months ago
Marcin Szymański
28d2fd3877
Bugfix/restore incorrect fee currency conversion ( #4645 )
* Restore incorrect fee currency conversion
* Update changelog
8 months ago
Thomas Kaul
d661cdc78f
Feature/rename account to accounts in platform database schema ( #4656 )
* Rename Account to accounts in platform database schema
* Update changelog
8 months ago
Thomas Kaul
3646fb7f77
Feature/refactor portfolio holding response ( #4649 )
* Refactor portfolio holding response
* maxPrice -> marketPriceMax
* minPrice -> marketPriceMin
* orders -> activities
8 months ago
Thomas Kaul
1bced96460
Feature/deprecate portfolio position endpoints ( #4648 )
* Deprecate api/v1/portfolio/position endpoints
* Update changelog
8 months ago
Thomas Kaul
3e963228d6
Feature/refactor accounts response interface ( #4644 )
* Refactor accounts response interface
8 months ago
Thomas Kaul
f70d71d5bd
Feature/improve watchlist for impersonation mode ( #4632 )
* Improve watchlist for impersonation mode
* Update changelog
8 months ago
Kenrick Tandrian
770b322137
Feature/extend watchlist endpoint by name, performances and market condition ( #4634 )
* Extend watchlist endpoint by name, performances and market condition
* Update changelog
8 months ago
Thomas Kaul
6bb85c4fb8
Bugfix/allow GBp in currency code validation ( #4640 )
* Allow GBp in currency code validation
* Update changelog
8 months ago
Thomas Kaul
8fbdcac66c
Feature/rename Order to activities in account database schema ( #4577 )
* Rename Order to activities
* Update changelog
9 months ago
Thomas Kaul
d919622932
Bugfix/fix create watchlist item for new asset profile ( #4625 )
* Fix create watchlist item for new asset profile
9 months ago
Thomas Kaul
b90bfc3d6e
Feature/extend data providers management of admin control panel ( #4615 )
* Extend data providers management
* Update changelog
9 months ago
Kenrick Tandrian
c671ea4022
Feature/add frontend for watchlist ( #4604 )
* Add frontend for watchlist
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
9 months ago
csehatt741
f209519d95
Bugfix/investment calculation for activities in custom currency ( #4597 )
* Investment calculation for activities in custom currency
* Update changelog
9 months ago
Thomas Kaul
b2dcb1e7ac
Feature/improve subscription interstitial ( #4612 )
* Improve algorithm
* Set up skip button delay
9 months ago
Thomas Kaul
862de91e7b
Feature/respect watcher count in delete asset profile checkbox ( #4609 )
* Respect watchedByCount in delete asset profile checkbox
* Update changelog
9 months ago
Thomas Kaul
d2452791cc
Feature/update create watchlist item permission ( #4608 )
* Remove createWatchlistItem permission
9 months ago
Thomas Kaul
7fb0f9b6e8
Feature/refactor import service ( #4599 )
* Refactoring
9 months ago
Thomas Kaul
3b59d7989a
Feature/improve currency code validation ( #4598 )
* Improve currency code validation
* Update changelog
9 months ago
Thomas Kaul
50e7e3d3c7
Feature/simplify data source checks in DTOs ( #4581 )
* Simplify DataSource checks in DTOs
* Add test case
* Update changelog
9 months ago
Thomas Kaul
56fcafaa12
Feature/improve premium data provider handling in getQuotes() ( #4590 )
* Improve premium data provider handling in getQuotes()
9 months ago
Thomas Kaul
e67ccea673
Feature/rename User to user in subscription database schema ( #4576 )
* Rename User to user
* Update changelog
9 months ago
Kenrick Tandrian
416fa44cf0
Feature/create watchlist API endpoints ( #4570 )
* Create watchlist API endpoints
* Update changelog
9 months ago
Thomas Kaul
71fc3906c7
Feature/add performance calculation type to user settings ( #4567 )
* Add performance calculation type to user settings
* Update changelog
9 months ago
Thomas Kaul
3091c3f080
Feature/rename Subscription to subscriptions in user database schema ( #4575 )
* Rename Subscription to subscriptions
* Update changelog
9 months ago
Thomas Kaul
d6e0b499d9
Feature/migrate lookup by ISIN in Financial Modeling Prep service to stable API version ( #4573 )
* Migrate lookup by ISIN to stable API version
* Update changelog
9 months ago
Thomas Kaul
1ae5ba7f8a
Feature/parallelize asset profile requests in get quotes functionality of Financial Modeling Prep service ( #4569 )
* Parallelize asset profile requests
* Update changelog
9 months ago
Thomas Kaul
b6f87e46a7
Bugfix/fix asset class parsing in Financial Modeling Prep service for exchange rates ( #4559 )
* Fix the asset class parsing
* Update changelog
9 months ago
Thomas Kaul
f29f201a4f
Bugfix/add missing isActive flag in asset profile of custom currency ( #4557 )
* Add missing isActive flag
* Update changelog
9 months ago
Thomas Kaul
db38806812
Feature/refresh cryptocurrencies list 20250417 ( #4548 )
* Update cryptocurrencies.json
* Update changelog
9 months ago
csehatt741
3361666f63
Feature/activity in custom currency ( #4486 )
* Activity in custom currency
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
9 months ago
Thomas Kaul
07ad7f2817
Bugfix/fix upgrade vs. renew subscription button labels ( #4549 )
* Fix upgrade vs. renew subscription button labels
9 months ago
Thomas Kaul
d23dfadbd0
Bugfix/fix active subscription in user table of admin control ( #4544 )
* Fix active subscription
* Update changelog
9 months ago
Thomas Kaul
94e53c7d4a
Feature/move subscription offer from info to user service ( #4533 )
* Move subscription offer from info to user service
* Update changelog
9 months ago
Thomas Kaul
6122da3f14
Feature/optimize get range query in market data service ( #4527 )
* Optimize query in getRange()
* Update changelog
9 months ago
csehatt741
42734dff75
Feature/deactivate asset profile on delisting (Yahoo Finance) ( #4524 )
* Deactivate asset profile on delisting (Yahoo Finance)
* Update changelog
---------
Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
9 months ago
Thomas Kaul
d1a4cb5037
Feature/improve financial modeling prep service ( #4528 )
* Improve service
* Set maximum number of symbols per request
* Migrate getQuotes to stable API version
* Update changelog
9 months ago
csehatt741
0f557f431e
Feature/add status column to market data table in admin control panel ( #4520 )
* Add status column to market data table in admin control panel
* Update changelog
9 months ago