Portfolio value = quantity x live stock price
If the user owns 50 shares and the live price is Rs 1,000, that holding is worth Rs 50,000. When the stock price changes, the holding value and portfolio weight also change.
- Fetch live price from the quote API.
- Multiply by quantity.
- Add all holdings to get total portfolio value.
- Divide each holding value by total value to get its weight.
Live prices change portfolio weights, and weights change carbon exposure.