Uniswap / routing-api

GNU General Public License v3.0
150 stars 185 forks source link

fix: raise v4 subgraph totalValueLockedETH filtering threshold from 0 to 0.01 eth #876

Closed jsy1218 closed 3 weeks ago

jsy1218 commented 3 weeks ago

for example, below v4 pool from sepolia v4 subgraph has good liquidity and correct ETH:USDC sqrtPriceX96:

{
        "id": "0xedfb549279d9a3179b88cffa6f3dbe0be9713cfef2a592ed84aa1866b5d6fe1e",
        "token0": {
          "symbol": "ETH",
          "id": "0x0000000000000000000000000000000000000000"
        },
        "token1": {
          "symbol": "USDC",
          "id": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238"
        },
        "feeTier": "1500",
        "tick": "-199337",
        "tickSpacing": "30",
        "liquidity": "78419054283340",
        "hooks": "0x0000000000000000000000000000000000000020",
        "totalValueLockedUSD": "4461.186564266090216538997840216723",
        "totalValueLockedETH": "1.93727461978776941464871099029113",
        "totalValueLockedUSDUntracked": "0",
        "sqrtPrice": "3720139933953207328491692"
      },

meanwhile below one has incorrect sqrtPriceX96 and bad liquidity:

{
        "id": "0x31a0d134cae16b840bfea2cde2c18328024a345bb8459381b5c747ee80552280",
        "token0": {
          "symbol": "ETH",
          "id": "0x0000000000000000000000000000000000000000"
        },
        "token1": {
          "symbol": "USDC",
          "id": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238"
        },
        "feeTier": "1500",
        "tick": "-181",
        "tickSpacing": "40",
        "liquidity": "85647129",
        "hooks": "0x0000000000000000000000000000000000000000",
        "totalValueLockedUSD": "15.34798303615918873349520768694015",
        "totalValueLockedETH": "0.006664876613555354715749978717862528",
        "totalValueLockedUSDUntracked": "0",
        "sqrtPrice": "78517620563033212495166708499"
      },

we are still going to use ETH TVL to approximate liquidity, although this might not accurately capture the concentrated liquidity in v4, as it is today with v3 concentrated liquidity. we have follow-up plan.

jsy1218 commented 3 weeks 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 3 weeks ago

Graphite Automations

"Request reviewers once CI passes on routing-api repo" took an action on this PR • (10/16/24)

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