File tree 3 files changed +379
-12
lines changed
3 files changed +379
-12
lines changed Original file line number Diff line number Diff line change @@ -415,8 +415,12 @@ export class DistributorV2Worker {
415
415
416
416
if ( sendCeilingData && sendCeilingData . weight > 0n ) {
417
417
const scaledPreviousReward = previousReward / BigInt ( sendSlash . scaling_divisor )
418
+ const cappedSendScore =
419
+ sendCeilingData . weight > scaledPreviousReward
420
+ ? scaledPreviousReward
421
+ : sendCeilingData . weight
418
422
if ( scaledPreviousReward > 0n ) {
419
- const slashPercentage = ( sendCeilingData . weight * PERC_DENOM ) / scaledPreviousReward
423
+ const slashPercentage = ( cappedSendScore * PERC_DENOM ) / scaledPreviousReward
420
424
amountAfterSlash = ( amount * slashPercentage ) / PERC_DENOM
421
425
} else {
422
426
amountAfterSlash = 0n
@@ -533,6 +537,11 @@ export class DistributorV2Worker {
533
537
fixedPoolAmountsByAddress [ share . address ] ?. amountAfterSlash || 0n
534
538
const amountAfterSlash = hodlerPoolAmountAfterSlash + fixedPoolAmountAfterSlash
535
539
540
+ // Skip if amountAfterSlash is 0
541
+ if ( amountAfterSlash <= 0n ) {
542
+ return null
543
+ }
544
+
536
545
// Update totals
537
546
totalAmount += amount
538
547
totalHodlerPoolAmount += hodlerPoolAmount
Original file line number Diff line number Diff line change @@ -1339,17 +1339,28 @@ export type Database = {
1339
1339
user_id : string
1340
1340
}
1341
1341
}
1342
- sum_qualification_sends : {
1343
- Args : {
1344
- distribution_number : number
1345
- send_ceiling : number
1346
- }
1347
- Returns : {
1348
- user_id : string
1349
- amount : number
1350
- sent_to : string [ ]
1351
- } [ ]
1352
- }
1342
+ sum_qualification_sends :
1343
+ | {
1344
+ Args : {
1345
+ distribution_number : number
1346
+ }
1347
+ Returns : {
1348
+ user_id : string
1349
+ amount : number
1350
+ sent_to : string [ ]
1351
+ } [ ]
1352
+ }
1353
+ | {
1354
+ Args : {
1355
+ distribution_number : number
1356
+ send_ceiling : number
1357
+ }
1358
+ Returns : {
1359
+ user_id : string
1360
+ amount : number
1361
+ sent_to : string [ ]
1362
+ } [ ]
1363
+ }
1353
1364
tag_search : {
1354
1365
Args : {
1355
1366
query : string
You can’t perform that action at this time.
0 commit comments