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

Update fee_balancer.py #1653

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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
Loading