apps/web/src/app/app/components/ and hooks
in apps/web/src/app/app/hooks/.
Component Architecture
Layout Components
| Component | File | Description |
|---|---|---|
LeftSidebar | left-sidebar.tsx | Session management and activity feed |
RightSidebar | right-sidebar.tsx | Wallet, positions, and market data |
MobileNav | mobile-nav.tsx | Responsive navigation for small screens |
CollapsibleSection | collapsible-section.tsx | Expandable/collapsible container |
Core Components
| Component | File | Description |
|---|---|---|
ChatPanel | chat-panel.tsx | Main chat interface with message history and input |
SessionTabs | session-tabs.tsx | Tab manager for multiple conversation sessions |
ActivityPanel | activity-panel.tsx | Recent agent job feed with status indicators |
Sidebar Panels
| Component | File | Description |
|---|---|---|
WalletPanel | wallet-panel.tsx | ETH and ERC-20 token balances |
PositionsPanel | positions-panel.tsx | Aave V3 and GMX V2 position summaries |
MarketPanel | market-panel.tsx | Token prices and trending pools |
NftsPanel | nfts-panel.tsx | NFT gallery for connected wallet |
PredictionsPanel | predictions-panel.tsx | Polymarket prediction markets |
StakingPanel | staking-panel.tsx | Staking positions overview |
LaunchpadPanel | launchpad-panel.tsx | Token launch tracking |
AutomationsPanel | automations-panel.tsx | Scheduled automation management |
SwapPanel | swap-panel.tsx | Quick swap interface |
Modal Components
| Component | File | Description |
|---|---|---|
SendModal | send-modal.tsx | Token transfer dialog |
DepositModal | deposit-modal.tsx | Deposit flow dialog |
BridgeModal | bridge-modal.tsx | Cross-chain bridge dialog |
CreateTokenModal | create-token-modal.tsx | Token launch wizard |
NftDetailModal | nft-detail-modal.tsx | NFT detail view |
NftTransferModal | nft-transfer-modal.tsx | NFT transfer dialog |
WrongNetworkModal | wrong-network-modal.tsx | Chain switching prompt |
FeatureInfoModal | feature-info-modal.tsx | Feature description overlay |
Custom Hooks
useChat
File:hooks/use-chat.ts
Manages the chat interface state including message history, job polling, and
thread persistence via sessionStorage.
| Return Value | Type | Description |
|---|---|---|
messages | Message[] | Chat message history (user + agent) |
isLoading | boolean | Whether a job is pending or running |
sendMessage | (content: string) => Promise<void> | Submit a prompt to the agent |
clearMessages | () => void | Clear message history |
sessionId | string | Current session identifier |
/agent/job/:id every 2 seconds while a job is running.
Thread IDs are persisted to sessionStorage under thread:{sessionId} for
cross-refresh recovery.
useWalletBalances
File:hooks/use-wallet-balances.ts
Fetches ERC-20 token balances for the connected wallet using wagmi’s
useReadContracts.
| Return Value | Type | Description |
|---|---|---|
balances | TokenBalance[] | Array of token balances with formatted amounts |
isLoading | boolean | Loading state |
refetch | () => void | Manually trigger a refresh |
TokenBalance includes: symbol, address, balance (bigint),
decimals, and formatted (human-readable string).
useTokenPrices
File:hooks/use-token-prices.ts
Fetches current token prices from the /market/prices API endpoint.
useActivity
File:hooks/use-activity.ts
Fetches recent agent jobs from /portfolio/jobs and transforms them into
activity feed items.
Activity includes: id, type (inferred from tool calls), description,
status, timestamp, and optional toolCalls.
usePositions
File:hooks/use-positions.ts
Fetches aggregated DeFi positions from /portfolio/positions.
PositionsData contains aave (Aave V3 account data with health factor,
collateral, and debt) and gmx (array of perpetual positions with PnL
and liquidation prices).
useMarketData
File:hooks/use-market-data.ts
Fetches trending pools from /market/trending.
useNfts
File:hooks/use-nfts.ts
Fetches NFTs for the connected wallet from /nfts/:address.
useAutomations
File:hooks/use-automations.ts
Manages automation CRUD operations against /automations.
Styling
The web terminal uses a vibrant dark theme with Arbitrum brand colors:| Token | Value | Usage |
|---|---|---|
| Primary | #12AAFF | Interactive elements, links |
| Light accent | #00D4FF | Hover states, highlights |
| Dark accent | #0088CC | Borders, secondary elements |
| Background | Dark gradient | Page background |