I've gotten quite "lazy" after working at a tech company for a while -- I know automation exists, and so I try very hard to avoid doing rote tasks. (Classic software engineering trap: spend 10 hours to save 1.)
That being said, AI coding tools should be able to help me do this quickly and automatically. There's two big steps to this process (we're only tackling the second here):
- Retrieve data (manual step for now) -- from PDFs, Excel files, etc. For now, I've done this manually, because this is a surprisingly hard problem to do at scale. (The files can be in so many different forms, and PDFs are notoriously tricky to read! There's also an open question on how much AI should process this vs. other means; e.g. if it's in Excel already, why use an LLM and run the risk of it hallucinating data?)
- Analyze data and build pretty graphs (AI-assisted code) -- Once the data is clean, this step requires no LLMs, just regular code. (This also means no private info is sent to any LLM.) Again, I'm using Google Antigravity; I've copied my initial prompt below.
help me build another tool -- "Cash Flow Analysis" -- that helps to analyze a VC/PE Fund's cash flows.
This should take in as input an Excel sheet with the following sheets/columns:
"LP Gross Cash Flows" - columns: Fund, Company, Date, Gross Cash Flow, Notes
"Unrealized Value" - columns: Fund, Company, Date, Gross Cash Flow
"Unlevered Cash Flow" - columns: Fund, Transaction, Type, Date, LP Net Cash Flow
"LP Capital" -- columns: Fund, Date, LP Net Cash Flow
Outputs:
- a graph of cash flows, usin ghte LP Gross Cash Flows chart, with $ amount on Y axis and time period on x-axis. DIsplay negative cash flows as a red bar (down) and positive (i.e. distributions) as blue. also have a "net cash flows" line graph
use altair to build this. allow filtering by Fund and Company. also allow a parameter for the x-axis to be quarterly, half-year, and year increments.
- generate a table showing for each fund/company the total investment, total distribution, whether exited completely, gross IRR.
- calculate total gross IRR per fund, using unrealized value in the equation as well
build a similar graph as above with unlevered cash flow tab. use altair to build this. allow filtering by Fund. also allow a parameter for the x-axis to be quarterly, half-year, and year increments.
calculate fund-level IRR using the current unrealized values in LP Capital slide
- I'm hitting this error: Error processing Excel file: 'Company'
- Error processing Excel file: Invalid frequency: QE, failed to parse with error message: ValueError("for Period, please use 'Q' instead of 'QE'")
- Error processing Excel file: 'Column not found: Gross Cash Flow'
- meh roll back that change. Instead can you abstract all of these column headers to the top of the routine as variables? maybe use a naming convention like "LP_GROSS_CASH_FLOWS__FUND" to designate "SHEET__COLUMN". this will help when we expand this later on
- can you remoe comapny filter option from LP Gross Cash Flows? Maybe jus filter the company summary table by that ... also -- if it's yearly x-axis increments, can you just show the year and not months in between? .... also the fund filters tabs are cut off so it's ahrd to see the full fund name, can you fix? ... i also get this error in company summary table: Error processing Excel file: complex exponentiation.
- can we replace this with a standard py function? def xirr(cashflows, dates):
- remove the company filter entirely ... for 2022 for one of the funds, i have both investments and distribution and i expect to see both, please update ... in the company summary table, add in "earliest investment" "last distribution" and "unrealized value" columns
- can you also adjust the green "net cash flow" to be the disributions minus investments? also label this line. can you also disable zooming and out of the graph, and make it a little taller?
- move the "gross IRR per fund" into a streamlit metric ... below company summary table, add in a filter to allow filtering by company to see all investments/distributions/unrealized value
- in the "detailed company data" -- can you sort the list alpahbetically for ease?
- can you update Fund Filter to single-select dropdown
- okay - let's remove the x-axis iincrements -- let's just keep it at "year" roll-up. ... i am still seeing two years per year (e.g. 2017 2017) in the x-axis.... Let's rename x-axis to "Year' also .... add a box around the metric ....
- at the fund level: can you add as metrics "total invested", "total distributed" , "DPI" (which is distributed / invested), MOIC, earliest investment, latest investment .... at the "detailed company data" level, can you add in IRR per fund, total invested, total distributed, unrealized value as metrics?
- rename "Positive/Distrubtion" to just "Distribution" and "Negative/Investment" to just "Investment" ... make the bars in the bar graph skinnier (more aesthetic)
- split the metrics onto two lines with 4 metrics wide (the full $ amount gets cut off). maybe also abbreviate $5,000,000 to $5.0M (maybe create a shared tag to do that, if a library function doesn't exist?)
- can you add all the same metrics to the unlevered cash flow screen? (total invested, total distributed, unrealized value, dpi, moic, gross irr, latest investment) ... can you also add the vintage to both
- can you actually add the vintage in the name of the fund as well? ... in a collapsable section, can you also print out all the numbers that go into the gross fund-level IRR calculation? (i need to check #s) ... remove "Micro Metrics" (I think it's not needed)