Skip to main content
The notifyOn option on the accountSubscribe and programSubscribe WebSocket methods lets a subscription skip updates for accounts that a transaction write-locked but never wrote to. The same filter is available over gRPC — see notifyOn Filtering for the gRPC version.

The problem: write locks generate duplicate updates

On Solana, the validator emits an account update for every account a transaction write-locks — even when no instruction actually wrote to the account, so its lamports and data are unchanged. For busy accounts, that means a steady stream of duplicate “nothing changed” notifications that consume bandwidth without carrying new information.

Filter modes

notifyOn takes one of two string values: Two details worth knowing:
  • A write of identical data still counts as a write and is delivered. write filters out lock-only touches, not writes that happen to leave the same bytes. In practice these identical-data writes are rare — under 5% of updates in most cases.
  • The updates write drops are exact duplicates of state you already received. If you rely on notifications as a “this account was locked by a transaction” signal (e.g., activity tracking), stay on lock.
Subscriptions that omit the field behave exactly as before, so it’s safe to add to an existing subscription.

Use it in accountSubscribe

Add notifyOn to the config object:

Use it in programSubscribe

The same key works in the programSubscribe config object, filtering no-op updates across every account the program owns:
Parsing is fail-open: only "write" (case-insensitive) opts in. Anything else — absent, a typo, an unknown token — resolves to lock, so a mistake keeps you on the all-updates path instead of erroring or silently dropping data.

accountSubscribe

Full accountSubscribe method reference, including notifyOn.

programSubscribe

Full programSubscribe method reference, including notifyOn.

notifyOn Filtering (gRPC)

The same filter on LaserStream gRPC accounts filters.

How to Use accountSubscribe

Guide to streaming account updates over WebSocket.