Liquidity Pools ​
Monitor liquidity pool creation, updates, and significant events across various DeFi protocols on Solana including Raydium, Orca, Meteora, and more.
Overview ​
The liquidity pools WebSocket stream provides comprehensive data on:
- New pool creation events
- Liquidity additions and removals
- Fee tier changes and updates
- TVL (Total Value Locked) tracking
- Cross-protocol pool monitoring
- Concentrated liquidity positions
Connection ​
WebSocket Endpoint:
wss://api.nolimitnodes.com/socket?apikey=YOUR_API_KEY
1
Subscription ​
Subscribe Request ​
json
{
"method": "dataSubscribe",
"params": {
"referenceId": "LIQUIDITY_POOLS",
"streams": [
{
"stream": "liquidityPoolsSubscribe",
"params": {
"amm": "Raydium",
"token1": "So11111111111111111111111111111111111111112",
"token2": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
]
},
"id": 1
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Filter Parameters ​
Parameter | Type | Required | Description |
---|---|---|---|
amm | string | No | Filter by AMM name (e.g., "PumpSwap", "Raydium", "Orca") |
token1 | string | No | Filter by first token mint address |
token2 | string | No | Filter by second token mint address |
pool | string | No | Filter by specific pool address |
creator | string | No | Filter by pool creator wallet |
program_id | string | No | Filter by AMM program ID |
Response Messages ​
Subscription Confirmation ​
json
{
"status": "Subscribed to liquidityPools",
"subscription_id": "8fe99234-3b7d-40e4-af71-19edc85fb0cc",
"stream": "liquidityPoolsSubscribe",
"reference_id": "LIQUIDITY_POOLS"
}
1
2
3
4
5
6
2
3
4
5
6
Liquidity Pool Event ​
json
{
"method": "liquidityPoolsSubscribe",
"subscription_id": "8fe99234-3b7d-40e4-af71-19edc85fb0cc",
"result": {
"amm": "PumpSwap",
"token1": "So11111111111111111111111111111111111111112",
"token2": "7Pnqg1S6MYrL6AP1ZXcToTHfdBbTB77ze6Y33qBBpump",
"pool": "FBZSQpAYGQJpmRT8L33QnGwv6bCaTx6XCjmTPVCw3gdZ",
"creator": "2FMmrPvtxiRmxWYbBBrMUoXDcgQ1hmgsnHDtfDCnvunLBmafRRPjSjqbnywdxpMDU9Bdzq5md41uPF71ntvFqtvT",
"transaction_signature": "2FMmrPvtxiRmxWYbBBrMUoXDcgQ1hmgsnHDtfDCnvunLBmafRRPjSjqbnywdxpMDU9Bdzq5md41uPF71ntvFqtvT",
"block_num": 366963118,
"block_time": 1757930744,
"program_id": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",
"type": "liquidity_pool_creation"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Field Descriptions ​
amm
: AMM protocol name (e.g., "PumpSwap", "Raydium")token1
: First token mint addresstoken2
: Second token mint addresspool
: Pool addresscreator
: Pool creator wallet addresstransaction_signature
: Solana transaction signatureblock_num
: Block numberblock_time
: Unix timestampprogram_id
: AMM program IDtype
: Event type ("liquidity_pool_creation")
Pool Information ​
amm
: AMM protocol name (e.g., "PumpSwap", "Raydium")pool
: Pool account addresstype
: Event type (always "liquidity_pool_creation" for creation events)program_id
: AMM program ID
Token Pair ​
token1
: First token mint address (usually SOL)token2
: Second token mint address
Transaction Details ​
creator
: Wallet address that created the pooltransaction_signature
: Solana transaction signatureblock_num
: Block number where pool was createdblock_time
: Unix timestamp of the block
Unsubscribe ​
To stop receiving liquidity pool events, use the dataUnsubscribe
method:
Unsubscribe Request ​
json
{
"method": "dataUnsubscribe",
"params": {
"subscriptionIds": ["your_subscription_id_here"],
"referenceId": "UNSUB_REF"
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Unsubscribe Response ​
json
{
"status": "Unsubscribed from liquidityPools",
"subscription_id": "your_subscription_id_here",
"stream": "liquidityPoolsSubscribe",
"reference_id": "UNSUB_REF"
}
1
2
3
4
5
6
2
3
4
5
6
Code Examples ​
JavaScript/Node.js ​
javascript
const WebSocket = require('ws');
class LiquidityPoolMonitor {
constructor(apiKey) {
this.ws = new WebSocket(`wss://api.nolimitnodes.com/socket?apikey=${apiKey}`);
this.setupHandlers();
}
setupHandlers() {
this.ws.on('open', () => {
this.subscribe();
});
this.ws.on('message', (data) => {
const message = JSON.parse(data);
if (message.method === 'liquidityPoolsSubscribe') {
this.processPool(message.result);
}
});
}
subscribe() {
this.ws.send(JSON.stringify({
method: 'dataSubscribe',
params: {
referenceId: 'LIQUIDITY_POOLS',
streams: [{
stream: 'liquidityPoolsSubscribe',
params: {}
}]
}
}));
}
processPool(pool) {
console.log('\nNew Liquidity Pool Created:');
console.log(` AMM: ${pool.amm}`);
console.log(` Pool: ${pool.pool}`);
console.log(` Token1: ${pool.token1.slice(0, 8)}...`);
console.log(` Token2: ${pool.token2.slice(0, 8)}...`);
console.log(` Block: ${pool.block_num}`);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Python ​
python
import json
import asyncio
import websockets
from datetime import datetime, timedelta
from collections import defaultdict
class LiquidityPoolMonitor:
def __init__(self, api_key):
self.api_key = api_key
self.uri = f"wss://api.nolimitnodes.com/pump-fun?apikey={api_key}"
self.pool_stats = defaultdict(lambda: {
'tvl_history': [],
'volume_24h': 0,
'fees_earned': 0,
'apy_history': []
})
async def connect(self):
self.websocket = await websockets.connect(self.uri)
print("Connected to liquidity pools stream")
async def subscribe(self, amm=None, min_tvl=10000):
params = {"minTVL": min_tvl}
if amm:
params["amm"] = amm
subscription = {
"method": "dataSubscribe",
"params": {
"referenceId": "POOLS#1",
"streams": [{
"stream": "liquidityPoolsSubscribe",
"params": params
}]
}
}
await self.websocket.send(json.dumps(subscription))
async def listen(self):
async for message in self.websocket:
data = json.loads(message)
if data.get('method') == 'liquidityPoolsSubscribe':
await self.process_pool_event(data['result'])
async def process_pool_event(self, event):
pool_id = f"{event['amm']}:{event['pool']['address'][:8]}"
stats = self.pool_stats[pool_id]
# Update statistics
stats['tvl_history'].append({
'timestamp': datetime.now(),
'tvl': event['liquidity']['totalValueLocked']
})
stats['volume_24h'] = event.get('volume24h', 0)
stats['fees_earned'] = event.get('fees24h', 0)
if event.get('apy'):
stats['apy_history'].append(event['apy'])
# Display event
print(f"\n{'='*60}")
print(f"[{event['amm'].upper()}] {event['eventType'].replace('_', ' ').title()}")
print(f"{'='*60}")
tokens = event['tokens']
print(f"Pool: {tokens['token1']['symbol']}/{tokens['token2']['symbol']}")
print(f"Address: {event['pool']['address'][:20]}...")
liquidity = event['liquidity']
print(f"\n💰 Liquidity Metrics:")
print(f" TVL: ${liquidity['totalValueLocked']:,.2f}")
print(f" LP Supply: {float(liquidity['lpSupply']) / 1e9:,.2f}")
if event.get('volume24h'):
print(f"\n📊 24h Statistics:")
print(f" Volume: ${event['volume24h']:,.2f}")
print(f" Fees: ${event.get('fees24h', 0):,.2f}")
print(f" APY: {event.get('apy', 0):.2f}%")
# Check for opportunities
await self.analyze_opportunity(event, stats)
async def analyze_opportunity(self, event, stats):
opportunities = []
# High APY
if event.get('apy', 0) > 100:
opportunities.append(f"🔥 High APY: {event['apy']:.2f}%")
# New pool with good liquidity
if event['eventType'] == 'pool_created' and \
event['liquidity']['totalValueLocked'] > 50000:
opportunities.append(f"🆕 New pool with ${event['liquidity']['totalValueLocked']:,.0f} TVL")
# TVL growth
if len(stats['tvl_history']) > 1:
prev_tvl = stats['tvl_history'][-2]['tvl']
curr_tvl = stats['tvl_history'][-1]['tvl']
growth = ((curr_tvl - prev_tvl) / prev_tvl) * 100 if prev_tvl > 0 else 0
if growth > 50:
opportunities.append(f"📈 Rapid TVL growth: {growth:.1f}%")
if opportunities:
print(f"\nâš¡ OPPORTUNITIES DETECTED:")
for opp in opportunities:
print(f" {opp}")
async def main():
monitor = LiquidityPoolMonitor("YOUR_API_KEY")
await monitor.connect()
# Subscribe to Raydium pools with >$10k TVL
await monitor.subscribe(amm="raydium", min_tvl=10000)
await monitor.listen()
if __name__ == "__main__":
asyncio.run(main())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Best Practices ​
1. Risk Assessment & Due Diligence ​
- Verify Token Contracts: Check token age, authority settings, and audit status before investing
- Analyze Liquidity Depth: Focus on pools with >$10k TVL to ensure adequate liquidity
- Monitor Pool Health: Track TVL changes, volume patterns, and fee generation consistency
2. Yield & Performance Analysis ​
- Calculate Real APY: Track actual vs theoretical yields, accounting for compounding and fees
- Assess Impermanent Loss: Model IL risk based on price correlation and volatility patterns
- Compare Cross-Protocol: Monitor yields across Raydium, Orca, Meteora for optimization opportunities
3. Real-time Monitoring & Alerts ​
- Set TVL Alerts: Monitor for significant TVL drops (>20%) that might indicate rug pulls
- Track Volume Spikes: Flag unusual volume increases (>500% of average) for investigation
- Emergency Response: Implement rapid exit strategies for pools showing exploit patterns