parameter to purge low offer tx

This commit is contained in:
Frederico 2024-12-16 22:06:25 +01:00
parent ec8dc2f433
commit 906bb97619
2 changed files with 6 additions and 2 deletions

View File

@ -74,7 +74,8 @@ def run_simulation(params: SimulationParameters) -> Tuple[pd.DataFrame, pd.DataF
selected_transactions, to_be_purged_transactions = tfm.select_transactions(
pool,
stop_below_gas_limit=stop_below_gas_limit,
scale_block_size=scale_block_size
scale_block_size=scale_block_size,
purge_after=params.purge_after
)
# selected transactions are added to the blockchain

View File

@ -13,6 +13,7 @@ class SimulationParameters:
max_tip_pct:float=0.1,
scale_block_size_limits: Tuple[float] = (0.0, 0.2),
probability_stop_below_gas_limit: float = 0.5,
purge_after: int = 4,
):
assert len(demand_sizes) == len(demand_probabilities), "demand_sizes and demand_probabilities must have the same length"
assert abs(sum(demand_probabilities) - 1.0) < 1.e-12, "demand_probabilities must sum to 1.0"
@ -25,6 +26,7 @@ class SimulationParameters:
assert len(fee_cap_range) == 2, "fee_cap_range must be a tuple of length 2"
assert fee_cap_range[0] <= fee_cap_range[1], "fee_cap_range must be in increasing order"
assert max_tip_pct >= 0.0, "max_tip_pct must be positive"
assert purge_after >= 1, "purge_after must be at least 1"
self.num_blocks = num_blocks
self.demand_sizes = demand_sizes
@ -32,4 +34,5 @@ class SimulationParameters:
self.fee_cap_range = fee_cap_range
self.max_tip_pct = max_tip_pct
self.scale_block_size_limits = scale_block_size_limits
self.probability_stop_below_gas_limit = probability_stop_below_gas_limit
self.probability_stop_below_gas_limit = probability_stop_below_gas_limit
self.purge_after = purge_after