README

@yo-protocol/react provides two categories of hooks:

Read hooks — backed by TanStack Query with automatic caching, refetching, and stale-while-revalidate:

  • useVault — Single vault state + snapshot

  • useVaults — All vaults for the current chain

  • useUserBalance — Connected user's vault position

  • useVaultHistory — APY and TVL timeseries data

Action hooks — mutation-style hooks with loading, error, and transaction confirmation tracking:

  • useDeposit — Deposit assets via gateway

  • useRedeem — Redeem shares for assets via gateway

  • useApprove — Approve token spending

Query hooks:

  • usePendingRedemptions — Pending async redemptions for a user