How to detect liquidity drains on DEX pools
A liquidity drain is how most rug pulls take the money, and it shows up as one strongly negative reserve change. Learn the two-threshold rule that catches it in the same block, plus the JIT traps that cause false alerts.

A liquidity drain is the sudden removal of the funds backing a DEX trading pool, and it's how most rug pulls take the money. You detect one by watching the pool's net reserve change per block: swaps cancel to roughly zero, while liquidity removal shows as a strongly negative dollar total. Chainalysis tracked $94.8 million in rug-pull losses in 2024.
The scale of the problem is hard to overstate. Chainalysis analyzed the 2,063,519 tokens launched in 2024 and found that 3.59% showed pump-and-dump patterns, and that roughly 94% of the suspicious pools were drained by the same address that created them. On Solana's Pump.fun, Solidus Labs found that 98.6% of the 7 million tokens deployed between January 2024 and March 2025 carried rug-pull or pump-and-dump characteristics. Most of these are small. The median rug on Raydium took $2,832. But they're fast: a 2025 study of 48,380 tokens on TON found that 49.7% of rug-pulled assets vanished within 4 hours of listing.
Speed is the entire detection problem. A liquidity pull is a single transaction. It confirms in one block, which is 400 milliseconds on Solana and about 12 seconds on Ethereum. Any detection method that checks pools on a schedule, even an aggressive one, mostly tells you what you already lost.
Here's what each kind of pool activity looks like at the reserve level:
| What happened on-chain | Net USD reserve change | Detectable as a drain? |
|---|---|---|
| Swap, any size | Roughly $0 (one token up, the other down) | No, and that's correct |
| Liquidity added | Strongly positive | No, it's the opposite signal |
| Liquidity removed by an LP | Strongly negative | Yes |
| Rug pull (creator pulls everything) | Strongly negative, usually 80 to 100% of the pool | Yes, this is the signature |
How drain detection works
Every DEX pool holds reserves of two tokens. When someone swaps, one reserve rises and the other falls, and the dollar values of those two moves cancel each other almost exactly. When a liquidity provider exits, both reserves fall together. Nothing cancels. That asymmetry is the entire detection mechanism, and it's hard to game: a drain can't dress itself up as trading volume, no matter how it's structured.
So a detector needs three things per pool, per block: the pool's current reserves in dollars, the net dollar change in that block, and a pair of thresholds. The standard rule looks like this:
- Ignore the move if it's under an absolute floor, say $10,000. That filters dust.
- Ignore it if it's under a percentage of the pool, say 20%. That filters big-but-normal moves on big pools.
- Alert on anything that clears both. Negative means drain. Positive means a large liquidity add, which is worth watching for different reasons.
The two thresholds scale together. On a $50 million blue-chip pool, 20% means an eight-figure event that should page somebody. On a $100,000 day-old memecoin pool, a $20,000 pull trips the same rule. One configuration covers both ends of the risk spectrum.
There's one source of false positives worth knowing about: just-in-time (JIT) liquidity. Bots on major pools add and remove six-figure positions around individual swaps to capture fees, and measurements on an $8 million Base pool showed them moving about 4% of the pool every block. The liquidity genuinely moves, so a naive detector genuinely fires. It's plumbing, not an exit. A 20% threshold clears that churn with a 5x margin, and netting deltas over a few consecutive blocks kills it entirely, because JIT cycles cancel and real drains don't.
What about catching a rug before it happens? Pre-buy scanners check for risk factors: unlocked liquidity, concentrated holdings, mint authority. They're worth running, and they're also not enough. The HAWK token launch in December 2024 reached a $490 million market cap within 15 minutes and collapsed 90% in the next 20, with insider wallets holding 96% of supply. Reserve monitoring won't predict that. It will tell you the moment it starts, which for anyone holding the token is the difference between exiting at minus 30% and discovering the chart at minus 97%.
What this looks like in practice
The hard part used to be the data: getting per-block reserve changes meant running a node, subscribing to event logs, and decoding every DEX's contract format separately. That stack is why most working drain detectors live inside paid infrastructure.
DexPaprika's reserve stream collapses it to one HTTP call. It pushes a pool_reserves event over Server-Sent Events every time a subscribed pool's reserves change, with the USD math already done server-side. No node, no per-DEX decoding, and it covers 35 chains with the same event shape. The raw feed is one curl away:
curl -N "https://streaming.dexpaprika.com/sse/reserves?method=pool_reserves&chain=ethereum&address=0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"Each event carries total_reserve_usd (the pool's liquidity right now) and total_delta_usd (the signed dollar change this block). Those two fields plus the threshold rule above are a complete detector. The drain detection guide builds it in about 70 lines of JavaScript or Python, watching 25 pools across multiple chains on a single connection.
Does it work? On its first night running, an open-source monitor built exactly this way (LiquidityRadar, which you can fork and point at your own pools) caught a fresh Base pool called WETH/INPAY losing 97.3% of its liquidity, $66,982, in one block at 23:27 UTC. The pool had launched at 19:23 the same day, traded for 76 minutes, and was dead by midnight: zero volume ever since. That's the Chainalysis statistic, the one about 94% of suspect pools being drained by their own creators, playing out in data, four hours start to finish.
For anything running unattended, the streaming connection itself needs care: reconnect backoff, heartbeat watchdogs, and knowing which errors retry. The production streaming guide covers those patterns, and they're the same ones behind our production-ready price feeds article.
Frequently asked questions
Is a liquidity drain the same as a rug pull?
Every rug pull involving pooled liquidity is a drain, but not every drain is a rug. Legitimate LPs exit positions, market makers rebalance, and protocols migrate liquidity between pools. The drain signal tells you funds left; the context (pool age, who pulled, whether liquidity returns) tells you whether it was an exit scam.
How fast does a rug pull happen?
The pull itself is one transaction, confirmed in one block: under a second on Solana, about 12 seconds on Ethereum. The TON study found half of rugged tokens disappeared within 4 hours of listing. Soft rugs, where creators drain gradually, play out over days or weeks instead.
Can I detect a rug pull before it happens?
Partially. Pre-buy checks (locked liquidity, holder concentration, contract permissions) filter out obvious setups. But insiders with 96% of supply, like HAWK in December 2024, pass many automated checks. Real-time reserve monitoring is the layer that catches the event itself, at the moment it starts.
Why doesn't polling an API catch drains?
A drain completes in one block. Poll every 30 seconds and you'll learn about it up to 30 seconds late, after the window to react is gone. Push-based streaming delivers the block where it happened. The math is covered in why polling doesn't scale.
What causes false drain alerts?
JIT liquidity bots are the main one: they add and pull large positions around single swaps on major pools, around 4% of the pool per block in measured cases. Filter them with a percentage threshold of 15 to 20% or by netting changes across consecutive blocks.
Is there an easy way to monitor pool liquidity in real time?
Yes. DexPaprika's reserve stream runs with a single curl command (the examples in this article work as-is), covers 35 chains, and multiplexes 25 pools per connection (10 connections per IP); the streaming docs carry the current access details. For agent-based workflows, the same data is reachable through the DexPaprika MCP server, and CoinPaprika's market API covers the exchange-level view.
Do I need to monitor every pool a token trades in?
For rug detection, the creator's pool is the one that matters, and it's usually the token's only meaningful pool early on. The stream's token_reserves method follows a token across all its pools at once if you want full coverage.
Key takeaways
- Reserve-level detection works because of an accounting identity, not a heuristic: swaps cancel, exits don't. That makes it much harder to evade than pattern-based scanners.
- Use two thresholds together (an absolute floor around $10,000 and 15 to 20% of the pool) and they self-scale from memecoin pools to blue chips.
- Speed only matters end to end. A one-block signal is worthless behind a 30-second poll, so push streaming isn't an optimization, it's the difference between detection and autopsy.
- The data layer for this used to cost a node subscription and per-DEX decoding work. It's now a single SSE endpoint, which moves drain detection from "infrastructure project" to "afternoon script."
- If you're building the alerting side, start with SSE explained for crypto apps and the Uniswap guide if pool mechanics are new to you.
Related articles
- How to get live crypto prices into Claude and ChatGPT (MCP server setup)
- Free crypto historical data API: how far back can you actually go?
- How to stream real-time DEX token prices with SSE (curl, JavaScript, Python)
- Migrating from the CoinCap API to CoinPaprika
- CoinPaprika ranks #1 for blockchain coverage in the OpenChainBench benchmark
- How to get OHLCV candles for any DEX token (the endpoint DexScreener's API doesn't have)
Latest articles
- RWA vs Traditional Assets: Why Blockchain Changes Everything
- How to Invest in Real World Assets Through Crypto
- RWA Crypto Market Size & Growth: Stats, Charts, Projections
- Top RWA Crypto Tokens by Market Cap
- How to measure buy/sell pressure on a DEX pool
- How to get a token price by contract address (any chain)
Coinpaprika education
Discover practical guides, definitions, and deep dives to grow your crypto knowledge.
Cryptocurrencies are highly volatile and involve significant risk. You may lose part or all of your investment.
All information on Coinpaprika is provided for informational purposes only and does not constitute financial or investment advice. Always conduct your own research (DYOR) and consult a qualified financial advisor before making investment decisions.
Coinpaprika is not liable for any losses resulting from the use of this information.