[INTRO: THE DEFENSIVE QUANTS SHIELD AGAINST CORPORATE DILUTION]
Does a corporate announcement of a $50 billion share buyback program represent a true commitment to returning capital to shareholders, or is it a defensive smokescreen designed to hide executive dilution? In the US equity market, share buybacks are widely celebrated by retail investors as a bullish catalyst. Yet, quantitative research reveals a disturbing trend: many technology mega-caps allocate billions to share repurchases simply to buy back the shares they continuously issue to their own employees. In these cases, the outstanding share count remains flat, leaving public shareholders with zero net reduction in ownership. To build a robust, institutional-grade equity screening engine, a quantitative trader must look beyond structured income statements and calculate the **Net Shareholder Yield**. By utilizing LLM agents (Google Gemini) to scrape and parse the unstructured footnotes of SEC Edgar filings, we can automatically screen out companies practicing “Hollow Buybacks.” This masterclass provides the mathematical framework and the Python codebase to automate this quality filter.
1. EXECUTIVE SUMMARY (TL;DR)
Corporate stock repurchases are frequently utilized as financial engineering to artificially boost Earnings Per Share (EPS). We expose this dilution illusion by introducing **Net Shareholder Yield** as the primary value metric, overlaid with an **AI Edgar Footnote Reader**. This framework delivers three quantitative advantages:
- SBC Dilution Adjustment: Subtracting Stock-Based Compensation (SBC) from total share buybacks to calculate the real, net capital returned to investors.
- AI Footnote Scrutiny: Scraping SEC Edgar 10-K filings and using LLMs to scan qualitative disclosures for option vesting cliffs and potential equity issuance overhangs.
- Earnings Quality Filter: Checking the ratio between Free Cash Flow (FCF) and Net Income to eliminate cash-poor firms that fund buybacks through debt issuance.
| Screening Metric | Mathematical Definition | Quantitative Purpose | US Corporate Behavior Identified |
|---|---|---|---|
| Gross Buyback Yield (Legacy) | \( \frac{\text{Total Buybacks}}{\text{Market Cap}} \) | Measures raw capital deployment | Fails to identify if outstanding shares are actually decreasing. |
| Net Shareholder Yield (V1) | \( \frac{\text{Dividends} + (\text{Buybacks} – \text{SBC})}{\text{Market Cap}} \) | Calculates net capital returned | Filters out tech companies that buy back shares solely to offset employee dilution. |
| AI Edgar Footnote Filter (V2) | LLM semantic score \( \in [1, 5] \) | Scans unstructured footnotes | Detects hidden dilution cliffs, operating lease liabilities, and governance risks. |
2. THE DILUTION TRAP: STOCK-BASED COMPENSATION
Stock-Based Compensation (SBC) is a non-cash expense widely utilized by US technology firms to attract elite talent without draining cash reserves. Under standard GAAP accounting rules, SBC is deducted from Net Income but added back in the Cash Flow Statement under Operating Activities. This treatment creates a major divergence between GAAP earnings and actual shareholder dilution.
The Buyback Mirage
When a corporation issues shares to employees, the total outstanding share count increases, diluting the ownership percentage of existing shareholders. If the company subsequently spends $10 billion on share buybacks, but issued $9 billion worth of shares to employees in the same period, the net capital returned is not $10 billion, but only **$1 billion**.
We classify this behavior as a **Hollow Buyback**. The company has essentially spent $9 billion of shareholder cash to prevent EPS dilution from its own compensation programs. This is an operational expense disguised as capital return.
By using cash reserves to buy back shares, companies reduce their denominator (shares outstanding), artificially raising their reported Earnings Per Share (EPS) even if Net Income remains flat. As systematic quants, we must remove this financial engineering bias from our valuation screens.
3. THE QUANTITATIVE FORMULA: NET SHAREHOLDER YIELD
To measure the actual, net capital returned to common equity holders, we define the **Net Shareholder Yield** equation.
3.1 The Net Shareholder Yield Equation
Let \( \text{Div}_{\text{paid}} \) be the cash dividends paid, \( \text{Buyback}_{\text{gross}} \) be the total cash spent on purchasing treasury stock, and \( \text{SBC} \) be the stock-based compensation expense reported in the Cash Flow Statement. The Net Shareholder Yield (\( \text{NSY} \)) is defined as:
$$ \text{NSY} = \frac{\text{Div}_{\text{paid}} + \left(\text{Buyback}_{\text{gross}} – \text{SBC}\right)}{\text{Market Capitalization}} $$
Where Market Capitalization is the current share price multiplied by outstanding common shares. By subtracting SBC from the buyback amount, we treat employee stock grants as a cash-equivalent liability, reflecting the true capital drain.
3.2 Cash-Rich vs. Debt-Funded Buybacks
A high Net Shareholder Yield is only sustainable if funded by organic cash flow. Some mature US corporations with declining growth issue low-interest corporate bonds to fund buyback programs, hoping to support their stock price. This increases leverage while degrading the balance sheet. To filter these out, we apply a strict **Earnings Quality threshold**:
$$ \text{Earnings Quality Ratio} = \frac{\text{Free Cash Flow}}{\text{Net Income}} \ge 1.0 $$
Where Free Cash Flow is Operating Cash Flow minus CAPEX. Any firm with a Net Shareholder Yield > 6% but an Earnings Quality Ratio < 1.0 is flagged as a debt-funded value trap and excluded from the quant basket.
4. UNSTRUCTURED DATA: PARSING SEC EDGAR WITH LLM AGENTS
Standard data providers (like Bloomberg or Yahoo Finance) only supply structured table data. The most critical qualitative risks—such as the price thresholds at which executive stock options vest, or hidden off-balance-sheet operating leases—are buried in the **unstructured footnotes** of 10-K and 10-Q SEC filings.
4.1 The Footnote Scraper Architecture
We deploy an automated Python RAG (Retrieval-Augmented Generation) agent that queries the SEC Edgar API, downloads the target company’s latest 10-K filing in HTML format, parses the document tree to isolate **Note: Share-Based Compensation**, and extracts the text blocks. This unstructured context is then fed into Google Gemini Pro.
4.2 The Semantic Grading Prompt
The AI Agent evaluates the footnote context using the following prompt template:
“Analyze the attached Share-Based Compensation footnote for the target firm. Identify: (1) Total unrecognized compensation cost and the remaining weighted-average period over which it is expected to be recognized. (2) The presence of any special performance-vesting stock units (PSUs) tied to stock price milestones. (3) Assign a Dilution Risk Score from 1 (Low Risk) to 5 (Extreme Risk) based on potential future share issuance velocity.”
Any company receiving a Dilution Risk Score of 4 or 5 is automatically blacklisted from the portfolio, shielding the fund from upcoming employee option exercise dumps.
5. PYTHON IMPLEMENTATION: SEC EDGAR API & LLM FOOTNOTE PARSER
Below is the production-grade Python script utilizing the official SEC Edgar API and the Google Gemini API to calculate Net Shareholder Yield and perform semantic footnote analysis.
import requests
import json
import os
import google.generativeai as genai
# SEC Edgar API requires a User-Agent header declaring your company name/email
SEC_HEADERS = {
"User-Agent": "VibeAlgoLab Research contact@vibealgolab.com"
}
def get_company_cik(ticker):
"""Fetches the 10-digit CIK (Central Index Key) for a given US stock ticker."""
url = "https://data.sec.gov/files/company_tickers.json"
resp = requests.get(url, headers=SEC_HEADERS)
if resp.status_code != 200:
raise ConnectionError("Failed to fetch SEC CIK mapping.")
data = resp.json()
for k, v in data.items():
if v['ticker'].upper() == ticker.upper():
return str(v['cik_str']).zfill(10)
raise ValueError(f"Ticker {ticker} not found in SEC database.")
def fetch_sec_facts(cik):
"""Retrieves structured financial facts from SEC Edgar CompanyFacts API."""
url = f"https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json"
resp = requests.get(url, headers=SEC_HEADERS)
if resp.status_code != 200:
raise ConnectionError(f"Failed to fetch SEC facts for CIK {cik}.")
return resp.json()
def calculate_net_shareholder_yield(ticker, market_cap):
"""
Scrapes SEC facts to calculate Net Shareholder Yield for the latest fiscal year.
NSY = (Dividends + (Gross Buybacks - SBC)) / Market Cap
"""
cik = get_company_cik(ticker)
facts = fetch_sec_facts(cik)
# Locate US-GAAP tags
us_gaap = facts['facts']['us-gaap']
# 1. Fetch Dividends (PaymentsToMinorityShareholders or similar, standard is PaymentsOfDividends)
div_data = us_gaap.get('PaymentsOfDividendsCommonStock', {}).get('units', {}).get('USD', [])
div_val = div_data[-1]['val'] if div_data else 0.0
# 2. Fetch Gross Buybacks (PaymentsForRepurchaseOfCommonStock)
buyback_data = us_gaap.get('PaymentsForRepurchaseOfCommonStock', {}).get('units', {}).get('USD', [])
buyback_val = buyback_data[-1]['val'] if buyback_data else 0.0
# 3. Fetch Stock-Based Compensation (ShareBasedCompensation)
sbc_data = us_gaap.get('AllocatedShareBasedCompensationExpense', {}).get('units', {}).get('USD', [])
if not sbc_data:
sbc_data = us_gaap.get('ShareBasedCompensation', {}).get('units', {}).get('USD', [])
sbc_val = sbc_data[-1]['val'] if sbc_data else 0.0
net_buyback = buyback_val - sbc_val
real_capital_returned = div_val + net_buyback
net_yield_pct = (real_capital_returned / market_cap) * 100
return {
"ticker": ticker,
"cik": cik,
"gross_buybacks_usd": round(buyback_val, 2),
"stock_based_compensation_usd": round(sbc_val, 2),
"net_buybacks_usd": round(net_buyback, 2),
"dividends_paid_usd": round(div_val, 2),
"net_shareholder_yield_pct": round(net_yield_pct, 4)
}
def analyze_footnote_with_gemini(sbc_footnote_text, api_key):
"""
Feeds the extracted SBC footnote text into Google Gemini Pro for semantic grading.
"""
genai.configure(api_key=api_key)
model = genai.GenerativeModel('gemini-2.0-flash')
prompt = f"""
Analyze the following Share-Based Compensation footnote from a US company 10-K filing:
---
{sbc_footnote_text}
---
Extract:
1. Total unrecognized compensation cost and weighted-average vesting period.
2. Executive stock option pricing thresholds or PSU milestones if any.
3. Output a single integer Dilution Risk Score between 1 (Low Risk) and 5 (High Risk).
Format the response strictly in JSON with keys: "unrecognized_cost", "vesting_period", "milestones", "risk_score".
"""
response = model.generate_content(prompt)
return response.text
# Example execution template
if __name__ == "__main__":
# Example: NVDA calculations (simulated market cap of $2.2 Trillion)
market_cap_nvda = 2200000000000.00
try:
results = calculate_net_shareholder_yield("NVDA", market_cap_nvda)
for k, v in results.items():
print(f"{k.replace('_', ' ').title()}: {v}")
except Exception as e:
print(f"Error fetching data: {e}")
6. PORTFOLIO ALLOCATION RULE: THE ANTI-DILUTION WEIGHT
Once the Net Shareholder Yield and the AI Dilution Risk Score are calculated, the systematic engine adjusts the portfolio weights. Instead of traditional market-cap weighting (which overexposes the portfolio to highly dilutive Mag 7 giants), we deploy the **Dilution-Adjusted Weighting (DAW)** algorithm.
6.1 The DAW Formula
Let \( W_i^{\text{mcap}} \) be the standard market-cap weight of stock \( i \) in the index, \( \text{NSY}_i \) be the Net Shareholder Yield, and \( S_i^{\text{risk}} \) be the AI Dilution Risk Score (\( 1 \) to \( 5 \)). The adjusted weight \( W_i^{\text{adjusted}} \) is defined as:
$$ W_i^{\text{adjusted}} = W_i^{\text{mcap}} \cdot \left( \frac{\text{NSY}_i}{1.0 + \gamma \cdot S_i^{\text{risk}}} \right) $$
Where \( \gamma \) is the risk penalty multiplier (typically set to \( 0.25 \)). This equation automatically penalizes firms that rely on massive stock option programs to reward executives, transferring capital weight to companies with high net buyback efficiency.
7. ACTIONABLE AUDIT CHECKLIST: THE DILUTION AUDIT
1. **Declare SEC API Compliance Header**: Ensure all HTTP calls to SEC Edgar contain your verified contact information, otherwise your IP will be permanently blocked by the SEC firewall. 2. **Scan Allocated SBC Expense**: Check that the SBC value fetched represents the total cash-equivalent expense in the Cash Flow Statement, not just the segment allocated to R&D. 3. **Apply the FCF/NI Circuit Breaker**: Exclude any stock with FCF < Net Income to filter out leverage-backed share repurchases. 4. **Calibrate the Risk Score Penalty**: Adjust the \( \gamma \) parameter in your allocation model based on the prevailing macro interest rate regime. 5. **Verify Common Share Count**: Audit the net change in shares outstanding on a quarterly basis. If the outstanding share count rises despite buyback declarations, immediately trigger a manual stock review.