use vaults

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

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

Usage

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

circle-info

Chain-aware

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