Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monthly rewards #890

Merged
merged 8 commits into from
Mar 1, 2024
Merged

Monthly rewards #890

merged 8 commits into from
Mar 1, 2024

Conversation

huumn
Copy link
Member

@huumn huumn commented Feb 29, 2024

We are doing a monthly rewards experiment. To better support this so far we have:

  • added placeholders for stackers hidden from top
    • people know exactly where they sit in ranking now
    • this was applied to all top stacker rankings (e.g. top cowboys)
  • views computing a stackers rewardability

TODO:

  • custom page (perhaps reusing /rewards) for monthly rewards with more rewardable stackers
  • display estimated rewards for the month for each stacker
  • overhaul rewards to only apply monthly
    • footer update
    • new earn job logic
  • test views
  • test earn (not urgent ... can wait until 4/1)
  • notifications (not urgent ... can wait until 4/1)
  • refine reward page query for topUsers

(what === 'stackers' && (query.by === 'stacked' || !USER_SORTS.includes(query.by))) ||
(what === 'territories' && (query.by === 'stacked' || !SUB_SORTS.includes(query.by))) ||
(what === 'stackers' && (query.by === 'rewardability' || !USER_SORTS.includes(query.by))) ||
(what === 'territories' && (query.by === 'stacking' || !SUB_SORTS.includes(query.by))) ||
(['posts', 'comments'].includes(what) && (query.by === 'zaprank' || !ITEM_SORTS.includes(query.by)))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also changed stacked to stacking and spent to spending ... I felt like it was clearer.

@huumn huumn requested a review from ekzyis March 1, 2024 04:09
@huumn huumn marked this pull request as ready for review March 1, 2024 04:09
@huumn huumn merged commit 0b0e36e into master Mar 1, 2024
4 checks passed
Copy link
Member

@ekzyis ekzyis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't find anything but left some comments and

  • verified that earn runs once per month now
  • verified that proportions in lib/madness.js add up to 1:
$ cat lib/madness.js | sed -e '1d' -e '$d' | awk -F',' '{sum+=$1;} END{print sum;}'
1

const UPVOTE_EACH_REWARD = 4.0
const TOP_PERCENTILE = 33
const TOTAL_UPPER_BOUND_MSATS = 1000000000
const TOTAL_UPPER_BOUND_MSATS = 10000000000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: good use case for underscore notation:

- 10000000000
+ 10_000_000_000

GROUP BY users.id
ORDER BY streak DESC, created_at ASC
OFFSET $3
LIMIT ${LIMIT}`, ...range, decodedCursor.offset)
).map(
u => u.hideFromTopUsers || u.hideCowboyHat ? null : u
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be cool to not hide the own account; only show that you are hidden for others.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but we'd need to indicate they are hidden for other people too (because they'd go to view it and wonder if their setting has been applied)

percentile_cutoff INTEGER DEFAULT 33,
each_upvote_portion FLOAT DEFAULT 4.0,
each_item_portion FLOAT DEFAULT 4.0,
handicap_ids INTEGER[] DEFAULT '{616, 6030, 946, 4502}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anon with id 27 missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We exclude them in the earn job but it would've been nice to do here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants