Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

Investment StashAway Malaysia, Multi-Region ETF at your fingertips!

views
     
siaush
post Nov 5 2020, 10:11 PM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
QUOTE(polarzbearz @ Nov 5 2020, 01:28 PM)
Off topic abit - just wondering if you've got the script back up and running? Interested to know how you did it. Thinking to write the same as well but in VBA instead of Gsheets laugh.gif

how I wished that they have official API and key support. As it is right now seems like I have to use classic authentication method (username / password) hmm.gif
*
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: webapp@4.0.0



I have not figured out how to obtain the bearer token programmatically yet, currently just getting it from Chrome's developer tools. tongue.gif

Then the following Request Body (in JSON) will get you your transaction history:

» Click to show Spoiler - click again to hide... «


Which returns a JSON response that looks like:

» Click to show Spoiler - click again to hide... «


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. tongue.gif

This post has been edited by siaush: Nov 5 2020, 10:30 PM
siaush
post Nov 6 2020, 12:34 AM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
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...52a25dc822762cb

BTW 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 snippets, not really familiar with Ruby, but will have a look and see what I can get out of it. smile.gif


QUOTE(polarzbearz @ Nov 5 2020, 11:32 PM)
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 laugh.gif

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.

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 hmm.gif
*
You are welcome! smile.gif
Oh I see, I have downloaded your Excel template for a deeper look and inspirations. tongue.gif
I am exploring on Google Sheets as it can run on the cloud and we can schedule automated snapshots without manual intervention. biggrin.gif

With a quick look, it seems like the snippets honsiong shared is passing actual credentials to the login API and retrieving the bearer token from the response as well.
Will look into it for more details too, thanks! biggrin.gif

This post has been edited by siaush: Nov 6 2020, 12:36 AM
siaush
post Nov 6 2020, 03:22 PM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
QUOTE(polarzbearz @ Nov 6 2020, 02:41 PM)
So I've just poked around abit, I managed to implement it in EXCEL VB to POST login, get its token and call graphql querying the portfolio's I'd and got a successful JSON return. Now just have to

1) clean up code base and move all hardcoding to config page
2) parse the values

Then I'm done. Thanks so much again both! The reference helped me quite significantly to poke the correct direction laugh.gif
*
You are welcome, glad that it helped smile.gif
Looking forward to see your implementation should you decide to release it after the clean up biggrin.gif

Cheers!
siaush
post Nov 6 2020, 09:44 PM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
QUOTE(polarzbearz @ Nov 6 2020, 04:05 PM)
It's not done yet but the form is there - just need to merge to my fundUpdater function laugh.gif I think I need to decouple my functions. My fundUpdater() is getting longer and longer with all these different fetch() methods doh.gif
And its done!

Also feeling abit eerie to leave my username / password / device cookie in plain-text on the sheet. I might try to find ways to encrypt/decrypt it but might be useless also if it's all housed within same file
*
Wow that's quick! rclxms.gif
Thanks for sharing it smile.gif
I will have a look in detail when situation permits.

On the other hand, I have created a quick and dirty (but should be safe) way to store secrets inside the Excel file.

I'll keep it in the spoiler tag below in order not to take up too much space for those who are not interested in this. tongue.gif

» Click to show Spoiler - click again to hide... «

Cheers!

This post has been edited by siaush: Nov 6 2020, 10:39 PM
siaush
post Jan 18 2024, 02:37 PM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
QUOTE(Gabriel03 @ Jan 18 2024, 01:13 PM)
Stashaway Simple is reducing to 3.6% pa. There are other money market funds which offer better deposit and withdrawal processing time at the same or better rate.

user posted image
*
Any other suggestions other than Versa, GO+ and KDI?

This post has been edited by siaush: Jan 18 2024, 02:40 PM
siaush
post Jan 22 2024, 03:04 PM

Getting Started
**
Junior Member
246 posts

Joined: Jan 2005
QUOTE(siaush @ Jan 18 2024, 02:37 PM)
Any other suggestions other than Versa, GO+ and KDI?
*
Answering my own question, if you have a FSMOne account, both of the funds in the new SA Simple target portfolio are available on FSM.

- Eastspring Investments Islamic Income Fund - Class R
- Principal Islamic Money Market Fund - Class AR

So one of the option is to buy the MMFs directly through FSM, and you get the option of selecting the weightage you desire between the two funds, mimic SA Simple, or all-in into one, without the 0.15% p.a. fees.

However the downside is, the initial and subsequent investment amounts of the funds are quite high, hence it is not as accessible as SA Simple. smile.gif

 

Change to:
| Lo-Fi Version
0.0423sec    0.56    7 queries    GZIP Disabled
Time is now: 30th November 2025 - 04:28 PM