March 25, 2025

Track onchain liquidity locally

Why you might care about liquidity

Who needs to track liquidity and why?

  • Risk managers monitor token liquidity and depth to adjust risk parameters, for example, collateral ratios in lending pools.
  • Protocol teams track distribution of token liquidity across DEXs to see where they want to place incentives.
  • Traders use the shape and depth of pools as signal.
  • Investors track protocol TVL to assess growth.

Currently, the only option to find this data is to go to 3rd party DEX explorers.

Limitations of DEX explorers

However, relying on DEX explorers has some limitations:

Its fully trusted: You need to trust the DEX explorer that the data is accurate and complete. But, the data could be inaccurate for several reasons:

  • The indexer could be lagging so you see old data.
  • New DEXs or pools are not tracked yet (e.g., a new Univ4 hook) so you are missing tokens and liquidity from that DEX.
  • They measure TVL in a way that does not match your expectation: E.g., they don't track deposits in stablecoin redemptions as available swap liquidity. But your risk model assumes they do.

Its closed source: With few exceptions, DEX explorers are closed source. So you can't check whether you agree with the implementation, nor do you have a way to modify or extend it if you want to.

Its not very fast: Third-party DEX explorers are hosted elsewhere – and so you need to wait for network latency (e.g., 200ms) to get a response.

This works to explore one pool or token at a time as a retail user but might limit you in other cases, specifically:

  • Programmatic trading: If you trade on the data, you likely prefer it to be low latency, verifiable, and transparently aggregated.
  • Risk modeling: Same for risk models: Potentially incomplete or outdated data can invalidate your model's result.
  • Custom aggregation: If, as a protocol or LP, you want to aggregate specific tokens, specific DEXs, and aggregate in a specific way – you need access to the underlying data.

But there's now a trustless, open source alternative.

Explore liquidity locally

Tycho parses and streams all DEX liquidity data to you – so you can analyze it locally.
This allows you to build a new type of DEX explorer, that is:

  • Trustless: You can verify that the data is complete and accurate against e.g., a light client.
  • Open source: Tycho is open source. You can inspect and modify any of its logic.
  • Extremely fast: Tycho processes blocks in 30ms. Once you have the state locally, you can explore all the data in memory.

Which makes new uses possible:

  • React instantly: React to launches of new tokens/pools or changes in liquidity right in the next block. E.g. trade, or adjust risk parameters.
  • Build your own tracking: Build a custom dashboard, tracking exactly the pools, tokens, and protocols you want, with your own aggregation logic.

If you have other ideas of what to do when you have TVL data of every pool locally in memory – let us know we are happy to help! 

(For support join our builders telegram group tycho.build, or reach out to @tanay_j on telegram.)

Local DEX Explorer Bounty

There's also a 8.000 USDC bounty to build an open-source DEX Explorer.

Contact @tanay_ on telegram if you want to work on the bounty.

Keep Reading

The future of trading is onchain

Why AMMs are structurally more efficient than centralized exchanges.
Read More

Decentralising the trade supply chain

The trade supply chain is centralizing. To fix it, we need to understand what's driving centralization and design coordination tools to fix it.
Read More