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

# useMarkets

> Hook extending useMarketsStream with favorites, recent views, and history tracking.

The `useMarkets` hook extends the \[`useMarketsStream`] hook with additional functionality like saving recent views and adding to favorites.

* [Tech docs](/sdks/tech-doc/modules/orderly_network_hooks#usemarkets)

```ts theme={null}
enum MarketsType {
  FAVORITES = 0,
  RECENT = 1,
  ALL = 2
}
```

### Example

```ts theme={null}
const [data, { addToHistory, favoriteTabs, updateFavoriteTabs, updateSymbolFavoriteState }] =
  useMarkets(MarketsType.ALL);
```
