What is the Exit Intelligence Stream?
The Exit Intelligence Stream is a persistent WebSocket connection that monitors your wallets on chain, tracks token positions, evaluates your profit and loss strategy in real time, and delivers pre built unsigned exit transactions when your thresholds are met.
Professional and Advanced tier subscribers also receive real time liquidity snapshots with slippage bands and liquidity trend data, giving you visibility into how much of a position can be sold at a given price impact and whether pool liquidity is growing, stable, or draining. Read the full announcement for details.
Endpoint
wss://stream.lasersell.io/v1/ws
Authentication is handled via the x-api-key header, which the SDKs set automatically.
When to Use the Exit Intelligence Stream vs REST
| Scenario | Use |
|---|
| Automated sell when profit/loss target is hit | Exit Intelligence Stream |
| One off buy or sell transaction | REST (LaserSell API) |
| Continuous position monitoring | Exit Intelligence Stream |
| Building a transaction for user confirmation | REST (LaserSell API) |
| Bot that reacts to wallet activity | Exit Intelligence Stream |
Use the Exit Intelligence Stream when you want the server to watch your positions and deliver exit transactions automatically. Use the REST API when you need a single transaction built on demand.
Connect the stream before you buy. The Exit Intelligence Stream detects new positions by observing on chain token arrivals. If you call /v1/buy before the stream is connected and configured, the resulting position will not be tracked and no exit signals will fire. Always connect and configure the stream first, then submit your buy.
High Level Flow
- Connect to
wss://stream.lasersell.io/v1/ws with your API key.
- Receive
hello_ok from the server (includes session ID and rate limits).
- Send
configure with wallet public keys and your strategy parameters.
- Receive initial
balance_update messages for existing token holdings.
- The stream monitors your wallets for new token arrivals and tracks profit and loss.
- When a position hits your target profit, stop loss, trailing stop, or deadline, the server sends an
exit_signal_with_tx.
- Sign locally and submit the unsigned transaction.
SDK Entry Points
The SDKs provide two abstraction levels:
StreamClient: Low level client. Manages the WebSocket connection, reconnection, and message framing. Returns raw ServerMessage objects.
StreamSession: High level wrapper. Wraps StreamClient with position tracking, deadline timers, liquidity snapshot caching, and typed StreamEvent objects that include a PositionHandle.
For most use cases, start with StreamSession.
import { StreamClient, StreamSession } from "@lasersell/lasersell-sdk";
const client = new StreamClient("YOUR_API_KEY");
const session = await StreamSession.connect(client, {
wallet_pubkeys: ["WALLET_PUBKEY"],
strategy: { target_profit_pct: 5, stop_loss_pct: 1.5 },
deadline_timeout_sec: 45,
send_mode: "helius_sender",
tip_lamports: 1000,
});
while (true) {
const event = await session.recv();
if (event === null) break;
// Handle event...
}
Next Steps