The WebSocket API provides real-time order tracking on Solana. For applications that need instant feedback on order status, WebSocket eliminates the latency and overhead of polling.
Solana's fast block times (~400ms) make real-time tracking particularly valuable:
The Solana WebSocket API provides three event types:
Emitted when your escrow transaction is confirmed on-chain. Includes the transaction signature and slot number.
Emitted when a resolver fills your order. Contains the resolver's address and the amounts exchanged.
Emitted when an order is cancelled, either by the maker or by a resolver cleaning up an expired order.
Explore the complete implementation — this example demonstrates creating an order and tracking it via WebSocket events: