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

chore: add gas estimation quality metric #767

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

xrsv
Copy link
Contributor

@xrsv xrsv commented Nov 23, 2024

  • What kind of change does this PR introduce?
    Introduces metrics for gas estimation quality.
    Compares original gas estimate vs simulation gas estimate.
INFO:  Gas used diff between estimatedGasUsed and simulatedGasUsed
  estimatedGasUsed: 6364814
  simulatedGasUsed: 7582384
  absDiff: 1217570
  diff: -1217570

INFO:  Gas used mis-estimate percent
  misEstimateAbsPercent: 19.12970276900472

INFO:  [Metric]: TenderlySimulationGasUsed_AbsDiff_Chain_1: 1217570 | Count
  chainId: 1
  networkName: "mainnet"
  pair: "ETH/UNI"
  tokenIn: "0x0000000000000000000000000000000000000000"
  tokenOut: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
  tradeType: "ExactIn"
  key: "TenderlySimulationGasUsed_AbsDiff_Chain_1"
  value: 1217570
  unit: "Count"

INFO:  [Metric]: TenderlySimulationGasUsed_MisEstimateAbsPercent_Chain_1: 19.12970276900472 | Count
  chainId: 1
  networkName: "mainnet"
  pair: "ETH/UNI"
  tokenIn: "0x0000000000000000000000000000000000000000"
  tokenOut: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
  tradeType: "ExactIn"
  key: "TenderlySimulationGasUsed_MisEstimateAbsPercent_Chain_1"
  value: 19.12970276900472
  unit: "Count"

INFO:  [Metric]: TenderlySimulationGasUsed_UnderEstimatePercent_Chain_1: -19.12970276900472 | Count
  chainId: 1
  networkName: "mainnet"
  pair: "ETH/UNI"
  tokenIn: "0x0000000000000000000000000000000000000000"
  tokenOut: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
  tradeType: "ExactIn"
  key: "TenderlySimulationGasUsed_UnderEstimatePercent_Chain_1"
  value: -19.12970276900472
  unit: "Count"

@xrsv xrsv requested a review from a team as a code owner November 23, 2024 00:41
@xrsv xrsv requested review from jsy1218 and cgkol November 23, 2024 00:41
Copy link

graphite-app bot commented Nov 23, 2024

Graphite Automations

"Request reviewers once CI passes on smart-order-router repo" took an action on this PR • (11/23/24)

1 assignee was added and 1 reviewer was added to this PR based on 's automation.

Copy link
Contributor

@cgkol cgkol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, lets see lets see

i am just wondering if SOR is the right place to do this?

@xrsv
Copy link
Contributor Author

xrsv commented Nov 28, 2024

Nice, lets see lets see

i am just wondering if SOR is the right place to do this?

afaik SOR is the only place where we have simulation + estimation results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants