| """Centralised configuration for the What-If Scenario Benchmark pipeline. |
| |
| Every tunable parameter lives here so that notebooks and scripts have a |
| single source of truth. |
| |
| Architecture: |
| Layer 1 (Raw Collection) -> data/{source}/ |
| Layer 2 (Preprocessing) -> data/processed/{GRANULARITY}/ |
| Layer 3 (Benchmark) -> data/benchmark/{GRANULARITY}/ |
| """ |
|
|
| from pathlib import Path |
|
|
| |
| |
| |
| import os as _os |
|
|
| BASE_DIR = Path(__file__).resolve().parent |
| |
| |
| DATA_DIR = BASE_DIR / _os.environ.get("WHATIF_DATA_DIR", "data_small_caps") |
|
|
| UNIVERSE_DIR = DATA_DIR / "universe" |
| FUNDAMENTALS_DIR = DATA_DIR / "fundamentals" |
| PRICES_DIR = DATA_DIR / "prices" |
| FILINGS_DIR = DATA_DIR / "filings" |
| MACRO_DIR = DATA_DIR / "macro" |
| REAL_ESTATE_DIR = DATA_DIR / "real_estate" |
| NEWS_DIR = DATA_DIR / "news" |
| XBRL_DIR = DATA_DIR / "xbrl" |
|
|
| |
| |
| |
| GRANULARITY: str = "daily" |
|
|
|
|
| def get_processed_dir(granularity: str | None = None) -> Path: |
| """Return the processed-data directory for *granularity* (default: GRANULARITY).""" |
| return DATA_DIR / "processed" / (granularity or GRANULARITY) |
|
|
|
|
| def get_benchmark_dir(granularity: str | None = None) -> Path: |
| """Return the benchmark-output directory for *granularity* (default: GRANULARITY).""" |
| return DATA_DIR / "benchmark" / (granularity or GRANULARITY) |
|
|
|
|
| |
| |
| PROCESSED_DIR = get_processed_dir() |
| BENCHMARK_DIR = get_benchmark_dir() |
|
|
| |
| |
| |
| START_DATE = "2021-01-01" |
| END_DATE = "2026-04-01" |
| START_YEAR = int(START_DATE[:4]) |
| END_YEAR = int(END_DATE[:4]) |
|
|
| |
| |
| |
| BENCHMARK_SEED = 42 |
|
|
| |
| |
| |
| |
| IWM_HOLDINGS_URL = ( |
| "https://www.ishares.com/us/products/239710/" |
| "ishares-russell-2000-etf/1467271812596.ajax?" |
| "fileType=csv&fileName=IWM_holdings&dataType=fund" |
| ) |
| |
| |
| IJR_HOLDINGS_URL = ( |
| "https://www.ishares.com/us/products/239774/" |
| "ishares-core-sp-smallcap-etf/1467271812596.ajax?" |
| "fileType=csv&fileName=IJR_holdings&dataType=fund" |
| ) |
| |
| IWC_HOLDINGS_URL = ( |
| "https://www.ishares.com/us/products/239724/" |
| "ishares-microcap-etf/1467271812596.ajax?" |
| "fileType=csv&fileName=IWC_holdings&dataType=fund" |
| ) |
|
|
| |
| |
| |
| |
| SMALL_CAP_MAX_MEDIAN_MCAP: float = 7.4e9 |
|
|
| |
| LOWER_END_PERCENTILE = 50 |
|
|
| |
| MAX_TICKERS: int | None = None |
|
|
| |
| EXCLUDED_TICKERS: list[str] = [] |
|
|
| |
| |
| |
| FUNDAMENTALS_WORKERS = 2 |
|
|
| |
| |
| |
| PRICE_BATCH_SIZE = 50 |
|
|
| |
| |
| |
| SEC_FILING_TYPES: list[str] = ["10-K", "10-Q", "8-K", "20-F", "6-K", "N-CSR", "N-CSRS"] |
| SEC_FILING_WORKERS = 4 |
|
|
| |
| |
| |
| FRED_SERIES: dict[str, str] = { |
| |
| "FEDFUNDS": "Federal Funds Effective Rate", |
| "SOFR": "Secured Overnight Financing Rate", |
| "DGS2": "2-Year Treasury Constant Maturity Rate", |
| "DGS10": "10-Year Treasury Constant Maturity Rate", |
| "DGS30": "30-Year Treasury Constant Maturity Rate", |
| "T10Y3M": "10-Year Treasury Minus 3-Month Treasury", |
| "T10Y2Y": "10-Year Treasury Minus 2-Year Treasury", |
| "MORTGAGE30US": "30-Year Fixed Rate Mortgage Average", |
| |
| "SP500": "S&P 500 Index", |
| "NASDAQCOM": "NASDAQ Composite Index", |
| "DJIA": "Dow Jones Industrial Average", |
| "VIXCLS": "CBOE Volatility Index (VIX)", |
| |
| "DCOILWTICO": "Crude Oil Prices: West Texas Intermediate (WTI)", |
| "DHHNGSP": "Henry Hub Natural Gas Spot Price", |
| |
| "DTWEXBGS": "Trade Weighted U.S. Dollar Index", |
| "DEXUSEU": "U.S. / Euro Foreign Exchange Rate", |
| "DEXJPUS": "Japan / U.S. Foreign Exchange Rate", |
| "DEXUSUK": "U.S. / U.K. Foreign Exchange Rate", |
| "DEXCHUS": "China / U.S. Foreign Exchange Rate", |
| |
| "CPIAUCSL": "Consumer Price Index For All Urban Consumers (All Items)", |
| "CPILFESL": "Consumer Price Index Less Food and Energy (Core CPI)", |
| "PPIACO": "Producer Price Index (All Commodities)", |
| "T10YIE": "10-Year Breakeven Inflation Rate", |
| "T5YIE": "5-Year Breakeven Inflation Rate", |
| "PCEPI": "Personal Consumption Expenditures: Chain-type Price Index", |
| |
| "UNRATE": "Unemployment Rate", |
| "ICSA": "Initial Claims (Weekly Jobless Claims)", |
| "PAYEMS": "All Employees Total Nonfarm (Payrolls)", |
| "JTSJOL": "Job Openings: Total Nonfarm (JOLTS)", |
| "CES0500000003": "Average Hourly Earnings of All Employees (Total Private)", |
| |
| "BAMLH0A0HYM2": "ICE BofA US High Yield Option-Adjusted Spread", |
| "BAMLC0A0CM": "ICE BofA US Corporate Master Option-Adjusted Spread", |
| "TEDRATE": "TED Spread (3-Month LIBOR minus 3-Month T-Bill)", |
| "STLFSI2": "St. Louis Fed Financial Stress Index", |
| "NFCI": "Chicago Fed National Financial Conditions Index", |
| |
| "INDPRO": "Industrial Production Index", |
| "RSAFS": "Advance Retail Sales: Retail and Food Services", |
| "UMCSENT": "University of Michigan Consumer Sentiment", |
| "TOTALSA": "Total Vehicle Sales", |
| "PERMIT": "New Privately-Owned Housing Units Authorized (Building Permits)", |
| |
| "CSUSHPISA": "S&P/Case-Shiller U.S. National Home Price Index", |
| "HOUST": "Housing Starts: Total New Privately Owned", |
| |
| "M2SL": "M2 Money Stock", |
| "BOGMBASE": "Monetary Base; Total", |
| "WALCL": "Federal Reserve Total Assets (Balance Sheet)", |
| |
| "BUSLOANS": "Commercial and Industrial Loans, All Commercial Banks", |
| } |
|
|
| |
| |
| |
| _ALL_METROS: list[str] = [ |
| |
| "350 5th Ave, New York, NY 10118", |
| "233 S Wacker Dr, Chicago, IL 60606", |
| "1000 Vin Scully Ave, Los Angeles, CA 90012", |
| "600 Travis St, Houston, TX 77002", |
| "400 S Tryon St, Charlotte, NC 28202", |
| "100 Peachtree St NW, Atlanta, GA 30303", |
| "200 E Las Olas Blvd, Fort Lauderdale, FL 33301", |
| "700 2nd Ave S, Nashville, TN 37210", |
| "1 N Central Ave, Phoenix, AZ 85004", |
| "2001 Ross Ave, Dallas, TX 75201", |
| "200 E Colfax Ave, Denver, CO 80203", |
| "1 S Broad St, Philadelphia, PA 19107", |
| "100 Summer St, Boston, MA 02110", |
| "700 5th Ave, Seattle, WA 98104", |
| "50 Fremont St, San Francisco, CA 94105", |
| "401 E Pratt St, Baltimore, MD 21202", |
| "1 S Main St, Salt Lake City, UT 84111", |
| "400 S Orange Ave, Orlando, FL 32801", |
| "100 NE 2nd Ave, Portland, OR 97232", |
| "325 John Knox Rd, Tallahassee, FL 32303", |
| |
| "1 Riverfront Plz, Newark, NJ 07102", |
| "100 N Main St, Memphis, TN 38103", |
| "200 W Washington St, Indianapolis, IN 46204", |
| "100 S Main St, Las Vegas, NV 89101", |
| "600 E Market St, San Antonio, TX 78205", |
| "200 E Pratt St, Milwaukee, WI 53202", |
| "100 N Broadway, Oklahoma City, OK 73102", |
| "500 Main St, Louisville, KY 40202", |
| "100 N Main St, Richmond, VA 23219", |
| "1 S Pinckney St, Madison, WI 53703", |
| "200 E Main St, Norfolk, VA 23510", |
| "100 W Capitol Ave, Little Rock, AR 72201", |
| "100 S Main St, Tulsa, OK 74103", |
| "1 Canal St, New Orleans, LA 70130", |
| "100 E Capitol St, Jackson, MS 39201", |
| "200 W Adams St, Jacksonville, FL 32202", |
| "100 N Main St, Wichita, KS 67202", |
| "100 State St, Hartford, CT 06103", |
| "1 Exchange Pl, Providence, RI 02903", |
| "100 N Tryon St, Raleigh, NC 27601", |
| |
| "200 E Main St, Lexington, KY 40507", |
| "100 N Main St, Dayton, OH 45402", |
| "100 W 10th St, Wilmington, DE 19801", |
| "100 S Main St, Akron, OH 44308", |
| "200 N Main St, Greenville, SC 29601", |
| "100 E Washington St, Boise, ID 83702", |
| "1 City Hall Plz, Durham, NC 27701", |
| "100 W Trade St, Winston-Salem, NC 27101", |
| "100 S Virginia St, Reno, NV 89501", |
| "200 E Main St, Chattanooga, TN 37402", |
| "100 N Main St, Columbia, SC 29201", |
| "1 S Main St, Spokane, WA 99201", |
| "100 E Congress St, Tucson, AZ 85701", |
| "200 W Markham St, Birmingham, AL 35203", |
| "100 S Main St, Omaha, NE 68102", |
| "100 W Broad St, Columbus, OH 43215", |
| "100 W Michigan Ave, Kalamazoo, MI 49007", |
| "200 N Main St, Ann Arbor, MI 48104", |
| "100 E 8th St, Cincinnati, OH 45202", |
| "100 S 4th St, Minneapolis, MN 55401", |
| |
| "100 N Main St, Knoxville, TN 37902", |
| "200 W Camelback Rd, Scottsdale, AZ 85251", |
| "100 S State St, Provo, UT 84601", |
| "100 N College Ave, Fort Collins, CO 80524", |
| "200 E Main St, Lakeland, FL 33801", |
| "100 S Main St, Savannah, GA 31401", |
| "100 W Liberty St, Roanoke, VA 24011", |
| "200 E Bay St, Charleston, SC 29401", |
| "100 N Main St, Greensburg, PA 15601", |
| "100 S Palafox St, Pensacola, FL 32502", |
| "200 W Capitol Dr, Baton Rouge, LA 70801", |
| "100 E Main St, Mesa, AZ 85201", |
| "100 N Central Ave, St. Louis, MO 63101", |
| "200 Ross St, Pittsburgh, PA 15219", |
| "100 Woodward Ave, Detroit, MI 48226", |
| "100 W Main St, Bozeman, MT 59715", |
| "100 S 1st Ave, Sioux Falls, SD 57104", |
| "200 N Main St, Santa Fe, NM 87501", |
| "100 N Stone Ave, Albuquerque, NM 87102", |
| "100 S Capitol Blvd, Boise, ID 83702", |
| |
| "200 E Main St, Asheville, NC 28801", |
| "100 Congress Ave, Austin, TX 78701", |
| "200 E Commerce St, San Jose, CA 95113", |
| "100 W Flagler St, Miami, FL 33130", |
| "200 S Orange Ave, Sarasota, FL 34236", |
| "100 N Main St, Gainesville, FL 32601", |
| "200 E College Ave, Tallahassee, FL 32301", |
| "100 N Main St, Fayetteville, AR 72701", |
| "100 E Market St, Des Moines, IA 50309", |
| "200 N Main St, McAllen, TX 78501", |
| "100 S Broadway, Wichita Falls, TX 76301", |
| "100 W Front St, Missoula, MT 59802", |
| "200 E Main St, Rapid City, SD 57701", |
| "100 N 1st St, Bismarck, ND 58501", |
| "200 W Superior St, Duluth, MN 55802", |
| "100 E Main St, Rochester, NY 14604", |
| "200 S Warren St, Syracuse, NY 13202", |
| "100 Main St, Buffalo, NY 14202", |
| "200 E State St, Trenton, NJ 08608", |
| "100 S Main St, Harrisburg, PA 17101", |
| ] |
| |
| MAX_METROS: int | None = None |
| METROS: list[str] = _ALL_METROS[:MAX_METROS] if MAX_METROS else _ALL_METROS |
| RENTCAST_PROPERTY_TYPES = ["Multi-Family", "Apartment", "Single Family", "Condo", "Townhouse"] |
| RENTCAST_RADIUS_MILES = 5.0 |
| RENTCAST_MAX_RESULTS = 500 |
|
|
| |
| |
| |
| |
| INCOME_KEYS: dict[str, str] = { |
| "Total Revenue": "stmt_revenue", |
| "Net Income": "stmt_net_income", |
| "EBITDA": "stmt_ebitda", |
| "EBIT": "stmt_ebit", |
| "Gross Profit": "stmt_gross_profit", |
| "Operating Income": "stmt_operating_income", |
| "Basic EPS": "stmt_basic_eps", |
| |
| "Tax Provision": "stmt_tax_provision", |
| "Pretax Income": "stmt_pretax_income", |
| "Interest Expense": "stmt_interest_expense", |
| "Tax Rate For Calcs": "stmt_tax_rate", |
| |
| "Cost Of Revenue": "stmt_cogs", |
| "Operating Expense": "stmt_operating_expenses", |
| } |
| BALANCE_KEYS: dict[str, str] = { |
| "Total Assets": "stmt_total_assets", |
| "Total Liabilities Net Minority Interest": "stmt_total_liabilities", |
| "Total Debt": "stmt_total_debt", |
| "Total Equity Gross Minority Interest": "stmt_total_equity", |
| "Cash And Cash Equivalents": "stmt_cash", |
| "Ordinary Shares Number": "stmt_shares_outstanding", |
| "Share Issued": "stmt_shares_issued", |
| |
| "Accounts Receivable": "stmt_accounts_receivable", |
| "Net Receivables": "stmt_accounts_receivable", |
| "Inventory": "stmt_inventory", |
| "Current Assets": "stmt_current_assets", |
| "Net PPE": "stmt_ppe_net", |
| "Goodwill": "stmt_goodwill", |
| "Accounts Payable": "stmt_accounts_payable", |
| "Current Liabilities": "stmt_current_liabilities", |
| "Long Term Debt": "stmt_lt_debt", |
| } |
| CASHFLOW_KEYS: dict[str, str] = { |
| "Operating Cash Flow": "stmt_operating_cashflow", |
| "Free Cash Flow": "stmt_free_cashflow", |
| "Capital Expenditure": "stmt_capex", |
| "Financing Cash Flow": "stmt_financing_cashflow", |
| } |
|
|
| |
| |
| |
| |
| XBRL_TAG_MAP: dict[str, list[str]] = { |
| "stmt_revenue": [ |
| "Revenues", |
| "RevenueFromContractWithCustomerExcludingAssessedTax", |
| "SalesRevenueNet", |
| "RevenueFromContractWithCustomerIncludingAssessedTax", |
| |
| "InterestAndDividendIncomeOperating", |
| "InterestIncomeExpenseNet", |
| "NetInterestIncome", |
| "NoninterestIncome", |
| "FinancialServicesRevenue", |
| |
| "PremiumsEarnedNet", |
| "InsuranceServicesRevenue", |
| "PremiumsWrittenNet", |
| |
| "Revenue", |
| "RevenueFromContractsWithCustomers", |
| ], |
| "stmt_net_income": [ |
| "NetIncomeLoss", |
| |
| "ProfitLoss", |
| "ProfitLossAttributableToOwnersOfParent", |
| ], |
| "stmt_ebit": [ |
| "OperatingIncomeLoss", |
| |
| "ProfitLossBeforeFinanceCostsAndTax", |
| "OperatingProfitLoss", |
| ], |
| "stmt_gross_profit": [ |
| "GrossProfit", |
| ], |
| "stmt_operating_income": [ |
| "OperatingIncomeLoss", |
| |
| "ProfitLossFromOperatingActivities", |
| "OperatingProfitLoss", |
| ], |
| "stmt_basic_eps": [ |
| "EarningsPerShareBasic", |
| |
| "BasicEarningsLossPerShare", |
| ], |
| "stmt_tax_provision": [ |
| "IncomeTaxExpenseBenefit", |
| |
| "IncomeTaxExpenseContinuingOperations", |
| ], |
| "stmt_pretax_income": [ |
| "IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest", |
| |
| "ProfitLossBeforeTax", |
| ], |
| "stmt_interest_expense": [ |
| "InterestExpense", |
| |
| "FinanceCosts", |
| "InterestExpenseOnBorrowings", |
| ], |
| "stmt_operating_cashflow": [ |
| "NetCashProvidedByUsedInOperatingActivities", |
| |
| "CashFlowsFromUsedInOperatingActivities", |
| ], |
| "stmt_capex": [ |
| "PaymentsToAcquirePropertyPlantAndEquipment", |
| |
| "PurchaseOfPropertyPlantAndEquipmentClassifiedAsInvestingActivities", |
| ], |
| "stmt_total_assets": ["Assets"], |
| "stmt_total_liabilities": ["Liabilities"], |
| "stmt_total_debt": [ |
| "LongTermDebt", |
| "LongTermDebtNoncurrent", |
| |
| "NoncurrentFinancialLiabilities", |
| "BorrowingsNoncurrent", |
| "NoncurrentPortionOfNoncurrentBorrowings", |
| ], |
| "stmt_total_equity": [ |
| "StockholdersEquity", |
| "StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest", |
| |
| "Equity", |
| "EquityAttributableToOwnersOfParent", |
| ], |
| "stmt_cash": [ |
| "CashAndCashEquivalentsAtCarryingValue", |
| "CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents", |
| |
| "CashAndCashEquivalents", |
| ], |
| "stmt_shares_outstanding": [ |
| "CommonStockSharesOutstanding", |
| "EntityCommonStockSharesOutstanding", |
| |
| "WeightedAverageNumberOfSharesOutstandingBasic", |
| "WeightedAverageNumberOfDilutedSharesOutstanding", |
| "CommonSharesOutstanding", |
| ], |
| "stmt_shares_issued": [ |
| "CommonStockSharesIssued", |
| |
| "IssuedCapital", |
| ], |
| |
| "stmt_accounts_receivable": [ |
| "AccountsReceivableNetCurrent", |
| "AccountsReceivableNet", |
| |
| "TradeAndOtherCurrentReceivables", |
| ], |
| "stmt_inventory": [ |
| "InventoryNet", |
| "Inventories", |
| |
| "CurrentInventories", |
| ], |
| "stmt_current_assets": [ |
| "AssetsCurrent", |
| |
| "CurrentAssets", |
| ], |
| "stmt_ppe_net": [ |
| "PropertyPlantAndEquipmentNet", |
| |
| "PropertyPlantAndEquipment", |
| ], |
| "stmt_goodwill": [ |
| "Goodwill", |
| |
| "GoodwillGross", |
| ], |
| "stmt_accounts_payable": [ |
| "AccountsPayableCurrent", |
| "AccountsPayable", |
| |
| "TradeAndOtherCurrentPayables", |
| ], |
| "stmt_current_liabilities": [ |
| "LiabilitiesCurrent", |
| |
| "CurrentLiabilities", |
| ], |
| "stmt_lt_debt": [ |
| "LongTermDebtNoncurrent", |
| "LongTermDebt", |
| "LongTermDebtAndCapitalLeaseObligations", |
| |
| "NoncurrentFinancialLiabilities", |
| "BorrowingsNoncurrent", |
| ], |
| |
| "stmt_cogs": [ |
| "CostOfGoodsAndServicesSold", |
| "CostOfRevenue", |
| "CostOfGoodsSold", |
| |
| "CostOfSales", |
| ], |
| "stmt_operating_expenses": [ |
| "OperatingExpenses", |
| |
| "AdministrativeExpense", |
| ], |
| |
| "stmt_financing_cashflow": [ |
| "NetCashProvidedByUsedInFinancingActivities", |
| |
| "CashFlowsFromUsedInFinancingActivities", |
| ], |
| } |
|
|
| |
| XBRL_DA_TAGS: list[str] = [ |
| "DepreciationDepletionAndAmortization", |
| "DepreciationAndAmortization", |
| "Depreciation", |
| |
| "DepreciationAmortisationAndImpairmentLossReversalOfImpairmentLossRecognisedInProfitOrLoss", |
| "DepreciationAndAmortisationExpense", |
| ] |
|
|
| |
| |
| |
| |
| |
| |
| TEMPORAL_SPLIT_DATE: str | None = None |
|
|
| |
| |
| TEMPORAL_SPLIT_RATIO: float = 0.7 |
|
|
| |
| |
| |
| |
| |
| HORIZONS_BY_GRANULARITY: dict[str, list[int]] = { |
| "daily": [5, 21, 63, 126, 252], |
| "weekly": [4, 13, 26, 52], |
| "monthly": [1, 3, 6, 12], |
| } |
| LOOKBACK_WINDOWS_BY_GRANULARITY: dict[str, list[int]] = { |
| "daily": [63, 126, 252], |
| "weekly": [13, 26, 52], |
| "monthly": [3, 6, 12], |
| } |
|
|
| |
| HORIZONS: list[int] = HORIZONS_BY_GRANULARITY[GRANULARITY] |
| LOOKBACK_WINDOWS: list[int] = LOOKBACK_WINDOWS_BY_GRANULARITY[GRANULARITY] |
|
|
|
|
| def get_horizons(granularity: str | None = None) -> list[int]: |
| """Return forecast horizons for *granularity*.""" |
| return HORIZONS_BY_GRANULARITY[granularity or GRANULARITY] |
|
|
|
|
| def get_lookback_windows(granularity: str | None = None) -> list[int]: |
| """Return lookback windows for *granularity*.""" |
| return LOOKBACK_WINDOWS_BY_GRANULARITY[granularity or GRANULARITY] |
|
|
| |
| |
| |
| |
| |
| SCENARIO_FEDFUNDS_DELTA = 0.25 |
|
|
| |
| SCENARIO_VIX_SPIKE_RATIO = 1.4 |
| SCENARIO_VIX_ROLLING_WINDOW = 63 |
|
|
| |
| SCENARIO_OIL_PCT_CHANGE = 0.09 |
| SCENARIO_OIL_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_NATGAS_PCT_CHANGE = 0.15 |
| SCENARIO_NATGAS_ROLLING_WINDOW = 4 |
|
|
| |
| SCENARIO_SP500_DRAWDOWN = 0.025 |
| SCENARIO_SP500_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_NASDAQ_PCT_CHANGE = 0.045 |
| SCENARIO_NASDAQ_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_YIELD_CURVE_INVERSION = 0.0 |
| SCENARIO_YIELD_CURVE_STEEPENING = 0.50 |
| SCENARIO_YIELD_CURVE_WINDOW = 63 |
|
|
| |
| SCENARIO_DGS10_DELTA = 0.45 |
| SCENARIO_DGS10_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_USD_PCT_CHANGE = 0.025 |
| SCENARIO_USD_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_CPI_MOM_THRESHOLD = 0.004 |
|
|
| |
| SCENARIO_PPI_MOM_THRESHOLD = 0.01 |
|
|
| |
| SCENARIO_UNRATE_DELTA = 0.3 |
|
|
| |
| SCENARIO_ICSA_SPIKE_RATIO = 1.3 |
| SCENARIO_ICSA_ROLLING_WINDOW = 8 |
|
|
| |
| SCENARIO_PAYROLLS_DELTA = 0.002 |
|
|
| |
| SCENARIO_HY_SPREAD_DELTA = 1.0 |
| SCENARIO_HY_SPREAD_WINDOW = 21 |
|
|
| |
| SCENARIO_IG_SPREAD_DELTA = 0.30 |
| SCENARIO_IG_SPREAD_WINDOW = 21 |
|
|
| |
| SCENARIO_TED_SPIKE = 0.50 |
|
|
| |
| SCENARIO_FSI_THRESHOLD = 1.0 |
|
|
| |
| SCENARIO_MORTGAGE_DELTA = 0.50 |
| SCENARIO_MORTGAGE_ROLLING_WINDOW = 4 |
|
|
| |
| SCENARIO_SENTIMENT_PCT_CHANGE = 0.10 |
| SCENARIO_SENTIMENT_ROLLING_WINDOW = 2 |
|
|
| |
| SCENARIO_INDPRO_PCT_CHANGE = 0.01 |
|
|
| |
| SCENARIO_RETAIL_PCT_CHANGE = 0.02 |
|
|
| |
| SCENARIO_HOUSING_PCT_CHANGE = 0.10 |
|
|
| |
| SCENARIO_HOME_PRICE_YOY_DELTA = 0.03 |
|
|
| |
| SCENARIO_M2_YOY_THRESHOLD = -0.01 |
|
|
| |
| SCENARIO_DGS30_DELTA = 0.50 |
| SCENARIO_DGS30_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_SP_NASDAQ_DIVERGENCE = 0.05 |
| SCENARIO_SP_NASDAQ_WINDOW = 21 |
|
|
| |
| SCENARIO_VIX_REGIME_THRESHOLD = 25.0 |
| SCENARIO_VIX_REGIME_MIN_DAYS = 10 |
|
|
| |
| SCENARIO_FX_PCT_CHANGE = 0.03 |
| SCENARIO_FX_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_BEI_DELTA = 0.30 |
| SCENARIO_BEI_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_DJIA_PCT_CHANGE = 0.03 |
| SCENARIO_DJIA_ROLLING_WINDOW = 21 |
|
|
| |
| SCENARIO_JOLTS_PCT_CHANGE = 0.05 |
| SCENARIO_JOLTS_DEDUP_DAYS = 28 |
|
|
| |
| SCENARIO_EARNINGS_MOM_THRESHOLD = 0.005 |
|
|
| |
| SCENARIO_VEHICLE_PCT_CHANGE = 0.08 |
|
|
| |
| SCENARIO_PERMIT_PCT_CHANGE = 0.08 |
|
|
| |
| SCENARIO_EXISTING_HOME_SALES_PCT = 0.05 |
|
|
| |
| SCENARIO_NFCI_THRESHOLD = 0.0 |
|
|
| |
| SCENARIO_FED_BS_PCT_CHANGE = 0.05 |
| SCENARIO_FED_BS_ROLLING_WINDOW = 13 |
|
|
| |
| SCENARIO_MONETARY_BASE_PCT = 0.05 |
|
|
| |
| SCENARIO_BUSLOANS_PCT_CHANGE = 0.02 |
|
|
| |
| SCENARIO_PCEPI_MOM_THRESHOLD = 0.004 |
|
|
| |
| SCENARIO_SOFR_DELTA = 0.25 |
| SCENARIO_SOFR_WINDOW = 10 |
|
|
| |
| |
| SCENARIO_REAL_YIELD_DELTA = 0.40 |
| SCENARIO_REAL_YIELD_WINDOW = 21 |
| |
| SCENARIO_CREDIT_COMPRESSION_DELTA = 0.75 |
| SCENARIO_CREDIT_COMPRESSION_WINDOW = 21 |
| |
| SCENARIO_TERM_PREMIUM_DELTA = 0.50 |
| SCENARIO_TERM_PREMIUM_WINDOW = 21 |
| |
| SCENARIO_SP500_SHORT_DRAWDOWN = 0.03 |
| SCENARIO_SP500_SHORT_WINDOW = 5 |
| SCENARIO_NASDAQ_SHORT_PCT = 0.04 |
| SCENARIO_NASDAQ_SHORT_WINDOW = 5 |
| SCENARIO_OIL_SHORT_PCT = 0.08 |
| SCENARIO_OIL_SHORT_WINDOW = 5 |
| SCENARIO_DGS10_SHORT_DELTA = 0.25 |
| SCENARIO_DGS10_SHORT_WINDOW = 5 |
|
|
| |
| SCENARIO_PRE_WINDOW_DAYS = 63 |
| SCENARIO_POST_WINDOW_DAYS = 63 |
|
|
| |
| |
| |
| NEWS_WORKERS = 4 |
| NEWS_PER_TICKER_COUNT = 50 |
| NEWS_SCENARIO_LIMIT = 10 |
| NEWS_RATE_LIMIT_SEC = 1.0 |
|
|
| |
| |
| |
| COMMERCIAL_RE_TYPES = ["Office", "Retail", "Industrial", "Mixed-Use"] |
| COMMERCIAL_RE_SEED_LIMIT = 20 |
|
|
| |
| |
| |
| VALUATION_DIR = DATA_DIR / "valuation" |
|
|
| |
| DCF_PROJECTION_YEARS = 5 |
| DCF_TERMINAL_GROWTH_DEFAULT = 0.025 |
| MARKET_RISK_PREMIUM = 0.06 |
| BETA_LOOKBACK_DAYS = 252 |
|
|
| |
| COMPS_MAX_PEERS = 10 |
| COMPS_MARKET_CAP_BAND = 0.5 |
|
|
| |
| VALUATION_BENCHMARK_TASKS = [ |
| "valuation_accuracy", |
| "statement_generation", |
| "scenario_forecast", |
| ] |
| VALUATION_HOLDOUT_RATIO = 0.3 |
|
|
| |
| |
| |
| |
| XBRL_COMPANY_FACTS_URL = "https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json" |
| XBRL_WORKERS = 8 |
| XBRL_RATE_LIMIT_SEC = 0.12 |
| |
| |
| |
| |
| |
| |
| XBRL_FORMS: list[str] = [ |
| |
| "10-K", "10-K/A", "10-Q", "10-Q/A", |
| "10-KT", "10-KT/A", "10-QT", |
| |
| "20-F", "20-F/A", "40-F", "40-F/A", "6-K", "6-K/A", |
| |
| "8-K", "8-K/A", |
| |
| "S-1", "S-1/A", "S-1MEF", |
| "F-1/A", "F-1MEF", |
| "S-3", "S-3ASR", |
| "S-4", "S-4/A", |
| "S-8", |
| "POS AM", |
| |
| "N-CSR", "N-2", |
| |
| "424B2", "424B5", "424B7", |
| |
| "DEF 14A", "PRE 14A", "DEFR14A", "DEFC14A", "PREM14A", |
| |
| "SC TO-I", |
| ] |
| |
| XBRL_CORE_THRESHOLD = 0.70 |
| XBRL_COMMON_THRESHOLD = 0.30 |
|
|