Project: Profly

latrova commited 5 months ago · python react finance ·

Available at: https://www.profly.app/

Source Code:

Stack: Python, Django, React, AWS (Cognito), DigitalOcean (Host)

(By the way, if you wish to host some app or blog I recommend Digital Ocean. It's very easy to use and this blog you're reading right now is hosted there. Subscribe here to earn $100 in credit to get started).


The purpose is to track how much I invested in which stocks (USA and Brazil) and track my emotions as I take actions so I can finetune my decisions, understand why I did what I did, and ultimately learn from my own mistakes.

Idea

During my company's recess I got very humbled and inspired by Linus projects and couldn't stop thinking about something he said (extracted from https://thesephist.com/posts/tools/):

My biggest benefit from writing my own tool set is that I can build the tools that exactly conform to my workflows, rather than constructing my workflows around the tools available to me.

I finally decided to do it myself, I hate using google sheets and I was using it for the whole last year, it's just not good enough - then I wanted to create something a bit better myself.

My Google Sheets before Profly. (By the way the charts are buggy since I'm not really good with sheets expressions).

The dream app would be able to:

The flow works fine, see:

In the example above I record a buy action of MGLU3.SA (Magazine Luiza) which is not a recommendation.

Tools and frameworks

In the end, I've used yfinance lib (which scraps data from Yahoo) to capture prices, charts, and data from tickers with no cost! I considered a few other APIs like https://finnhub.io/ but I wasn't looking into paying for something at this stage. Also, some APIs I found had constraints/complex usage to capture stock data from Brazil.

For the tools, I decided to use Django with Graphene (the fastest way I know to get an API started), I created the React from this boilerplate, used material-ui to have some basic components (because I suck at design), and Recharts to display the data.

I wanted to allow multiple users to use the app which means I have to implement a login/signup flow. Again, I didn't want to waste time with such things that won't add value to the "product" (?) so I ended up using AWS Cognito and its Amplify lib.

I got something working in time. For sure buggy and with questionable quality, but still a valid MVP made in just (approximately) 2 weeks.

Trade-Offs

My time was short. I got less than a month to develop it before I got back to my work (which consumes a lot of time from me), alas, I had to make decisions that I'm not really proud of and which my own team would complain if I were doing it on a company project 🙈. So, due to the ridiculously small timeline to build something I had to:


*Martin Fowler leaves the site*

Although painful (I love code quality 😢), I had to sacrifice quality and effort invested in tests to best use the time available for me. In that sense, I don't regret it at all. As I read in The Lean Startup: most of the time you can validate an idea with fewer features and even with bugs.

I'm still not completely happy though. I miss websockets, handling differences between currencies (USD and BRL), availability as an Android App, and I would love to track other investment options like crypto and fixed income.

If you're curious about the steps I had to take, feel free to look into my Twitter, you can see the initial skeleton and how much I suck at design 😂

Rationale (with real examples from myself)

Ok. Let me show you how it would help me improve my rational thinking in the short and mid-term.

🇺🇸 USA scenario: GME

(Please ignore the "R$", the app is not displaying the correct currency. The values are in USD)

Yes, I was one of the retards who bought GME stocks at the highest price. Laugh at me and see:

What I personally love about this view are two things:

When I see it and analyze I can see how inconsistent I am. If I bought if for fun, why did I get scared when it dropped? If it was too much for me, why did I risk so much?

Thinking more deeply, I guess it was a mix of FOMO and a willingness to be part of something. I couldn't stop laughing about the idea of a small group auto-declared retards buying stocks to provoke a short-squeeze in big hedge funds 🤷.

As soon as I saw the big drop on Monday (I bought it on Friday) I felt really stupid. I could have invested in anything else that I honestly believed instead of venturing myself in a "joke".

🇧🇷 Brazil scenario: AZUL4

After reading some news in 2019 (pre COVID) I thought it would be a good opportunity to invest in an airline company (poor me), see in the chart as follows:

When I look at it I feel incredibly dumb (even more for exposing it in public 😂). But it allows me to understand better how I think and how my emotions have been driving some decisions.

Honestly, looking at it now from far without being attached to my ego (charts and data don't have feelings, right?), I don't think it was a smart decision.

Expectations

Given this app is open and free, I hope to start using it to learn what the heck I am doing with my money. Although I never lost an incredible, unrecoverable amount of money, I'm clearly making terrible and inconsistent decisions.

Every emotion that drives a decision, is a bad one. Decisions should be taken based on rationality and deep thought, not silly and temporary emotions.

So I would like to finish with a quote from @naval:

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket

Be the first to know when I post cool stuff 🚀