Wrote a payouts NPM package for the notebooks

Said stab is starting to look pretty usable.

I’ve created a new repo https://github.com/sourcecred/payouts

Which is published to NPM as https://www.npmjs.com/package/@sourcecred/payouts

And I’ve refactored the week2 payouts notebook to use it:

There are some discrepancies between it and the original:

  • In the Fast Payouts table, the “% cred” column was incorrect in the original.
    {name: "% cred", fn: (a) => fastPayout.get(a) / totalFastPayout, format: percentFormat}
    This fastPayout and totalFastPayout represent mana, not cred.
  • In the Slow Payouts table, the “Target total payout” column had a rounding issue.
    The original used Math.round() when displaying and used the sum of unrounded values for the total. The new version uses Math.floor() for each user, and uses the sum of rounded values for the total.

Also, a request to include this repository in our instance.

Thanks @Beanow! I’ll use it for the next canonical grain distribution.