Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dbt_project/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ clean-targets:
# Schema values map to BigQuery datasets. generate_schema_name appends
# environment suffixes for dev and staging targets while leaving prod canonical.
models:
dbt_project_evaluator:
+enabled: "{{ var('enable_dbt_project_evaluator', false) }}"
dbt_project:
+materialized: table
staging:
+schema: economics_staging
+materialized: view
corporate_actions:
+enabled: "{{ var('enable_legacy_staging_alias_models', false) }}"
split_adjusted_prices:
+enabled: "{{ var('enable_legacy_staging_alias_models', false) }}"
markets:
+schema: economics_marts
+materialized: table
major_indicies_summary:
+enabled: "{{ var('enable_legacy_misspelled_market_models', false) }}"
major_indicies_analysis_return:
+enabled: "{{ var('enable_legacy_misspelled_market_models', false) }}"
commodities:
+schema: economics_marts
+materialized: table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ select
period_end_price,
'major_index' as market_category,
cast(null as date) as snapshot_date
from {{ ref('major_indicies_summary') }}
from {{ ref('major_indices_summary') }}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ major_index_snapshot as (
period_end_price,
'major_index' as market_category,
DATE_TRUNC(period_end_date, MONTH) as snapshot_date
from {{ ref('major_indicies_summary') }}
from {{ ref('major_indices_summary') }}
{% if is_incremental() %}
where DATE_TRUNC(period_end_date, MONTH) >= COALESCE(
(select max(snapshot_date) from {{ this }}),
Expand Down
160 changes: 125 additions & 35 deletions dbt_project/models/agents_preprocess/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
models:
- name: agent_market_performance
description: >
Union of market summary models (us_sector, major_indicies, sp500, nasdaq)
Union of market summary models (us_sector, major_indices, sp500, nasdaq)
with standardized column names for agent consumption.
columns:
- name: symbol
Expand Down Expand Up @@ -58,65 +58,155 @@ models:
- not_null

- name: agent_financial_conditions_index
description: "Financial conditions index data for agent consumption"
description: >
Financial conditions index and component scores from the raw transformation output,
filtered to populated FCI observations for agent consumption.
columns:
- name: date
tests:
- not_null
- unique
- name: fci
tests:
- not_null

- name: agent_fred_monthly_diff
description: "FRED monthly differences for agent consumption"
description: >
Monthly FRED series observations and period-over-period differences for agent consumption.
tests:
- unique_combination:
arguments:
combination_of_columns: [series_code, date]
columns:
- name: series_code
tests:
- not_null
- name: date
tests:
- not_null

- name: agent_housing_inventory_latest_aggregates
description: "Housing inventory aggregates for agent consumption"
description: >
Latest housing inventory aggregate values and change metrics for agent consumption.
tests:
- unique_combination:
arguments:
combination_of_columns: [series_code, month, date_grain]
config:
severity: warn
columns:
- name: series_code
tests:
- not_null
- name: month
tests:
- not_null
- name: current_value
tests:
- not_null

- name: agent_housing_mortgage_rates
description: "Housing mortgage rates for agent consumption"
description: >
Mortgage rate and estimated monthly payment series for agent consumption.
columns:
- name: date
tests:
- not_null
- unique

- name: agent_reddit_posts_daily
description: "Daily Reddit post aggregates for agent consumption"
description: >
Raw daily Reddit post records exposed for agent consumption.
tests:
- unique_combination:
arguments:
combination_of_columns: [title, subreddit, partition_date]
config:
severity: warn
columns:
- name: title
tests:
- not_null
- name: subreddit
tests:
- not_null
- name: partition_date
tests:
- not_null

- name: agent_reddit_sentiment_trends
description: "Reddit sentiment trends for agent consumption"
description: >
Daily Reddit sentiment trend metrics by subreddit for agent consumption.
tests:
- unique_combination:
arguments:
combination_of_columns: [date, subreddit]
columns:
- name: date
tests:
- not_null
- name: subreddit
tests:
- not_null

- name: agent_fred_series_latest_aggregates_snapshot
description: "Snapshot view of FRED aggregates for agent consumption"
tests:
- unique_combination:
arguments:
combination_of_columns: [snapshot_date, series_code, month, date_grain]
columns:
- name: snapshot_date
tests:
- not_null
- name: series_code
tests:
- not_null

- name: agent_leading_econ_return_indicator_snapshot
description: "Snapshot view of leading economic return indicator for agent consumption"
columns:
- name: snapshot_date
tests:
- not_null
- name: symbol
tests:
- not_null

- name: agent_market_performance_snapshot
description: "Incremental snapshot of market performance for agent consumption"
tests:
- unique_combination:
arguments:
combination_of_columns: [snapshot_date, market_category, symbol, asset_type, time_period]
config:
severity: warn
columns:
- name: snapshot_date
tests:
- not_null
- name: symbol
tests:
- not_null

- name: agent_commodity_performance_snapshot
description: "Incremental snapshot of commodity performance for agent consumption"

- name: agent_treasury_yield_curve_spreads
description: "Incremental treasury yield curve spreads for agent consumption"
tests:
- unique_combination:
arguments:
combination_of_columns: ['date']
combination_of_columns: [snapshot_date, commodity_category, commodity_name, commodity_unit, time_period]
columns:
- name: date
description: Treasury yield observation date.
tests:
- not_null
- name: yield_3m
description: Three-month Treasury yield.
- name: yield_2y
description: Two-year Treasury yield.
- name: yield_10y
description: Ten-year Treasury yield.
- name: spread_10y_2y
description: Ten-year minus two-year Treasury yield spread.
- name: spread_10y_3m
description: Ten-year minus three-month Treasury yield spread.
- name: curve_shape
description: Yield curve shape classification.
- name: snapshot_date
tests:
- accepted_values:
arguments:
values: ['Steep', 'Normal', 'Flat', 'Inverted']
- name: inversion_status
description: Yield curve inversion status.
- not_null
- name: commodity_name
tests:
- accepted_values:
arguments:
values: ['Normal', 'Inverted', 'Inverted (10Y-3M)']
- not_null

- name: agent_treasury_yield_curve_spreads
description: "Incremental treasury yield curve spreads for agent consumption"
columns:
- name: date
tests:
- not_null
- unique
4 changes: 2 additions & 2 deletions dbt_project/models/analysis/base_historical_analysis.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ WITH return_data AS (
high_1yr,
low_1yr,
std_diff_1yr,
'major_indicies' AS category
FROM {{ ref('major_indicies_analysis_return') }}
'major_indices' AS category
FROM {{ ref('major_indices_analysis_return') }}

UNION ALL

Expand Down
54 changes: 52 additions & 2 deletions dbt_project/models/analysis/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ models:
- name: std_diff_1yr
description: "Standard deviation difference over 1 year"
- name: category
description: "Asset category: currency, fixed_income, global_markets, major_indicies, or sector"
description: "Asset category: currency, fixed_income, global_markets, major_indices, or sector"
tests:
- not_null
- accepted_values:
arguments:
values: ['currency', 'fixed_income', 'global_markets', 'major_indicies', 'sector']
values: ['currency', 'fixed_income', 'global_markets', 'major_indices', 'sector']
- name: series_name
description: "Name of the FRED economic series"
- name: value
Expand Down Expand Up @@ -311,3 +311,53 @@ models:
description: "Sector's average exposure across all macro factors"
- name: factor_rank
description: "Rank of this sector within the factor (1 = highest exposure)"

- name: commodity_market_signals
description: >
Daily commodity market health signals, including copper/gold, gold/SPY,
and oil momentum indicators for market-regime analysis.
columns:
- name: date
tests:
- not_null
- unique

- name: reddit_cross_subreddit_activity
description: >
Cross-subreddit story detection using shared URLs and repeated titles across
financial and economic Reddit communities.
tests:
- unique_combination:
arguments:
combination_of_columns: [match_type, match_key, partition_date]
config:
severity: warn
columns:
- name: match_type
tests:
- not_null
- accepted_values:
arguments:
values: ['url_match', 'title_match']
- name: match_key
tests:
- not_null
- name: partition_date
tests:
- not_null

- name: reddit_thread_structure
description: >
Thread-level Reddit comment structure metrics, including depth, reply ratio,
controversy flags, and discussion quality by post.
columns:
- name: post_id
tests:
- not_null
- unique
- name: subreddit
tests:
- not_null
- name: partition_date
tests:
- not_null
Loading
Loading