bitcain docs

Sentiment Analysis

Sentiment Analysis

Social sentiment tracking, fear/greed index, and sentiment-price correlation.

10 tables in this group.

sentiment_analyses

ColumnTypeNullableDefault
iduuidNo
analysis_idvarchar(100)No
texttextNo
languagevarchar(10)Yes
sourcevarchar(20)Yes
sentiment_scorenumericNo
sentiment_labelvarchar(20)No
confidencenumericNo
text_lengthint4No
processing_time_msint4No
include_entitiesboolYes
include_keywordsboolYes
sentiment_breakdownjsonYes
emotional_indicatorsjsonYes
market_relevancejsonYes
entitiesjsonYes
keywordsjsonYes
created_attimestampNo
updated_attimestampYes

RLS Policies:

  • sentiment_analyses_public_select — SELECT for {public}
  • sentiment_analyses_service_delete — DELETE for {public}
  • sentiment_analyses_service_insert — INSERT for {public}
  • sentiment_analyses_service_update — UPDATE for {public}

Indexes:

  • ix_sentiment_analyses_analysis_id
  • sentiment_analyses_pkey

sentiment_analysis

ColumnTypeNullableDefault
iduuidNo
symbolvarchar(20)No
analysis_datedateNo
overall_sentimentnumericNo
social_sentimentnumericYes
news_sentimentnumericYes
technical_sentimentnumericYes
very_bullish_pctnumericYes
bullish_pctnumericYes
neutral_pctnumericYes
bearish_pctnumericYes
very_bearish_pctnumericYes
total_mentionsint4Yes
positive_mentionsint4Yes
negative_mentionsint4Yes
neutral_mentionsint4Yes
twitter_mentionsint4Yes
reddit_mentionsint4Yes
news_articlesint4Yes
forum_postsint4Yes
confidence_scorenumericYes
data_quality_scorenumericYes
created_attimestampNo
updated_attimestampYes

RLS Policies:

  • sentiment_analysis_public_select — SELECT for {public}
  • sentiment_analysis_service_delete — DELETE for {public}
  • sentiment_analysis_service_insert — INSERT for {public}
  • sentiment_analysis_service_update — UPDATE for {public}

Indexes:

  • ix_sentiment_analysis_analysis_date
  • ix_sentiment_analysis_symbol
  • sentiment_analysis_pkey

ColumnTypeNullableDefault
iduuidNo
time_rangevarchar(10)No
categoryvarchar(20)Yes
last_updatedtimestampYes
trending_topicsjsonYes
sentiment_momentumjsonYes
social_volume_metricsjsonYes
trending_hashtagsjsonYes
emerging_narrativesjsonYes
created_attimestampNo

RLS Policies:

  • sentiment_trends_public_select — SELECT for {public}
  • sentiment_trends_service_delete — DELETE for {public}
  • sentiment_trends_service_insert — INSERT for {public}
  • sentiment_trends_service_update — UPDATE for {public}

Indexes:

  • sentiment_trends_pkey

sentiment_signals

Real-time sentiment analysis signals from X/Twitter and other sources

ColumnTypeNullableDefault
iduuidNogen_random_uuid()
symbolvarchar(20)No
sentiment_scorenumericNo
confidencenumericNo
volumeint4No0
trendingboolNofalse
key_influencers_textYesARRAY[]::text[]
sourcevarchar(50)No'twitter'::character varying
embeddingvectorYes
metadatajsonbYes'{}'::jsonb
created_attimestamptzNonow()
expires_attimestamptzNo

RLS Policies:

  • sentiment_signals_delete_policy — DELETE for {service_role}
  • sentiment_signals_insert_policy — INSERT for {service_role}
  • sentiment_signals_select_policy — SELECT for {anon,authenticated}
  • sentiment_signals_update_policy — UPDATE for {service_role}

Indexes:

  • idx_sentiment_signals_embedding_hnsw
  • idx_sentiment_signals_expires_at
  • idx_sentiment_signals_source
  • idx_sentiment_signals_symbol
  • idx_sentiment_signals_symbol_created
  • idx_sentiment_signals_trending
  • sentiment_signals_pkey
  • sentiment_signals_symbol_unique

sentiment_alerts

ColumnTypeNullableDefault
alert_iduuidNo
asset_symbolvarchar(20)No
alert_typevarchar(50)No
severityvarchar(20)No
threshold_valuenumericNo
current_valuenumericNo
messagetextNo
is_activeboolYes
triggered_attimestampNo
acknowledged_attimestampYes
created_attimestampNo

RLS Policies:

  • sentiment_alerts_public_select — SELECT for {public}
  • sentiment_alerts_service_delete — DELETE for {public}
  • sentiment_alerts_service_insert — INSERT for {public}
  • sentiment_alerts_service_update — UPDATE for {public}

Indexes:

  • ix_sentiment_alerts_asset_symbol
  • sentiment_alerts_pkey

