A comprehensive crypto portfolio tracker built for Monad blockchain. View your tokens, NFTs, DeFi positions, token approvals, and transaction history all in one beautiful dashboard. Built with Next.js 14, Moralis API, and Reown AppKit (WalletConnect v3).
- 🔗 Wallet connection via Reown/WalletConnect
- 💰 Display token balances (native MON + ERC20 tokens)
- 📊 Portfolio total value summary with asset allocation
- 🖼️ NFT gallery with spam filtering
- 🔐 Token approvals
- 📈 DeFi positions tracking
- 📜 Transaction history viewer
- 🔄 Real-time refresh capability
- 🎚️ Low-value token filtering
- 🎨 Beautiful, responsive UI with Tailwind CSS and animations
- Framework: Next.js 14 (App Router) + TypeScript
- Styling: Tailwind CSS + Framer Motion (animations)
- Blockchain Data: Moralis API
- Wallet Connection: Reown AppKit (WalletConnect v3)
- Target Chain: Monad Mainnet (Chain ID: 143)
- State Management: TanStack Query (React Query)
- UI Components: Custom components with Radix UI primitives
Before you begin, you'll need:
- Moralis API Key: Get it from Moralis Dashboard
- Reown Project ID: Get it from Reown Cloud
npm installUpdate the .env.local file with your API keys:
# Moralis API Configuration
MORALIS_API_KEY=your_moralis_api_key_here
# Reown/WalletConnect Configuration
NEXT_PUBLIC_PROJECT_ID=your_reown_project_id_here
# Monad RPC Configuration (already configured)
NEXT_PUBLIC_MONAD_RPC_URL=https://rpc.monad.xyz
NEXT_PUBLIC_MONAD_CHAIN_ID=143npm run devOpen http://localhost:3000 in your browser.
- Connect Wallet: Click the "Connect Wallet" button in the header
- Select Monad: Make sure you're connected to Monad mainnet (Chain ID: 143)
- View Portfolio: Your portfolio summary with total value and asset allocation will load automatically
- Explore Tabs:
- Tokens: View your token balances with USD values and asset allocation. Toggle to show/hide low-value tokens.
- Positions: Track your DeFi positions across protocols
- NFTs: Browse your NFT collection with spam filtering
- Approvals: Manage token approvals and revoke if needed
- History: View your transaction history
- Refresh Data: Click the refresh button in the portfolio summary to update all data
The app uses Next.js API routes to interact with the Moralis API. All endpoints are located in src/app/api/wallet/:
/api/wallet/balances- Fetches ERC20 token balances for a wallet/api/wallet/nfts- Retrieves NFTs owned by a wallet/api/wallet/approvals- Gets token approvals granted by the wallet/api/wallet/defi-positions- Fetches DeFi positions across protocols/api/wallet/history- Retrieves transaction history for the wallet
Each endpoint:
- Accepts wallet address as a query parameter
- Uses server-side Moralis API key for security
- Returns formatted data with error handling
- Supports optional pagination and filtering parameters
moralis-portfolio-app/
├── src/
│ ├── app/
│ │ ├── layout.tsx # Root layout with providers
│ │ ├── page.tsx # Dashboard page
│ │ ├── globals.css # Tailwind imports
│ │ └── api/
│ │ └── wallet/
│ │ ├── balances/route.ts # Token balances API
│ │ ├── nfts/route.ts # NFTs API
│ │ ├── approvals/route.ts # Token approvals API
│ │ ├── defi-positions/route.ts # DeFi positions API
│ │ └── history/route.ts # Transaction history API
│ │
│ ├── components/
│ │ ├── layout/
│ │ │ ├── Header.tsx # Header with connect button
│ │ │ ├── Footer.tsx # Footer component
│ │ │ └── Container.tsx # Max-width wrapper
│ │ │
│ │ ├── wallet/
│ │ │ └── ConnectButton.tsx # Reown connect button
│ │ │
│ │ ├── portfolio/
│ │ │ ├── PortfolioDashboard.tsx # Main dashboard with tabs
│ │ │ ├── PortfolioSummary.tsx # Total value card
│ │ │ ├── PortfolioTabNavigation.tsx # Tab navigation
│ │ │ ├── TokenList.tsx # Token list container
│ │ │ ├── NFTGrid.tsx # NFT grid container
│ │ │ ├── NFTCard.tsx # Individual NFT card
│ │ │ ├── TokenApprovalsList.tsx # Approvals list
│ │ │ ├── DefiPositionsList.tsx # DeFi positions list
│ │ │ ├── DefiPositionCard.tsx # DeFi position card
│ │ │ ├── TransactionList.tsx # Transaction history
│ │ │ ├── tokens/
│ │ │ │ ├── TokenRow.tsx # Token table row
│ │ │ │ ├── TokenTableHeader.tsx # Token table header
│ │ │ │ ├── TokenSkeleton.tsx # Token loading state
│ │ │ │ └── AssetAllocation.tsx # Asset allocation chart
│ │ │ ├── approvals/
│ │ │ │ ├── ApprovalRow.tsx # Approval table row
│ │ │ │ ├── ApprovalTableHeader.tsx # Approval table header
│ │ │ │ └── ApprovalSkeleton.tsx # Approval loading state
│ │ │ └── transactions/
│ │ │ ├── TransactionRow.tsx # Transaction table row
│ │ │ ├── TransactionTableHeader.tsx # Transaction table header
│ │ │ ├── TransactionSkeleton.tsx # Transaction loading state
│ │ │ └── TransactionIcon.tsx # Transaction type icon
│ │ │
│ │ └── ui/
│ │ ├── Card.tsx # Card component
│ │ ├── Button.tsx # Button component
│ │ ├── Skeleton.tsx # Skeleton loader
│ │ ├── EmptyState.tsx # Empty state component
│ │ ├── Tabs.tsx # Tab components
│ │ ├── Switch.tsx # Toggle switch
│ │ ├── ConnectIcon.tsx # Connect wallet icon
│ │ └── CheckIcon.tsx # Check icon
│ │
│ ├── config/
│ │ └── index.tsx # Wagmi/Reown config
│ │
│ ├── context/
│ │ └── index.tsx # App context provider
│ │
│ ├── lib/
│ │ ├── moralis.ts # Moralis API client
│ │ └── utils.ts # Utilities
│ │
│ ├── hooks/
│ │ ├── useTokenBalances.ts # Token data hook
│ │ ├── useNFTs.ts # NFT data hook
│ │ ├── useTokenApprovals.ts # Approvals data hook
│ │ ├── useDefiPositions.ts # DeFi positions hook
│ │ └── useWalletHistory.ts # Transaction history hook
│ │
│ └── types/
│ ├── moralis.ts # Moralis types
│ └── portfolio.ts # Portfolio types
- Run
npm installto ensure all dependencies are installed - Delete
.nextfolder and rebuild:rm -rf .next && npm run build
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linter
npm run lintThis app is ready to deploy to Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Add your environment variables in Vercel dashboard
- Deploy!
MIT
For issues or questions, please open an issue on GitHub.