Skip to content

Commit 312a4fd

Browse files
committed
Lint
1 parent 7e0ef0e commit 312a4fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

protocol/x/affiliates/keeper/keeper.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,10 @@ func (k Keeper) OnStatsExpired(
610610
}
611611

612612
var newVolume *big.Int = lib.BigU(uint64(resultingVolume))
613-
if previousVolume >= affiliateParams.Maximum_30DAttributableVolumePerReferredUserNotional &&
614-
resultingVolume < affiliateParams.Maximum_30DAttributableVolumePerReferredUserNotional {
615-
deltaAttributedVolume := lib.BigU(affiliateParams.Maximum_30DAttributableVolumePerReferredUserNotional - resultingVolume)
613+
cap := affiliateParams.Maximum_30DAttributableVolumePerReferredUserNotional
614+
if previousVolume >= cap &&
615+
resultingVolume < cap {
616+
deltaAttributedVolume := lib.BigU(cap - resultingVolume)
616617
// Subtract the expired volume (use taker volume for consistency with how it's added)
617618
newVolume = new(big.Int).Sub(currentVolume, deltaAttributedVolume)
618619
}

0 commit comments

Comments
 (0)