Uniswap / smart-order-router

GNU General Public License v3.0
417 stars 424 forks source link

chore: add gas estimation quality metric #767

Open xrsv opened 1 week ago

xrsv commented 1 week ago
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"
graphite-app[bot] commented 1 week ago

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.

xrsv commented 3 days ago

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