Launch DLMM Portfolio Tracker β
A React TypeScript application for tracking and managing DLMM (Dynamic Liquidity Market Maker) positions on Solana, powered by Saros Finance.
- Seamless integration with Phantom and Solflare wallets
- Auto-connect functionality
- Wallet address display with shortened format
- Real-time portfolio overview with key metrics:
- Total Portfolio Value (USD)
- Total Fees Earned
- Active Positions Count
- Average APY across positions
- Grid view of all positions
- Interactive position cards with status indicators
- Comprehensive position information:
- Liquidity distribution chart (bar chart of bins)
- Current price marker
- Position price range (min/max)
- Total liquidity value breakdown
- Unclaimed fees per token
- Position creation date
- Estimated APY calculation
- Claim Fees - Execute on-chain transaction to claim fees
- Refresh Data - Real-time position data updates
- Pool total liquidity
- 24-hour trading volume
- Current price
- Fee tier
- Active bins count
- Loading states with skeletons
- Empty state messages
- Smooth transitions and animations
- Responsive design for mobile and desktop
- Dark mode UI
- React 18 with TypeScript
- Vite - Fast build tool
- Tailwind CSS - Utility-first styling
- @saros-finance/dlmm-sdk - DLMM protocol integration
- @solana/web3.js - Solana blockchain interaction
- @solana/wallet-adapter - Wallet connection
- Recharts - Data visualization
- Lucide React - Icon library
# Clone the repository
cd dlmm-portfolio-tracker
# Install dependencies
npm install
# Start development server
npm run devsrc/
βββ components/
β βββ Dashboard.tsx # Main portfolio view with summary cards
β βββ PositionCard.tsx # Individual position card component
β βββ PositionDetail.tsx # Detailed position modal view
β βββ PoolStats.tsx # Pool information display
β βββ WalletButton.tsx # Wallet connection button
β βββ LiquidityChart.tsx # Bin distribution chart
βββ services/
β βββ dlmmService.ts # DLMM SDK integration layer
βββ hooks/
β βββ usePositions.ts # Custom hook for positions data
β βββ usePoolData.ts # Custom hook for pool data
βββ utils/
β βββ formatting.ts # Number, date, address formatting
β βββ calculations.ts # APY and portfolio calculations
β βββ cn.ts # Tailwind class merging utility
βββ types/
β βββ index.ts # TypeScript type definitions
βββ App.tsx # Main app with wallet providers
The application uses the Saros DLMM SDK for all blockchain interactions:
- initializeDLMM() - Initialize SDK connection to Solana mainnet
- getUserPositions() - Fetch all positions for a wallet
- getPositionDetails() - Get detailed position information
- getPoolInfo() - Retrieve pool statistics
- getClaimableFees() - Calculate unclaimed fees
- claimFees() - Execute claim transaction
- getLiquidityDistribution() - Get bin distribution data
- isPositionInRange() - Check if position is earning fees
Positions are classified as:
- In Range (π’) - Currently earning fees
- Out of Range (π΄) - Not earning fees, needs rebalancing
APY is estimated based on:
- Total fees earned since position creation
- Current liquidity value
- Time elapsed since position creation
- Annualized to 365 days
- Positions refresh on wallet connection
- Manual refresh button available
- Auto-refresh after claiming fees
- Loading states during data fetches
The app connects to Solana mainnet by default. To use devnet or testnet:
// In App.tsx, change:
const network = WalletAdapterNetwork.Mainnet;
// To:
const network = WalletAdapterNetwork.Devnet;npm run buildThe build output will be in the dist/ directory.
# Start dev server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Type checking
npx tsc --noEmit- Node.js 16+
- npm or yarn
- Solana wallet (Phantom or Solflare)
- Active DLMM positions on Saros Finance
- Historical performance charts
- Position comparison tools
- Impermanent loss calculator
- Price alerts and notifications
- CSV export for tax reporting
- Multi-chain support
- Advanced filtering and sorting
- Position creation interface
MIT
Built for the Solana DeFi Contest as a comprehensive DLMM portfolio management tool.