I am quite sure that learning math has nothing to do at all with investments doing well. Would be a classic example of having made money, but getting the reason for why wrong.
The markets have been uponly since 2020 in general, so no surprise if one were invested, especially in technology, that one would have done well.