Jupiter Aggregator V6 WebSocket ​
Jupiter Aggregator V6 is the leading DEX aggregator on Solana, providing optimal swap routes across multiple liquidity sources. The WebSocket API delivers real-time updates on swap transactions.
Overview ​
The Jupiter V6 WebSocket stream provides real-time swap transaction notifications as they occur on-chain.
Connection ​
WebSocket Endpoint:
wss://api.nolimitnodes.com/socket?apikey=YOUR_API_KEY
1
Subscription ​
Subscribe Request ​
json
{
"method": "dataSubscribe",
"params": {
"referenceId": "JUPITER_AGG_V6",
"streams": [
{
"stream": "jupiterAggregatorV6Subscribe",
"params": {
"inputMint": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
"outputMint": "So11111111111111111111111111111111111111112",
"amm": "HpNfyc2Saw7RKkQd8nEL4khUcuPhQ7WwY1B2qjx8jxFq"
}
}
]
},
"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 |
---|---|---|---|
inputMint | string | No | Filter by input token mint address |
outputMint | string | No | Filter by output token mint address |
amm | string | No | Filter by AMM address |
inputAmount | number | No | Filter by input amount |
outputAmount | number | No | Filter by output amount |
program_id | string | No | Filter by Jupiter program ID |
Response Messages ​
Subscription Confirmation ​
json
{
"status": "Subscribed to jupiterAggregatorV6",
"subscription_id": "569bb469-569e-47ac-bdef-04bedbd6023f",
"stream": "jupiterAggregatorV6Subscribe",
"reference_id": "JUPITER_AGG_V6"
}
1
2
3
4
5
6
2
3
4
5
6
Sample Response ​
json
{
"method": "jupiterAggregatorV6Subscribe",
"subscription_id": "569bb469-569e-47ac-bdef-04bedbd6023f",
"result": {
"amm": "HpNfyc2Saw7RKkQd8nEL4khUcuPhQ7WwY1B2qjx8jxFq",
"inputMint": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
"inputAmount": 1273439501,
"outputMint": "So11111111111111111111111111111111111111112",
"outputAmount": 42046966,
"block_num": "366957645",
"block_time": "1757928580",
"program_id": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
"type": "swap"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Field Descriptions ​
Swap Details ​
amm
: AMM address used for the swapinputMint
: Input token mint addressinputAmount
: Amount of input tokens swappedoutputMint
: Output token mint addressoutputAmount
: Amount of output tokens receivedblock_num
: Block number where swap occurredblock_time
: Unix timestamp of the blockprogram_id
: Jupiter program ID (JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4)type
: Event type (always "swap")
Unsubscribe ​
To stop receiving Jupiter swap 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 jupiterAggregatorV6",
"subscription_id": "your_subscription_id_here",
"stream": "jupiterAggregatorV6Subscribe",
"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 JupiterWebSocket {
constructor(apiKey) {
this.ws = new WebSocket(`wss://api.nolimitnodes.com/socket?apikey=${apiKey}`);
this.setupHandlers();
}
setupHandlers() {
this.ws.on('open', () => {
this.subscribeToJupiter();
});
this.ws.on('message', (data) => {
const message = JSON.parse(data);
if (message.method === 'jupiterAggregatorV6Subscribe') {
this.handleJupiterSwap(message.result);
}
});
}
subscribeToJupiter() {
this.ws.send(JSON.stringify({
method: 'dataSubscribe',
params: {
referenceId: 'JUPITER_V6',
streams: [{
stream: 'jupiterAggregatorV6Subscribe',
params: {
inputMint: 'pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn'
}
}]
}
}));
}
handleJupiterSwap(data) {
console.log(`Swap detected:`);
console.log(` AMM: ${data.amm}`);
console.log(` Input: ${data.inputAmount} ${data.inputMint.slice(0, 8)}...`);
console.log(` Output: ${data.outputAmount} ${data.outputMint.slice(0, 8)}...`);
console.log(` Block: ${data.block_num}`);
}
}
// Usage
const client = new JupiterWebSocket('YOUR_API_KEY');
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
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
Python ​
python
import json
import asyncio
import websockets
from decimal import Decimal
class JupiterWebSocket:
def __init__(self, api_key):
self.api_key = api_key
self.uri = f"wss://api.nolimitnodes.com/socket?apikey={api_key}"
async def connect(self):
self.websocket = await websockets.connect(self.uri)
await self.subscribe()
async def subscribe(self):
subscription = {
"method": "dataSubscribe",
"params": {
"referenceId": "JUPITER_V6",
"streams": [{
"stream": "jupiterAggregatorV6Subscribe",
"params": {
"outputMint": "So11111111111111111111111111111111111111112"
}
}]
}
}
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') == 'jupiterAggregatorV6Subscribe':
await self.handle_swap(data['result'])
async def handle_swap(self, swap_data):
print(f"Jupiter Swap Detected:")
print(f" AMM: {swap_data['amm']}")
print(f" Input: {swap_data['inputAmount']} of {swap_data['inputMint'][:8]}...")
print(f" Output: {swap_data['outputAmount']} of {swap_data['outputMint'][:8]}...")
print(f" Block: {swap_data['block_num']}")
print(f" Type: {swap_data['type']}")
async def main():
client = JupiterWebSocket("YOUR_API_KEY")
await client.connect()
await client.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
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
Best Practices ​
1. Swap Monitoring & Analysis ​
- Track Volume Patterns: Monitor swap volumes and frequencies across different token pairs
- Identify Arbitrage Opportunities: Compare execution prices across AMMs to find profitable trades
- Set Large Trade Alerts: Flag swaps above certain thresholds (e.g., >$50k) for whale watching
2. Performance Optimization ​
- Use Strategic Filters: Apply
inputMint
/outputMint
filters for specific trading pairs you're monitoring - Batch Process Events: Group swap events by time windows for efficient analysis and storage
- Cache Token Metadata: Store frequently accessed token symbols and decimals locally
3. Risk Management ​
- Monitor AMM Performance: Track which AMMs provide best execution for different pairs
- Detect Unusual Activity: Flag rapid succession of large swaps that might indicate coordinated trading
- Set Volume Thresholds: Use
minAmount
filters to ignore dust transactions and focus on significant swaps