Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Update fee_balancer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahka2321 authored Dec 3, 2024
1 parent 71e205d commit 6961700
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions aws_lambda/fee_balancer/fee_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def check_and_fund_relayers():
changed_fee += base_fee * 0.125
# check if the relayers balance is more than the prev balance + the acceptable earning percentage
elif relayers_prev_total_balance + actual_fee > relayers_total_balance + (
earning_percentage * actual_fee / 100
earning_percentage * actual_fee // 100
):
# decrease the base fee of 12.5%
changed_fee -= base_fee * 0.125
Expand All @@ -106,12 +106,18 @@ async def check_and_fund_relayers():
}


async def get_total_balance_of_relayers(relayers, eth_contract, block_number):
async def get_total_balance_of_relayers(
relayers: list,
eth_contract,
block_number: int | None
) -> int:
total_balance = 0

for relayer in relayers:
account_balance = await get_balance(
relayer["address"], eth_contract, block_number
relayer["address"],
eth_contract,
block_number
)
total_balance += account_balance

Expand Down

0 comments on commit 6961700

Please sign in to comment.