Overview
The Alerts endpoint lets you receive the same events as Struct’s webhooks (trader whale trades, PnL crossings, price spikes, volume milestones, and more) pushed directly over a websocket connection instead of HTTP POSTs. This is useful when you want the low-latency push model of webhooks without having to host a public HTTP endpoint.Perfect for In-App Alert Systems
Alerts are especially well-suited for building in-app notification systems on trading platforms, letting your users track specific wallets, listen for price spikes on markets they care about, get notified when volume milestones are hit, or follow whale activity in real time.Because subscriptions are scoped to a single connection, you can open a dedicated socket per logged-in user and dynamically subscribe and unsubscribe as they adjust their alert preferences, without touching any server-side webhook configuration.
Endpoint
Subscribing
Subscribe to an alert type by sending a JSON message. Theop and event fields identify the subscription; all filter fields are flat on the top level of the message.
Unsubscribing
Send anunsubscribe message whose filter fields match the original subscription exactly:
Message Format
Each alert is pushed as JSON with the event name, a millisecond Unix timestamp, and the payload:Available Events
Trader Events
Holders
Metrics
Volume Milestones
Spikes
Market Lifecycle
Asset Prices
Errors
Invalid messages return a JSON error:Keepalive
Send a periodic ping to keep the connection alive:{ "type": "pong" }.