> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# notifyOn Filtering

> Skip no-op account updates in LaserStream gRPC streams with the notifyOn filter — get notified only when a transaction actually writes to an account.

LaserStream's `notifyOn` filter lets a gRPC account subscription skip updates for accounts that a transaction **write-locked but never wrote to**. The same filter is available on the WebSocket `accountSubscribe` and `programSubscribe` methods — see [notifyOn Filtering over WebSocket](/docs/rpc/websocket/notify-on-filtering).

## 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 values:

| Value   | Sends an update when                                                  | Use it for                                                                        |
| ------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `lock`  | A transaction write-locks the account, whether or not it writes to it | The default — full visibility, including accounts merely touched by a transaction |
| `write` | A transaction actually writes to the account                          | Cutting no-op noise — most consumers lose nothing                                 |

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 updates 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 filter.

## Use it in LaserStream gRPC

Set `notifyOn` on an accounts filter in your `SubscribeRequest`:

```typescript theme={"system"}
import { subscribe, CommitmentLevel, LaserstreamConfig, SubscribeRequest } from 'helius-laserstream';

const subscriptionRequest: SubscribeRequest = {
  accounts: {
    "write-only": {
      account: ['<ACCOUNT_PUBKEY>'],
      owner: [],
      filters: [],
      notifyOn: 'write' // skip no-op updates
    }
  },
  commitment: CommitmentLevel.CONFIRMED,
  transactions: {}, slots: {}, transactionsStatus: {},
  blocks: {}, blocksMeta: {}, entry: {}, accountsDataSlice: [],
};

const config: LaserstreamConfig = {
  apiKey: 'YOUR_API_KEY',
  endpoint: 'https://laserstream-mainnet-ewr.helius-rpc.com',
};

await subscribe(config, subscriptionRequest, async (data) => {
  if (data.account) console.log(data.account);
}, async (error) => {
  console.error('Stream error:', error);
});
```

In the Rust SDK, set `notify_on: NotifyOn::Write as i32`. At the wire level this is the `notify_on` field of `SubscribeRequestFilterAccounts` (proto tag 31), with enum values `NOTIFY_ON_LOCK` (0, the default) and `NOTIFY_ON_WRITE` (1). See the [Subscribe Request reference](/docs/laserstream/grpc#subscribe-request) for every accounts filter field.

Over gRPC, `notifyOn` is a Helius extension available through the [Helius LaserStream SDK](/docs/laserstream/clients) — stock Yellowstone clients don't expose the field.

## Related

<CardGroup cols={2}>
  <Card title="Subscribe Request Reference" icon="filter" href="/docs/laserstream/grpc">
    Every gRPC accounts filter field, including `notifyOn`.
  </Card>

  <Card title="notifyOn Filtering (WebSocket)" icon="bolt" href="/docs/rpc/websocket/notify-on-filtering">
    The same `notifyOn` field on `accountSubscribe` and `programSubscribe`.
  </Card>

  <Card title="Account Subscriptions Guide" icon="wallet" href="/docs/laserstream/guides/account-subscription">
    Filtering strategies and runnable account-monitoring examples over gRPC.
  </Card>

  <Card title="Token Account (ATA) Filtering" icon="coins" href="/docs/laserstream/token-account-filtering">
    Match transactions touching the token accounts a wallet owns.
  </Card>
</CardGroup>
