Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No service fee on penalties #424

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,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
Expand All @@ -152,6 +160,15 @@ def total_service_fee(self) -> Fraction:
"""Total service fee charged from rewards"""
return self.service_fee * (self.primary_reward_cow + self.quote_reward_cow)

def total_service_fee(self) -> Fraction:
"""Scaling factor for service fee
The reward is multiplied by this factor"""
return (
SERVICE_FEE_FACTOR
* self.service_fee
* (max(self.primary_reward_cow, 0) + self.quote_reward_cow)
)

def is_overdraft(self) -> bool:
"""
True if the solver's complete combined data results in a net negative
Expand Down
Loading