Skip to content

uniswap-v3: skip pools whose own price is 10x off coins prices (VOLLAR-USDT $46.4m at 9,907% apy) - #3282

Open
mrstark25 wants to merge 1 commit into
DefiLlama:masterfrom
mrstark25:fix/uniswap-v3-price-guard
Open

mrstark25 wants to merge 1 commit into
DefiLlama:masterfrom
mrstark25:fix/uniswap-v3-price-guard

Conversation

@mrstark25

@mrstark25 mrstark25 commented Nov 27, 2026 •

Copy link
Copy Markdown

Problem

/pools currently lists uniswap-v3 Polygon VOLLAR-USDT 1% (0x9039769396ad40d6e6a15b45269a5a229984604a) at $46.4m tvl and a 9,907% apy, with volumeUsd1d of $1.51b. On chain the pool holds:

token balance value at the pool's own price
USDT 5,526.63 $5,527
VOLLAR (8 dec) 211,027,858.9 ~$526 (pool price $0.0000025)

coins.llama.fi priced VOLLAR at $0.24–0.29 through 11-21. The pool says $0.0000025, so the token crashed and its liquidity was dumped. On 11-23 utils.tvl valued the 211M VOLLAR at the stale ~$0.22. The pool's chart shows ~$0.92–0.98m of tvl every day up to 11-22, then the single 11-23 point at $46,387,898.

Nothing in the adapter compares the price a pool trades at with the prices its tvl is computed from, even though topLvl already reads slot0 for every pool.

Fix

Keep sqrtPriceX96 from the existing slot0 multicall, and drop a pool when its own token1/token0 price is more than 10x away from price0 / price1 from coins.llama.fi. Pools with only one priced side are unchanged, since those are already valued from the priced side alone. No extra RPC calls.

Impact on today's pools

I can't run the full adapter (the subgraphs need a Graph gateway key), so I measured the guard directly. For each uniswap-v3 pool in /pools on Ethereum, Polygon, Arbitrum, Optimism, Base and BSC above $100k, I took the factory getPool and slot0, compared it with coins.llama.fi prices, and got 534 pools with both sides priced:

deviation pools tvl
> 2x 4 $5m
> 5x 2 $4m
> 10x (dropped) 2 $4m

The two dropped pools both have zero active liquidity (liquidity() == 0), so their price sits outside every position and nothing trades against them. Both show 0% apy:

  • Ethereum WDOGE-WETH 1% 0x68082ecc5bbad8fe77c2cb9d0e3403d9a00ccbc2: price ratio 8.6e-35, $3.65m published
  • Ethereum WETH-XUSD 0.05% 0x3c385b0ce5b48958ffab12ffd8da14d433d7b885: price ratio 1.8e-30, $179k published

The two pools between 2x and 10x (DAI-HOPR at 0.21x, MET-WETH at 3.86x) are kept. VOLLAR-USDT is not in this table because VOLLAR has no coins price today. With the 11-23 price it is 88,000x off and would have been dropped.

Testing

node --check passes. I ran the guard against those pools with their on-chain sqrtPriceX96:

  • VOLLAR-USDT at the 11-23 price: dropped
  • WDOGE-WETH: dropped
  • healthy USDC-WETH and WBTC-WETH: kept
  • MET-WETH at 3.86x: kept
  • a one-side-priced pool: kept

Summary by CodeRabbit

  • Bug Fixes
    • Pool results now filter out pools whose price differs from the token-price ratio by more than a factor of 10. Pools are still shown when either token’s price is unavailable.
    • Pool price details are now included with the returned pool information.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Uniswap V3 adapter now attaches sqrtPriceX96 to each pool and filters pools whose derived price differs from the token price ratio by more than a factor of 10. Pools pass when either token price is missing. The existing LP fee-share calculation remains unchanged.

Changes: Uniswap V3 pool price filter

Layer / File(s) Summary
Pool price validation
src/adaptors/uniswap-v3/index.js
The adapter attaches sqrtPriceX96 to each pool and keeps pools with missing token prices. Otherwise, it compares the pool-derived price with the token price ratio and retains ratios from 1/10 through 10, inclusive. The LP fee-share calculation remains unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: gomesalexandre, 0xkr3p

Merge Risk: Minimal · up to 9e35e

This change filters out Uniswap V3 pools whose on-chain price differs by more than 10x from the token prices used for TVL. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Uniswap V3 pools are skipped when their own price differs more than 10x from the coins prices. It also names a concrete example (VOLLAR-USDT). The raw summary and obje…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Uniswap V3 pools are skipped when their own price differs more than 10x from the coins prices. It also names a concrete example (VOLLAR-USDT). The raw summary and objectives confirm the filter in src/adaptors/uniswap-v3/index.js matches this description. The title is specific and accurate.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48b524f7-69f5-4e08-acce-514078ad50c7
Commits

Reviewing files that changed from the base of the PR and between ccd3bf6 and 9e35e91.

Files selected for processing: 1

  • src/adaptors/uniswap-v3/index.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@mrstark25

Copy link
Copy Markdown
Author

CI's red here is environmental: every subgraph call hit payment required for subsequent requests for this API key, then the Monad PoolCreated getLogs in onchain.js failed on all RPCs ("block range too large", rate limits). Neither touches this change, which runs after the subgraph data loads.

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.

1 participant