fear_greed_index

ColumnTypeNullableDefault
iduuidNo
current_indexint4No
classificationvarchar(20)No
time_rangevarchar(10)Yes
contributing_factorsjsonYes
market_conditionsjsonYes
historical_datajsonYes
include_historyboolYes
last_updatedtimestampYes
created_attimestampNo

RLS Policies:

  • fear_greed_index_public_select — SELECT for {public}
  • fear_greed_index_service_delete — DELETE for {public}
  • fear_greed_index_service_insert — INSERT for {public}
  • fear_greed_index_service_update — UPDATE for {public}

Indexes:

  • fear_greed_index_pkey

market_sentiment

ColumnTypeNullableDefault
iduuidNo
market_overviewjsonYes
time_rangevarchar(10)Yes
total_assets_analyzedint4Yes
data_pointsint4Yes
top_gainers_sentimentjsonYes
top_losers_sentimentjsonYes
sentiment_distributionjsonYes
sector_sentimentjsonYes
market_indicatorsjsonYes
last_updatedtimestampYes
created_attimestampNo

RLS Policies:

  • market_sentiment_public_select — SELECT for {public}
  • market_sentiment_service_delete — DELETE for {public}
  • market_sentiment_service_insert — INSERT for {public}
  • market_sentiment_service_update — UPDATE for {public}

Indexes:

  • market_sentiment_pkey

social_metrics

ColumnTypeNullableDefault
metric_iduuidNo
asset_symbolvarchar(20)No
platformvarchar(20)No
metric_typevarchar(30)No
valuenumericNo
timestamptimestampNo
symbolvarchar(20)No
engagement_datajsonNo
mention_countint4No
sentiment_averagenumericNo
engagement_scorenumericNo
volume_change_1hnumericNo
volume_change_24hnumericNo
top_keywordsjsonYes
influencer_mentionsjsonYes
created_attimestampNo

RLS Policies:

  • social_metrics_public_select — SELECT for {public}
  • social_metrics_service_delete — DELETE for {public}
  • social_metrics_service_insert — INSERT for {public}
  • social_metrics_service_update — UPDATE for {public}

Indexes:

  • ix_social_metrics_asset_symbol
  • ix_social_metrics_metric_type
  • ix_social_metrics_platform
  • ix_social_metrics_symbol
  • ix_social_metrics_timestamp
  • social_metrics_pkey

sentiment_price_correlation

Historical correlation analysis between sentiment signals and price movements

ColumnTypeNullableDefault
iduuidNogen_random_uuid()
symbolvarchar(20)No
time_windowvarchar(10)No
timestamptimestamptzNonow()
start_timetimestamptzNo
end_timetimestamptzNo
data_pointsint4No
pearson_coefficientnumericNo
spearman_coefficientnumericNo
kendall_coefficientnumericNo0.0
pearson_p_valuenumericNo
spearman_p_valuenumericNo
significance_levelvarchar(30)No'not_significant'::character varying
optimal_lag_minutesint4No
max_correlation_at_lagnumericNo
lag_confidencenumericNo
sample_sizeint4No
missing_data_pctnumericNo0.0
indicator_typevarchar(20)No'uncorrelated'::character varying
indicator_confidencenumericNo
price_volatilitynumericNo
price_change_pctnumericNo
abs_price_change_pctnumericNo
sentiment_volatilitynumericNo
avg_sentimentnumericNo
sentiment_changenumericNo
data_quality_scorenumericNo
confidence_scorenumericNo
model_versionvarchar(20)No'1.0.0'::character varying
computation_time_msint4No0
metadatajsonbYes'{}'::jsonb
created_attimestamptzNonow()
updated_attimestamptzNonow()

RLS Policies:

  • Anyone can view sentiment correlation — SELECT for {public}
  • Service role can manage correlation — ALL for {service_role}

Indexes:

  • idx_sentiment_correlation_high_confidence
  • idx_sentiment_correlation_significant
  • idx_sentiment_correlation_symbol_window_timestamp
  • idx_sentiment_correlation_timestamp
  • sentiment_price_correlation_pkey

sentiment_comparisons

ColumnTypeNullableDefault
iduuidNo
comparison_idvarchar(100)No
assetsjsonNo
time_rangevarchar(10)Yes
asset_sentimentsjsonYes
correlation_matrixjsonYes
relative_performancejsonYes
divergence_analysisjsonYes
market_contextjsonYes
created_attimestampNo
updated_attimestampYes

RLS Policies:

  • sentiment_comparisons_public_select — SELECT for {public}
  • sentiment_comparisons_service_delete — DELETE for {public}
  • sentiment_comparisons_service_insert — INSERT for {public}
  • sentiment_comparisons_service_update — UPDATE for {public}

Indexes:

  • ix_sentiment_comparisons_comparison_id
  • sentiment_comparisons_pkey

On this page