Skip to content

Commit

Permalink
fix strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
F4ever committed Apr 24, 2024
1 parent 5fb086c commit 13813ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/blockchain/deposit_strategy/curated_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _calculate_recommended_gas_based_on_deposit_amount(self, deposits_amount: in
# For one key recommended gas fee will be around 10
# For 10 keys around 100 gwei. For 20 keys ~ 800 gwei
# ToDo percentiles for all modules?
recommended_max_gas = (deposits_amount ** 3 + 100) * 10 ** 8
recommended_max_gas = (deposits_amount ** 2 + 100) * 10 ** 8
logger.info({'msg': 'Calculate recommended max gas based on possible deposits.'})
GAS_FEE.labels('based_on_buffer_fee', self.module_id).set(recommended_max_gas)
return recommended_max_gas
Expand Down
2 changes: 1 addition & 1 deletion tests/blockchain/deposit_strategy/test_curated_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_get_possible_deposits_amount(cmds):
@pytest.mark.unit
@pytest.mark.parametrize(
"deposits,expected_range",
[(1, (0, 20)), (5, (20, 100)), (10, (50, 1000)), (100, (1000, 1000000))],
[(1, (0, 20)), (5, (10, 30)), (10, (20, 50)), (100, (1000, 1000000))],
)
def test_calculate_recommended_gas_based_on_deposit_amount(cmds, deposits, expected_range):
assert expected_range[0] * 10**9 <= cmds._calculate_recommended_gas_based_on_deposit_amount(deposits) <= expected_range[1] * 10**9
Expand Down

0 comments on commit 13813ca

Please sign in to comment.