Open jackhack00 opened 6 months ago
@jackhack00 Is the constant gas assumption normal, or is there any variance in the gas?
@jackhack00 Should I be investigating validity for GAS_FEE_L1_TIME_SERIES_LIST or do we feel good on it
@jackhack00 What is the safety buffer meant to capture? And is there empirical data to support it?
@SeanMcOwen
Gas should be constant for DEFAULT_DETERMINISTIC_GAS_ESTIMATOR = L1GasEstimators
Gas Price (in Gwei) should fluctuate: Steady state gives basis, shock adds on top. Both SS and Shock are pulled from timeseries.
Checking validity of GAS_FEE_L1_TIME_SERIES_LIST Yes please, that sounds great.
Safety Buffer Since rewards and costs are kinda unknown, we have to find reasonable guesses.
An additional fix to this might include testing more realistic costs and rewards. Currently, an agent tests total rewards for the block (instead of their share of the rewards) against costs of the current transaction.
Realistically, an agent would check their own reward share vs. the remaining transactions at current gas price (since a singular transaction is likely under the total block rewards)
gas: Gas = params["gas_estimators"].commitment_bond(state) #Note: checking against only the current transaction might be simplifying a little too much
fee = gas * state["gas_fee_l1"]
SAFETY_BUFFER = 2 * fee # HACK:
expected_rewards = params["reward_per_block"] #NOTE: reward per block is total reward
expected_costs: float = params["op_costs"] + fee + SAFETY_BUFFER
# Translate to ETH
expected_costs = expected_costs * 1e-9
payoff_reveal = expected_rewards - expected_costs
DEFAULT_DETERMINISTIC_GAS_ESTIMATOR = L1GasEstimators
) 2) The current gas price (taken fromGAS_FEE_L1_TIME_SERIES_LIST
) 3) Multiplies these costs with a safety buffer (currently 2) (need rework on functional form) 4) Computes their expected rewards (taken from expected_rewards = state['cumm_block_rewards'] - history[-1][0]['cumm_block_rewards'] ) 5) From the rewards, subtracts a constant "op_cost" param, the fee, and the safety buffer (2fee) 6) aka Rewards (our assumption) - op_cost (our assumption) - 3*fee (multiplier our assumption, fee our choice of shock) 7) If the result is positive, they will be able to make the transactionTasks: