Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no service fee on penalties
Browse files Browse the repository at this point in the history
fhenneke committed Jan 15, 2025
1 parent a552291 commit ff05504
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
@@ -136,11 +136,19 @@ def total_outgoing_eth(self) -> int:

def total_cow_reward(self) -> int:
"""Total outgoing COW token reward"""
return int(self.reward_scaling() * self.primary_reward_cow)
return (
int(self.reward_scaling() * self.primary_reward_cow)
if self.primary_reward_cow > 0
else self.primary_reward_cow
)

def total_eth_reward(self) -> int:
"""Total outgoing ETH reward"""
return int(self.reward_scaling() * self.primary_reward_eth)
return (
int(self.reward_scaling() * self.primary_reward_eth)
if self.primary_reward_eth > 0
else self.primary_reward_eth
)

def reward_scaling(self) -> Fraction:
"""Scaling factor for service fee
@@ -149,7 +157,7 @@ def reward_scaling(self) -> Fraction:

def total_service_fee(self) -> Fraction:
"""Total service fee charged from rewards"""
return self.service_fee * (self.primary_reward_cow + self.quote_reward_cow)
return self.service_fee * (max(self.primary_reward_cow, 0) + self.quote_reward_cow)

def is_overdraft(self) -> bool:
"""

0 comments on commit ff05504

Please sign in to comment.