| name | sec-13f-fund-analysis-aum-stocks |
| description | How to analyze a fund's AUM and stock count using accession_number, with proper filtering of options and deduplication. Covers Q1 (AUM) and Q2 (stock count). |
Fund Analysis: AUM and Stock Count
Method 1: Use Built-in Scripts (Preferred and More Reliable)
cat /root/2025-q3/scripts/one_fund_analysis.py 2>/dev/null
python /root/2025-q3/scripts/one_fund_analysis.py "<ACCESSION_NUMBER>" 2>/dev/null
Always prefer built-in scripts as they handle edge cases (option filtering, deduplication) correctly.
Method 2: Manual Analysis
Getting AUM
AUM might be in SUMMARYPAGE.tsv or can be computed from INFOTABLE:
import pandas as pd
summary = pd.read_csv('/root/2025-q3/SUMMARYPAGE.tsv', sep='\t')
fund_summary = summary[summary['ACCESSION_NUMBER'] == accession]
print(fund_summary)
info = pd.read_csv('/root/2025-q3/INFOTABLE.tsv', sep='\t', low_memory=False)
fund_holdings = info[info['ACCESSION_NUMBER'] == accession]
aum = fund_holdings['VALUE'].sum()
print(f"AUM: ${aum * 1000:,.0f}")
Counting Stocks Held - CRITICAL FILTERING
The stock count must exclude options (PUT/CALL entries). The PUTCALL column may contain unexpected values.
fund_holdings = info[info['ACCESSION_NUMBER'] == accession]
print("PUTCALL unique values:", fund_holdings['PUTCALL'].unique())
print("PUTCALL value counts:")
print(fund_holdings['PUTCALL'].value_counts(dropna=False))
print("SSHPRNAMTTYPE unique values:", fund_holdings['SSHPRNAMTTYPE'].unique())
print(fund_holdings['SSHPRNAMTTYPE'].value_counts(dropna=False))
stocks_only = fund_holdings[
~fund_holdings['PUTCALL'].isin(['Put', 'Call', 'PUT', 'CALL', 'put', 'call'])
| fund_holdings['PUTCALL'].isna()
]
stocks_only = fund_holdings[
fund_holdings['PUTCALL'].isna() |
(fund_holdings['PUTCALL'].astype(str).str.strip().isin(['', 'nan', 'NaN', 'None']))
]
num_stocks = stocks_only['CUSIP'].nunique()
print(f"Number of unique stocks (by CUSIP): ")
()
()
Important: Understanding How Scripts Count Stocks
The built-in script likely:
- Filters out PUT/CALL rows
- May also filter by SSHPRNAMTTYPE == "SH" (shares only, excluding principal "PRN")
- May deduplicate by CUSIP or CUSIP + other fields
- Read the script source to understand the exact logic
stocks_sh = fund_holdings[
(fund_holdings['PUTCALL'].isna() | (fund_holdings['PUTCALL'].astype(str).str.strip() == '')) &
(fund_holdings['SSHPRNAMTTYPE'].astype(str).str.strip() == 'SH')
]
print(f"Shares-only count: {stocks_sh['CUSIP'].nunique()}")