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

# onPricesUpdated

> Live-streamed price updates for multiple tokens in a single subscription.

<Note>
  Subscriptions use `wss://graphql.mobula.io/graphql` with the `graphql-transport-ws` protocol. `wss://graphql.mobula.io/graphql/subscriptions` is also supported for backwards compatibility.
</Note>

### Returns

<ResponseField name="onPricesUpdated" type="Price!">
  Price update payload (one push per matching swap). See [Price](/api-reference/graphql/types/Price).
</ResponseField>

### Arguments

<ResponseField name="input" type="[OnPricesUpdatedInput!]!" required>
  List of tokens to subscribe to. See [OnPricesUpdatedInput](/api-reference/graphql/types/OnPricesUpdatedInput).
</ResponseField>

<ResponseField name="useWeightedPrices" type="Boolean">
  When `true`, subscribe to liquidity-weighted token prices aggregated across all of the token's pools instead of pair-derived prices. Not supported when **any** input item provides `sourcePairAddress`.
</ResponseField>

### Behavior

* One subscription, many tokens. Events from different tokens in the batch are interleaved.
* Each matching swap produces one push (per token).
* The `useWeightedPrices` flag applies uniformly to all tokens in the batch.

### Example — batch of tokens, pair-derived

```graphql theme={null}
subscription {
  onPricesUpdated(
    input: [
      { address: "0x6982508145454ce325ddbe47a25d4ec3d2311933", networkId: 1 },
      { address: "So11111111111111111111111111111111111111112", networkId: 1399811149 }
    ]
  ) {
    address
    networkId
    priceUsd
    timestamp
    blockNumber
  }
}
```

### Example — batch with weighted prices

```graphql theme={null}
subscription {
  onPricesUpdated(
    input: [
      { address: "0x6982508145454ce325ddbe47a25d4ec3d2311933", networkId: 1 },
      { address: "So11111111111111111111111111111111111111112", networkId: 1399811149 }
    ]
    useWeightedPrices: true
  ) {
    address
    priceUsd
    timestamp
  }
}
```

### Example — mixed pair-pinned and default

```graphql theme={null}
subscription {
  onPricesUpdated(
    input: [
      { address: "0x6982508145454ce325ddbe47a25d4ec3d2311933", networkId: 1 },
      {
        address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        networkId: 1,
        sourcePairAddress: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
      }
    ]
  ) {
    address
    priceUsd
    timestamp
  }
}
```
