Social
Social
Trader profiles, social feeds, follows, and community features.
6 tables in this group.
trader_profiles
Public trader profiles with performance statistics for social features
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
user_id | uuid | No | |
display_name | varchar(100) | Yes | |
bio | text | Yes | |
avatar_url | text | Yes | |
total_trades | int4 | Yes | 0 |
winning_trades | int4 | Yes | 0 |
losing_trades | int4 | Yes | 0 |
win_rate | numeric | Yes | 0.00 |
total_pnl | numeric | Yes | 0.00 |
total_pnl_percent | numeric | Yes | 0.00 |
avg_trade_duration_seconds | int4 | Yes | 0 |
best_trade_pnl | numeric | Yes | 0.00 |
worst_trade_pnl | numeric | Yes | 0.00 |
max_drawdown | numeric | Yes | 0.00 |
sharpe_ratio | numeric | Yes | 0.00 |
follower_count | int4 | Yes | 0 |
following_count | int4 | Yes | 0 |
rank | int4 | Yes | |
rank_percentile | numeric | Yes | |
stats_last_updated | timestamptz | Yes | |
created_at | timestamptz | No | now() |
updated_at | timestamptz | No | now() |
RLS Policies:
trader_profiles_public_select— SELECT for {authenticated}trader_profiles_service_all— ALL for {service_role}trader_profiles_user_insert— INSERT for {authenticated}trader_profiles_user_update— UPDATE for {authenticated}
Indexes:
idx_trader_profiles_display_nameidx_trader_profiles_follower_countidx_trader_profiles_rankidx_trader_profiles_total_pnlidx_trader_profiles_user_ididx_trader_profiles_win_ratetrader_profiles_pkeytrader_profiles_user_id_key
user_follows
Follow relationships between traders
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
follower_id | uuid | No | |
followed_id | uuid | No | |
created_at | timestamptz | No | now() |
RLS Policies:
user_follows_delete— DELETE for {authenticated}user_follows_insert— INSERT for {authenticated}user_follows_select— SELECT for {authenticated}user_follows_service_all— ALL for {service_role}
Indexes:
idx_user_follows_created_atidx_user_follows_followed_ididx_user_follows_follower_iduser_follows_pkeyuser_follows_unique
social_feed_events
Activity feed events for social trading
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
event_type | feed_event_type | No | |
user_id | uuid | No | |
title | varchar(255) | No | |
description | text | Yes | |
metadata | jsonb | Yes | '{}'::jsonb |
trade_id | uuid | Yes | |
discussion_id | uuid | Yes | |
visibility | privacy_level | No | 'public'::privacy_level |
view_count | int4 | Yes | 0 |
like_count | int4 | Yes | 0 |
comment_count | int4 | Yes | 0 |
is_flagged | bool | Yes | false |
is_hidden | bool | Yes | false |
created_at | timestamptz | No | now() |
RLS Policies:
social_feed_events_delete— DELETE for {authenticated}social_feed_events_insert— INSERT for {authenticated}social_feed_events_select— SELECT for {authenticated}social_feed_events_service_all— ALL for {service_role}social_feed_events_update— UPDATE for {authenticated}
Indexes:
idx_social_feed_events_created_atidx_social_feed_events_discussion_ididx_social_feed_events_event_typeidx_social_feed_events_metadata_ginidx_social_feed_events_public_feedidx_social_feed_events_trade_ididx_social_feed_events_user_ididx_social_feed_events_visibilitysocial_feed_events_pkey
user_privacy_settings
Privacy controls for social trading features
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
user_id | uuid | No | |
profile_visibility | privacy_level | No | 'public'::privacy_level |
show_trades | bool | No | true |
show_portfolio_value | bool | No | false |
show_pnl | bool | No | true |
allow_followers | bool | No | true |
anonymous_mode | bool | No | false |
show_in_leaderboard | bool | No | true |
show_trade_history | bool | No | false |
created_at | timestamptz | No | now() |
updated_at | timestamptz | No | now() |
RLS Policies:
user_privacy_settings_service_all— ALL for {service_role}user_privacy_settings_user_insert— INSERT for {authenticated}user_privacy_settings_user_select— SELECT for {authenticated}user_privacy_settings_user_update— UPDATE for {authenticated}
Indexes:
idx_user_privacy_settings_publicidx_user_privacy_settings_user_iduser_privacy_settings_pkeyuser_privacy_settings_user_id_key
moderation_reports
Content moderation reports for community safety
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
reporter_id | uuid | No | |
reported_event_id | uuid | Yes | |
reported_user_id | uuid | Yes | |
report_type | report_type | No | |
reason | text | No | |
status | moderation_status | No | 'pending'::moderation_status |
reviewed_by | uuid | Yes | |
reviewed_at | timestamptz | Yes | |
review_notes | text | Yes | |
action_taken | text | Yes | |
created_at | timestamptz | No | now() |
updated_at | timestamptz | No | now() |
RLS Policies:
moderation_reports_insert— INSERT for {authenticated}moderation_reports_reporter_select— SELECT for {authenticated}moderation_reports_service_all— ALL for {service_role}
Indexes:
idx_moderation_reports_pendingidx_moderation_reports_report_typeidx_moderation_reports_reported_event_ididx_moderation_reports_reported_user_ididx_moderation_reports_reporter_ididx_moderation_reports_statusmoderation_reports_pkey
user_feedback
User feedback with semantic embeddings for similarity search and clustering
| Column | Type | Nullable | Default |
|---|---|---|---|
id | uuid | No | gen_random_uuid() |
user_id | uuid | Yes | |
text | text | No | |
classification | text | Yes | |
sentiment_score | float8 | Yes | |
priority_score | int4 | Yes | |
embedding | vector | Yes | |
processed | bool | Yes | false |
archon_task_id | text | Yes | |
created_at | timestamptz | Yes | now() |
updated_at | timestamptz | Yes | now() |
RLS Policies:
Service role can manage all feedback— ALL for {public}Users can insert own feedback— INSERT for {public}Users can update own feedback— UPDATE for {public}Users can view own feedback— SELECT for {public}
Indexes:
user_feedback_classification_idxuser_feedback_created_at_idxuser_feedback_embedding_idxuser_feedback_pkeyuser_feedback_processed_idxuser_feedback_user_id_idx