QUOTE(Jitty @ Nov 5 2020, 10:01 PM)
you guys will DCA every month for the same amount?
I DCA fixed amount monthly (Rm1000) regardless of market conditions, on month end. Considering to add another rm500 on mid month (regardless of market conditions) but haven't decided

QUOTE(siaush @ Nov 5 2020, 10:11 PM)
I noticed that StashAway's web app does use some sort of an API to obtain data from the backend, which uses GraphQL.
I guess that is the best alternative to an official API at this point of time?
The endpoint is at:
https://api.stashaway.my/graphql and requires POST HTTP method to access.
Minimally you will also need the following Request Headers (apart from the usual HTTP request headers):
CODE
Authorization: Bearer <Your session token after logging in.>
x-client-identifier: [email protected]
I have not figured out how to obtain the bearer token programmatically yet, currently just getting it from Chrome's developer tools.
Then the following Request Body (in JSON) will get you your transaction history:
» Click to show Spoiler - click again to hide... «
CODE
{"operationName":"transactions","variables":{"page":0,"pageSize":1000},"query":"query transactions($transactionTypes: [String], $fundingSources: [String], $startMonth: String, $endMonth: String, $pageSize: Int, $page: Int) {\n customer {\n _id\n transactions(transactionTypes: $transactionTypes, fundingSources: $fundingSources, startMonth: $startMonth, endMonth: $endMonth, pageSize: $pageSize, page: $page) {\n page\n pageSize\n count\n items {\n id\n groupedDate\n groupedType\n groupedStatus\n amount: totalRequestedAmount {\n amount\n currency\n __typename\n }\n totalTransactedAmount {\n amount\n currency\n __typename\n }\n transactions {\n id\n accountId\n transactionId\n transactionType\n fundingSource\n finalTransactedAmount {\n amount\n currency\n __typename\n }\n finalTransactedDate\n amount: initialRequestedAmount {\n amount\n currency\n __typename\n }\n date: initialRequestedDate\n transactionStatus\n metadata {\n type\n depositType\n portfolioId\n goalName\n units\n pricePerUnit {\n amount\n currency\n __typename\n }\n purpose\n securityCode\n operationId\n fxRate\n hasFullRedemption\n redemptionType\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n"}
Which returns a JSON response that looks like:
» Click to show Spoiler - click again to hide... «
CODE
{
"data": {
"customer": {
"_id": "<redacted>",
"transactions": {
"page": 0,
"pageSize": 1000,
"count": 51,
"items": [
{
"id": "<redacted>",
"groupedDate": "2020-10-01",
"groupedType": "PortfolioInvestment",
"groupedStatus": "Completed",
"amount": {
"amount": 250,
"currency": "MYR",
"__typename": "Currency"
},
"totalTransactedAmount": {
"amount": 250,
"currency": "MYR",
"__typename": "Currency"
},
......
It works for most of the operations on the website, and each of them require a different GraphQL request.
I have not analysed the response data models yet.
I have just stumbled upon this today while imagining to build a consolidated investment portfolio tracking sheet across different platforms.

Thank you for the detailed explanation! Will take sometime to digest this weekend and see if I can find a way to fit into my excel tracker

My excel tracks almost everything now (worldwide stocks via Yahoo Finance, FSMOne HK / SG / MY, Currency (exchange). Only left StashAway which I updated manually for now and got annoyed.
QUOTE(honsiong @ Nov 5 2020, 10:36 PM)
Yes my approach is same as yours. I doubt they will release an official API for us, there are too few of us piping the data elsewhere anyway.
https://gist.github.com/anonoz/1461cd0733c4...52a25dc822762cbBTW deploying to Heroku is significantly easier than AWS Lambda, just that Heroku has a 6 seconds warm up period, Lambda has near 0.
Thanks for the code snippet! Will also look into it this weekend since it is also the same approach.
I was poking around chrome inspector this morning and had some idea but hasn't tried it yet. I was thinking along the line of passing the Request Payload (hardcoded somewhere with my SA useename/password) to automate the login token generation

QUOTE(stormseeker92 @ Nov 5 2020, 10:51 PM)
What's the difference of using the API and using Yahoo Finance or other readily available website to track it?
API allows you to pull data programmatically and ideally achieving automation (e.g. An excel sheet or Google sheets with always up-to-date portfolio data with ability to take snapshot to assess past performance). The idea is to automatically fetch securities price (or in this case, my StashAway's latest portfolio value) into the excel to have a consolidated view of my overall portfolio performance (IRR / ROI) - since SA is only ~30% of my portfolio
Using website is, well, using website. In Yahoo Finance's example, it helps you to track individual stocks or ETF. However, because StashAway is a basket of ETF and everyone invests differently, you can't really "pull" the number from Yahoo Finance unless you manually keep track the underlying assets' quantity in your StashAway's portfolio (eg. 2.2 units of KWEB, blah blah blah)
This post has been edited by polarzbearz: Nov 5 2020, 11:53 PM