Uniswap / smart-order-router

GNU General Public License v3.0
384 stars 386 forks source link

feat: Tenderly shadow sampling estimate gas bundle #592

Closed jsy1218 closed 1 month ago

jsy1218 commented 1 month ago

Tested via local CLI https://app.warp.dev/block/k0YKya88coQWqOu6iWwZZZ, and can see success metrics:

INFO:  [Metric]: TenderlyNodeGasEstimateBundleSuccess: 1 | Count
  chainId: 1
  networkName: "mainnet"
  pair: "OMG/WETH"
  tokenIn: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
  tokenOut: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  tradeType: "ExactIn"
  key: "TenderlyNodeGasEstimateBundleSuccess"
  value: 1
  unit: "Count"
INFO:  Tenderly estimate gas bundle request body: {
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tenderly_estimateGasBundle",
  "params": [
    [
      {
        "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "to": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07",
        "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
      },
      {
        "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "to": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
        "data": "0x87517c45000000000000000000000000d26114cd6ee289accf82350c8d8487fedb8a0c070000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000066fb1f30"
      },
      {
        "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "to": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
        "data": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000009184e72a0000000000000000000000000000000000000000000000000000000000000000002080c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000010b53ad3ae300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d26114cd6ee289accf82350c8d8487fedb8a0c07000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000040000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa960450000000000000000000000000000000000000000000000000000010b53ad3ae3"
      }
    ],
    "0x131bf69"
  ]
} with http status 200 result {
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "gas": "0xb5e9",
      "gasUsed": "0xb5e8"
    },
    {
      "gas": "0xbab2",
      "gasUsed": "0xbab1"
    },
    {
      "gas": "0x23d43",
      "gasUsed": "0x1d111"
    }
  ]
}, having latencies 223 in milliseconds.

and latencies improvement seems promising:

INFO:  [Metric]: TenderlySimulationUniversalRouterLatencies: 917 | Milliseconds
  chainId: 1
  networkName: "mainnet"
  pair: "OMG/WETH"
  tokenIn: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
  tokenOut: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  tradeType: "ExactIn"
  key: "TenderlySimulationUniversalRouterLatencies"
  value: 917
  unit: "Milliseconds"
INFO:  [Metric]: TenderlyNodeGasEstimateBundleLatencies: 223 | Milliseconds
  chainId: 1
  networkName: "mainnet"
  pair: "OMG/WETH"
  tokenIn: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
  tokenOut: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  tradeType: "ExactIn"
  key: "TenderlyNodeGasEstimateBundleLatencies"
  value: 223
  unit: "Milliseconds"
jsy1218 commented 1 month ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @jsy1218 and the rest of your teammates on Graphite Graphite

graphite-app[bot] commented 1 month ago

Graphite Automations

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

4 reviewers were added and 1 assignee was added to this PR based on 's automation.