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

Create new simulation using the actual gas price service #2538

Open
wants to merge 240 commits into
base: master
Choose a base branch
from

Conversation

MitchTurner
Copy link
Member

@MitchTurner MitchTurner commented Jan 8, 2025

Linked Issues/PRs

closes #2181

Description

This PR adds a new simulator (a successor to the gas-price-analysis bin).

It includes the ability to run single simulations:

cargo run -- --file-path source_data/mainnet_2.csv single -p 609999999999985 -d 10000000000000000 -s 25000

or optimization simulations which tries to find good p and d values for the given dataset:

cargo run -- --file-path source_data/mainnet_2.csv optimization

Both will produce and chart of the simulated data a la:
image

and print a summary:

Sample size: 164037 blocks (1 days, 21 hours, 33 minutes, 57 seconds)
Max gas price: Some(61910)
Min gas price: Some(1000)
Final gas price: 1000
Max profit ETH: Some(0.023075122703988114)
Min profit ETH: Some(-0.02269269881593197)
Final profit: 0.017664316461006087
Final cost: 0.03545521192306669
Final reward: 0.060356091

The goal is to use this with larger datasets to select appropriate p/d values for the V1 gas price algorithm/service

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

MitchTurner and others added 30 commits October 30, 2024 17:26
…data_tests.rs

Co-authored-by: Rafał Chabowski <88321181+rafal-ch@users.noreply.github.com>
…to feature/init-task-for-v1-gas-price-service
Base automatically changed from chore/add-tests-for-v1-gas-service to master January 14, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use more advanced optimisation for determining P and D value in V1 gas price algorithm
5 participants