Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fcda410
chore: init
0xeye Feb 10, 2026
71adc6e
chore: cleanup (#1053)
0xeye Feb 10, 2026
223ff7e
feat: add automatic deposit pop-up (#1061)
rossgalloway Feb 10, 2026
ca05c30
Chore remove kong to ydaemon mapping (#1064)
rossgalloway Feb 13, 2026
8061725
feat: improve search result filtering behavior and misc other fixes (…
rossgalloway Feb 17, 2026
78a9b7d
chore(audit): add kong vault inclusion audit script
Feb 7, 2026
879b350
feat(vaults): fetch full kong list and expose catalog/all vault maps
Feb 7, 2026
07a9790
feat(vault-filters): include user-held vaults from allVaults
Feb 7, 2026
b76ad3d
feat(holdings): unify vault holdings usd calculation and consumers
Feb 7, 2026
4766337
fix(balances): restrict enso missing-token fallback to vault position…
Feb 7, 2026
4688627
fix(format): make toBigInt robust to scientific notation
Feb 7, 2026
e36616e
Fix staking holdings detection for non-zero staking addresses
Feb 7, 2026
d434cea
fix filtering logic to filter non-yearn erc-4626 on portfolio page
rossgalloway Feb 9, 2026
78424a0
fix: make code functional and remove script
rossgalloway Feb 9, 2026
7a73e96
add warning for non-yearn-endorsed vaults
rossgalloway Feb 9, 2026
2fb0e41
fix strategies panel regression
Feb 18, 2026
7a639ba
fix regression in portfolio display
Feb 18, 2026
4e0e8d9
fix additional regressions and issues
Feb 18, 2026
021aff2
fix issue with balance display in portfolio page
Feb 18, 2026
c7bf7ca
fix test to get build working
Feb 18, 2026
5806a41
lint
Feb 18, 2026
cc44fc7
feat: update CLAUDE.md
0xeye Feb 19, 2026
00d7e1d
chore: fix sticky on portfolio (#1072)
rossgalloway Feb 19, 2026
1fe99f4
chore: fix vault widget numbers display size and readability (#1070)
rossgalloway Feb 19, 2026
5fa32b4
Merge branch 'dev' into fix--missing-strategies
rossgalloway Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .claude/rules/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Environment Setup

Copy `.env.example` to `.env` and configure:
- RPC URIs for each chain: `VITE_RPC_URI_FOR_<chainId>`
- WalletConnect project ID: `VITE_WALLETCONNECT_PROJECT_ID`
- Yearn API endpoints: `VITE_YDAEMON_BASE_URI`, `VITE_KONG_REST_URL`
- Enso API key: `ENSO_API_KEY` (server-only, no VITE_ prefix)
- Balance source strategy: `VITE_BALANCE_SOURCE` (`enso` or `multicall`)
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pnpm-debug.log*
*.sln
*.sw?

.claude
.env
.next
.vercel
Expand Down Expand Up @@ -51,7 +50,9 @@ AGENTS.md
yearn.fi-worktree-*

# claude settings
.claude
.claude/*
!.claude/rules/
!.claude/skills/

# codex settings
.codex
9 changes: 0 additions & 9 deletions AGENT_log.md

This file was deleted.

137 changes: 42 additions & 95 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,65 @@
# CLAUDE.md
# yearn.fi

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Yearn Finance vaults interface — React 19 + TypeScript SPA (Vite, TanStack Query, Tailwind CSS 4, Wagmi/Viem).

## Project Overview

yearn-fi is Yearn Finance's main website and vaults interface - a Vite-based React 19 SPA for depositing/withdrawing from yield vaults across multiple blockchain networks.

## Development Commands
## Commands

```bash
bun install # Install dependencies
bun run dev # Start Vite dev server (port 3000)
bun run build # TypeScript check + Vite build
bun run preview # Preview production build
bun run test # Run Vitest suite
bun run lint # Biome check
bun run lint:fix # Biome format and fix
bun run tslint # TypeScript type check only
bun run clean # Clean build artifacts (runs clean.sh)
bun install # Install dependencies
bun run dev # Vite dev server (3000) + API server (3001)
bun run build # TypeScript check + Vite build
bun run test # Full Vitest suite
bunx vitest run src/path/to/test.ts # Single test file
bun run lint:fix # Biome format and fix
bun run tslint # TypeScript type check only
```

## Code Style & Naming Conventions
## Verification

Enforced by Biome (biome.jsonc)—format frequently with `bun run lint:fix`:
- 2-space indentation
- Single quotes
- No trailing commas
- Optional semicolons (omit where possible)
- 120 character line width
IMPORTANT: After making code changes, always verify:
1. `bun run tslint` — type check passes
2. `bun run lint:fix` — code is formatted
3. Run relevant test file if one exists

Naming:
- Components: PascalCase (e.g., `VaultListRow.tsx`)
- Hooks: `useFoo` pattern (e.g., `useFilteredVaults.ts`)
- Utilities: camelCase (e.g., `format.ts`)
- Types: prefixed with `T` (e.g., `TSortDirection`, `TVaultType`)
Husky runs `lint-staged` + `bun run tslint` on every commit.

## Best Practices
## Code Style

- Use functional style code
- Avoid comments where unnecessary
- Use explicit module imports and extract shared constants instead of duplicating literals across apps
Formatting is enforced by Biome (biome.jsonc) — do not worry about indentation, quotes, or commas.

## Architecture

### Directory Structure

```
src/
├── main.tsx # Vite entry point
├── App.tsx # Root with context providers
├── routes.tsx # React Router configuration
├── components/
│ ├── shared/ # Shared library (@shared alias)
│ │ ├── components/ # Buttons, Dropdowns, Headers, Icons
│ │ ├── contexts/ # useWallet, useYearn, useWeb3
│ │ ├── contracts/ # ABI source of truth
│ │ ├── hooks/ # Vault data, balances, filtering hooks
│ │ ├── utils/ # Format, calculations, chain constants
│ │ ├── icons/ # 50+ icon components
│ │ └── types/ # Shared type definitions
│ └── pages/ # Route pages and feature components (@pages alias)
│ ├── index.tsx # Home/Landing page
│ ├── landing/ # Landing page sections
│ ├── portfolio/ # Portfolio page
│ │ ├── index.tsx
│ │ └── usePortfolioModel.ts
│ └── vaults/ # Vaults pages and components
│ ├── index.tsx # Vaults list page
│ ├── [chainID]/ # Vault detail page
│ │ └── [address].tsx
│ ├── components/ # Vaults UI (list, detail, widget)
│ ├── contexts/ # Vault settings context
│ ├── domain/ # Domain helpers (reports, normalization)
│ ├── hooks/ # Vault-specific hooks
│ └── utils/ # Vault utilities (charts, yBOLD, filters)
├── hooks/ # Core hooks (useThemePreference, usePlausible)
└── contexts/ # App-level contexts

api/ # Vercel serverless functions
```
IMPORTANT: These rules are NOT enforced by tooling — you MUST follow them:
- NEVER use `let` — always use `const`
- NEVER use `for`/`while` loops — use `.map()`, `.filter()`, `.reduce()`
- NEVER use relative imports — use path aliases (`@/*`, `@shared/*`, `@pages/*`, `@components/*`)
- Use functional style code throughout

### Tech Stack
Naming:
- Components: PascalCase (`VaultListRow.tsx`)
- Hooks: `useFoo` (`useFilteredVaults.ts`)
- Utilities: camelCase (`format.ts`)
- Types: T-prefixed (`TSortDirection`, `TVaultType`)

- **Framework**: React 19 + TypeScript 5.9 (strict mode)
- **Build**: Vite 7.2
- **Routing**: React Router 7.9
- **Styling**: Tailwind CSS 4
- **State**: TanStack Query 5, React Context
- **Web3**: Wagmi 2.18, Viem 2.38, RainbowKit 2.2
## Architecture

### Path Aliases (vite.config.ts)
**Tech stack:** React 19, Vite, React Router (lazy-loaded), Tailwind CSS 4, TanStack Query, Wagmi/Viem/RainbowKit

**Path aliases** (defined in vite.config.ts):
- `@/*` → `src/*`
- `@shared/*` → `src/components/shared/*`
- `@pages/*` → `src/components/pages/*`
- `@components/*` → `src/components/*`
- `@hooks/*` → `src/hooks/*`

### Key Patterns

**Context Providers**: Nested in App.tsx - WalletContextApp → YearnContextApp → AppSettingsContextApp

**Data Flow**: Vault data fetched via useYearn context hooks, filtered/sorted via custom hooks in src/components/shared/hooks

## Multi-Chain Support

Supported networks (configured in `src/components/shared/utils/constants.tsx`):
- Ethereum (1), Optimism (10), Gnosis (100), Polygon (137), Fantom (250), Arbitrum (42161), Base (8453)
**Key directories:**
- `src/components/shared/` — shared library (contexts, hooks, utils, types, contracts)
- `src/components/pages/` — route pages (landing, portfolio, vaults)
- `api/` — Vercel serverless functions (prod) / Bun dev server (local)

RPC URIs configured via environment variables: `VITE_RPC_URI_FOR_<chainId>`
**Key patterns:**
- Context provider chain defined in `App.tsx` — read that file for the full order
- Vault data flows through `useYearn` context → filtered/sorted via hooks in `@shared/hooks/`
- Dual server: Vite (3000) proxies `/api/*` to Bun API server (3001). In prod, `api/` runs as Vercel serverless functions.

## Environment Setup
## Multi-Chain

Copy `.env.example` to `.env` and configure:
- RPC URIs for each chain
- WalletConnect project ID
- Yearn API endpoints (yDaemon, Kong REST)
Supported chains configured in `src/components/shared/utils/constants.tsx`:
Ethereum (1), Optimism (10), Polygon (137), Fantom (250), Base (8453), Arbitrum (42161), Sonic (146), Katana (747474)
Loading