Skip to content

Commit

Permalink
Revert "Revert "Discount self-referential, whale, and gambling market…
Browse files Browse the repository at this point in the history
…s from feed""

This reverts commit 72a0155.
  • Loading branch information
jahooma committed Apr 26, 2023
1 parent 8e27929 commit 5532226
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions backend/supabase/functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ or replace function get_recommended_contracts_embeddings_from (
) / 2000.0 as relative_dist,
lpc.popularity_score,
lpc.created_time,
lpc.close_time
lpc.close_time,
coalesce((lpc.data->>'groupSlugs')::text[], array[]::text[]) as group_slugs
from contract_embeddings as ce
join listed_open_contracts lpc on lpc.id = contract_id
where not exists (
Expand Down Expand Up @@ -127,7 +128,18 @@ or replace function get_recommended_contracts_embeddings_from (
when close_time <= NOW() + interval '1 year' then 0.33
else 0.25
end
) * log(coalesce(popularity_score, 0) + 2) / (relative_dist + 0.1) as score
) * (log(coalesce(popularity_score, 0) + 2) / (relative_dist + 0.1))
* (
case
when
'gambling' = ANY(group_slugs) OR
'whale-watching' = ANY(group_slugs) OR
'selfresolving' = ANY(group_slugs)
then 0.25
else 1
end
)
as score
from available_contracts_unscored
),
new_contracts as (
Expand Down Expand Up @@ -285,7 +297,8 @@ select data,
relative_dist,
combined_results.popularity_score
from combined_results
join contracts on contracts.id = combined_results.contract_id $$;
join contracts on contracts.id = combined_results.contract_id
$$;

create
or replace function get_cpmm_pool_prob (pool jsonb, p numeric) returns numeric language plpgsql immutable parallel safe as $$
Expand Down
1 change: 1 addition & 0 deletions common/src/envs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const HOME_BLOCKED_GROUP_SLUGS = [
'test',
'private-markets',
'proofniks',
'personal-goals',
]

export const EXTERNAL_REDIRECTS = ['/umami']
Expand Down

0 comments on commit 5532226

Please sign in to comment.