rewards: rm negative log range and lowest trust step = 1
This commit is contained in:
parent
e913ab71ad
commit
248e0c1c13
|
@ -86,9 +86,9 @@ function earn ({ models }) {
|
||||||
WHERE act = 'TIP'
|
WHERE act = 'TIP'
|
||||||
),
|
),
|
||||||
-- isolate contiguous upzaps from the same user on the same item so that when we take the log
|
-- isolate contiguous upzaps from the same user on the same item so that when we take the log
|
||||||
-- of the upzaps it accounts for successive zaps and does disproporionately reward them
|
-- of the upzaps it accounts for successive zaps and does not disproporionately reward them
|
||||||
upvoters AS (
|
upvoters AS (
|
||||||
SELECT "userId", id, ratio, "parentId", log(sum(tipped) / 1000) as tipped, min(acted_at) as acted_at
|
SELECT "userId", id, ratio, "parentId", GREATEST(log(sum(tipped) / 1000), 0) as tipped, min(acted_at) as acted_at
|
||||||
FROM upvoter_islands
|
FROM upvoter_islands
|
||||||
GROUP BY "userId", id, ratio, "parentId", island
|
GROUP BY "userId", id, ratio, "parentId", island
|
||||||
),
|
),
|
||||||
|
@ -96,7 +96,7 @@ function earn ({ models }) {
|
||||||
-- early multiplier: 10/ln(early_rank + e)
|
-- early multiplier: 10/ln(early_rank + e)
|
||||||
-- we also weight by trust in a step wise fashion
|
-- we also weight by trust in a step wise fashion
|
||||||
upvoter_ratios AS (
|
upvoter_ratios AS (
|
||||||
SELECT "userId", sum(early_multiplier*tipped_ratio*ratio*CASE WHEN users.id = ANY (${REDUCE_REWARDS}) THEN 0.2 ELSE CEIL(users.trust*2) END) as upvoter_ratio,
|
SELECT "userId", sum(early_multiplier*tipped_ratio*ratio*CASE WHEN users.id = ANY (${REDUCE_REWARDS}) THEN 0.2 ELSE CEIL(users.trust*2)+1 END) as upvoter_ratio,
|
||||||
"parentId" IS NULL as "isPost", CASE WHEN "parentId" IS NULL THEN 'TIP_POST' ELSE 'TIP_COMMENT' END as type
|
"parentId" IS NULL as "isPost", CASE WHEN "parentId" IS NULL THEN 'TIP_POST' ELSE 'TIP_COMMENT' END as type
|
||||||
FROM (
|
FROM (
|
||||||
SELECT *,
|
SELECT *,
|
||||||
|
|
Loading…
Reference in New Issue