> For the complete documentation index, see [llms.txt](https://docs.yo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yo.xyz/integrations/integration-guides/sdk/react/hooks/use-vaults.md).

# use vaults

Returns the list of vault configurations for the connected chain. Vault configs are static and cached indefinitely.

```tsx
const { vaults, isLoading, isError, error } = useVaults()
```

## Usage

```tsx
import { useVaults } from '@yo-protocol/react'

function VaultList() {
  const { vaults, isLoading } = useVaults()

  if (isLoading) return <p>Loading vaults...</p>

  return (
    <ul>
      {vaults.map((v) => (
        <li key={v.address}>
          <strong>{v.name}</strong> ({v.symbol}) — {v.underlying.symbol}
        </li>
      ))}
    </ul>
  )
}
```

## Return Value

| Field       | Type            | Description                                                        |
| ----------- | --------------- | ------------------------------------------------------------------ |
| `vaults`    | `VaultConfig[]` | Array of vault configs for the current chain (empty while loading) |
| `isLoading` | `boolean`       | `true` while the initial fetch is in progress                      |
| `isError`   | `boolean`       | `true` if the query failed                                         |
| `error`     | `Error \| null` | Error object if the query failed                                   |

### VaultConfig shape

| Property     | Type                            | Description               |
| ------------ | ------------------------------- | ------------------------- |
| `address`    | `Address`                       | Vault contract address    |
| `name`       | `string`                        | Human-readable vault name |
| `symbol`     | `string`                        | Vault share token symbol  |
| `underlying` | `{ address, symbol, decimals }` | Underlying ERC-20 token   |
| `chains`     | `number[]`                      | Supported chain IDs       |

## Caching

| Setting     | Value      | Description                                 |
| ----------- | ---------- | ------------------------------------------- |
| `staleTime` | `Infinity` | Vault configs are static and never go stale |

{% hint style="info" %}
**Chain-aware**

The returned list automatically filters to vaults available on the currently connected chain. Switching chains returns a different set.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.yo.xyz/integrations/integration-guides/sdk/react/hooks/use-vaults.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
