Compare commits

...

2 Commits

Author SHA1 Message Date
keyan
be20500c06 account for fixed 1m for msm april 2024-04-30 14:51:48 -05:00
ekzyis
f2f3f71dd5
Fix migration name (#1131) 2024-04-30 14:14:10 -05:00
2 changed files with 8 additions and 1 deletions

View File

@ -69,7 +69,14 @@ export async function earn ({ name }) {
const notifications = {}
for (const [i, earner] of earners.entries()) {
const earnings = Math.floor(parseFloat(proportions[i] * sum))
let earnings = 0
if (i === 0) {
// top earner gets 1m sats
earnings = 1_000_000_000
} else {
// everyone else gets a proportion of the total
earnings = Math.floor(parseFloat(proportions[i - 1] * (sum - 1_000_000_000)))
}
total += earnings
if (total > sum) {
console.log(name, 'total exceeds sum', total, '>', sum)