Calculating totalReturn in PortfolioManagerImpl.java

We are required to follow the method signature (not change it, right?), and the only data that we are provided with is the list of PortfolioTrade and the endDate. We can also get the purchaseDate from each PortfolioDate
How are we supposed to calculate the total returns without reading the Json File in order to fetch the sell price and buy price? Am I missing something?

You have to call the TiingoService api to get the values you are needed to calculate the required total returns.
I guess this thing is already covered in module 2

Yes that is exactly my point. That will require me to parse to response from the API (which is a JSON), but in the TODO it is written that we shouldn’t do that in this file, and that the client will take care of it.

I think that relates to reading from a JSON file and not parsing your response. That has to be done anyway to use the data fetched by the API.