Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed Sep 4, 2024
1 parent 24546d2 commit add0483
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/fees/compute_fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,14 @@ def surplus(self) -> int:

def compute_all_fees(self) -> None:
raw_trade = deepcopy(self)
i = 0
self.total_protocol_fee = 0
self.partner_fee = 0
if self.fee_policies:
for fee_policy in reversed(self.fee_policies):
for i, fee_policy in enumerate(reversed(self.fee_policies)):
raw_trade = fee_policy.reverse_protocol_fee(raw_trade)
## we assume that partner fee is the last to be applied
if i == 0 and self.partner_fee_recipient is not NULL_ADDRESS:
self.partner_fee = raw_trade.surplus() - self.surplus()
i = i + 1
self.total_protocol_fee = raw_trade.surplus() - self.surplus()

surplus_fee = self.compute_surplus_fee() # in the surplus token
Expand Down

0 comments on commit add0483

Please sign in to comment.