maybe icon indicating copy to clipboard operation
maybe copied to clipboard

Manually input + automatically track US stocks

Open Shpigford opened this issue 1 year ago • 16 comments

Currently we have the ability to manually enter the value of any asset (and then you can manually add updated values).

What need to add support for is entering a particular stock and then tracking the ongoing value of it.

For now, due to data sourcing, this would be restricted to the US stock market.

Data to input:

  1. Stock
  2. Number of shares
  3. Cost basis (optional)

This will be the basis for allowing users to import CSV files of their various holdings, but that specific functionality is outside the scope of this issue.

The backend essentially already supports this as we were importing this data via Plaid, but there's a current Issue to clean this up specifically for manual usage: #166

So, a lot of this (maybe most?) is essentially building the UI/UX to input the individual stocks.


Here's a rough mockup of potential UI.

CleanShot 2024-01-18 at 15 30 26@2x

  1. Select an existing manual investment account (or create a new one).
  2. Enter a stock symbol (though should probably pull from a database list of these so you can't just enter any random string)
  3. Set the purchase date, total purchase value (cost basis) and the number of shares

From there, Maybe would then track the value of that investment automatically.

Deliverables:

  1. UI for adding a manual investment account — Would use the existing "Investment" block in the modal, where you'd either pick an existing account or add a new one.
  2. UI for adding the stock — Should be a "search to select" UI for pulling from stock listing (Database: Security)
  3. Creating the appropriate "transaction" for adding the stock.
  4. UI for removing/selling the stock
  5. Create the appropriate "transaction" for removing the stock.

Bounty

There is a $250 bounty for this.

Shpigford avatar Jan 17 '24 19:01 Shpigford

For now, due to data sourcing, this would be restricted to the US stock market

What would be the source for US stocks ? What about ETFs ? What are the requirements for a source ?

  1. Stock

Thinking ahead for outside of US. What's a stock ? A ticker ? a ISIN code ? Both ? A ISIN code and a currency ?

lasconic avatar Jan 17 '24 19:01 lasconic

What would be the source for US stocks ? What about ETFs ?

Currently the app is using Polygon.io, which has all data for all securities in the US market (stocks, ETFs, etc). Highly recommend using that as they have a free plan for individual use.

Thinking ahead for outside of US. What's a stock ? A ticker ? a ISIN code ? Both ? A ISIN code and a currency ?

We likely need to do a bit of research in this regard to see what international standard there is (if any). On the surface Symbol + Exchange should be a unique identifier available everywhere, but again...need to do some digging there.

Shpigford avatar Jan 17 '24 20:01 Shpigford

https://www.alphavantage.co seems to have a free plan and some international coverage (LVMH in Paris MC.PAR is in for example)

lasconic avatar Jan 17 '24 20:01 lasconic

https://www.alphavantage.co seems to have a free plan and some international coverage (LVMH in Paris MC.PAR is in for example)

We'll avoid AlphaVantage at all cost. Our experience with them as a business was...less than great.

Shpigford avatar Jan 17 '24 20:01 Shpigford

Yahoo Finance can be great alternative, it's available for free on Rapid-API. Updating the stock prices automatically can be achieved by setting up a cronjob for saving the close price value for all the manually entered stocks and updating them after market closes, depending upon user's location. YF has data for almost every major region.

Jesse0502 avatar Jan 18 '24 05:01 Jesse0502

/bounty $250

Shpigford avatar Jan 19 '24 16:01 Shpigford

💎 $250 bounty created by maybe-finance 🙋 If you start working on this, comment /attempt #131 along with your implementation plan 👉 To claim this bounty, submit a pull request that includes the text /claim #131 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to maybe-finance/maybe!

👉 Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @bskinny129 Jan 19, 2024, 5:37:22 PM WIP
🟢 @karan0handa Jan 19, 2024, 7:43:03 PM #215

algora-pbc[bot] avatar Jan 19 '24 16:01 algora-pbc[bot]

I might take a crack at this one. A couple of follow up questions:

  1. "Enter a stock symbol (though should probably pull from a database list of these so you can't just enter any random string)". Is this what the Security table is tracking?

  2. Does this bounty need to update the list of eligible Security s?

  3. Is there any consideration for the user's region as far as what Security s show?

  4. Is there any on-going update as part of this, or just the UI? For example, what about a stock split?

bskinny129 avatar Jan 19 '24 17:01 bskinny129

@bskinny129 Great questions!

  1. Yes, Security is the centralized list of stocks.
  2. No, this is just doing a read on what's in the Security table.
  3. In my head...yes. (Basically only pulling from exchanges that are available in the user's "country" they pick during signup") But maybe there's a use case that conflicts with that?
  4. Don't worry about that in the scope of this task.

Shpigford avatar Jan 19 '24 17:01 Shpigford

/attempt #131

Options

bskinny129 avatar Jan 19 '24 17:01 bskinny129

Well I think this is going to require more backend work than I have time for right now.

Screenshot 2024-01-19 at 11 30 11 AM

I did step 1 and will submit a PR. If it is worthwhile, a partial bounty is appreciated, but I understand if that's not the goal. I just don't have time to dig into the rest right now, so someone else can go for it.

bskinny129 avatar Jan 19 '24 19:01 bskinny129

Sure. I'll go for it (didn't finish the next day)

crnsh avatar Jan 19 '24 19:01 crnsh

/attempt #131

Options

crnsh avatar Jan 19 '24 19:01 crnsh

@Shpigford Just to clarify, stocks should be kept as holdings in an account right?

crnsh avatar Jan 21 '24 17:01 crnsh

@karan0handa Any updates on this? Would love to take this up. Reaching out cuz I don't wanna highjack your attempt at this. Please let me know

aditya-67 avatar Jan 22 '24 18:01 aditya-67

Yes. Have made progress on this. PR coming up in a bit.

crnsh avatar Jan 22 '24 19:01 crnsh

@karan0handa: Your claim has been rewarded! 👉 Complete your Algora onboarding to collect the bounty.

algora-pbc[bot] avatar Feb 02 '24 14:02 algora-pbc[bot]

🎉🎈 @karan0handa has been awarded $250! 🎈🎊

algora-pbc[bot] avatar Feb 02 '24 14:02 algora-pbc[bot]