A modern, full-featured Next.js dashboard for liquidity providers to manage USDC deposits, track earnings, and monitor pool statistics on the StablePay platform.
- ✅ Authentication - Secure sign-in/sign-up with Clerk
- ✅ Portfolio Overview - Real-time balance, earnings, and stats
- ✅ Deposit Flow - Unique deposit addresses with QR codes
- ✅ Withdrawal System - Secure withdrawals with 7-day lock period
- ✅ Transaction History - Complete audit trail with CSV export
- ✅ Pool Statistics - Public metrics and health indicators
- ✅ Earnings Analytics - Detailed performance tracking and projections
- ✅ Notifications Center - Real-time updates and alerts
- ✅ Settings & Preferences - Account management and customization
- ✅ Responsive Design - Mobile-optimized layouts
- 🔄 VIP Dashboard - Premium features for high-balance providers
- 🔄 Referral Program - Earn rewards for bringing new providers
- 🔄 Advanced Charts - Historical performance visualization
- 🔄 API Access - Programmatic account management
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Authentication: Clerk
- API Client: Axios + React Query
- Forms: React Hook Form + Zod
- Charts: Recharts
- Icons: Lucide React
- Notifications: Sonner
liquidity-provider/
├── app/
│ ├── (auth)/ # Authentication pages
│ │ ├── sign-in/
│ │ └── sign-up/
│ ├── (dashboard)/ # Protected dashboard pages
│ │ ├── layout.tsx # Dashboard layout with sidebar
│ │ ├── page.tsx # Portfolio overview
│ │ ├── deposit/ # Deposit flow
│ │ ├── withdraw/ # Withdrawal flow
│ │ ├── history/ # Transaction history
│ │ ├── pool-stats/ # Pool statistics
│ │ ├── earnings/ # Earnings analytics
│ │ ├── notifications/ # Notifications center
│ │ └── settings/ # Settings page
│ ├── layout.tsx # Root layout
│ └── page.tsx # Landing page
├── components/
│ ├── ui/ # Reusable UI components
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ ├── input.tsx
│ │ ├── badge.tsx
│ │ ├── label.tsx
│ │ ├── switch.tsx
│ │ └── progress.tsx
│ └── dashboard/ # Dashboard-specific components
│ └── sidebar.tsx
├── lib/
│ ├── api/ # API client and hooks
│ │ ├── client.ts # Axios instance
│ │ ├── hooks.ts # React Query hooks
│ │ └── providers.tsx # React Query provider
│ ├── utils/ # Utility functions
│ │ ├── utils.ts # Helper functions
│ │ └── format.ts # Formatting utilities
│ └── types/ # TypeScript types
│ └── index.ts
├── middleware.ts # Clerk middleware
└── tailwind.config.ts # Tailwind configuration
- Node.js 18+ and npm
- Clerk account (clerk.com)
- Access to StablePay API
- Clone the repository:
git clone <repository-url>
cd liquidity-provider- Install dependencies:
npm install- Environment variables are already set up in
.env.local:
# API Configuration
NEXT_PUBLIC_API_URL=https://api.goopenly.xyz/api/v1
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_Zmxvd2luZy1iZWV0bGUtNjEuY2xlcmsuYWNjb3VudHMuZGV2JA
CLERK_SECRET_KEY=sk_test_o15bPONE4M6pM46TwS2ZMTk2JeaUVoV7b9YBK57mPZ- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
This application uses Clerk for authentication. Key features:
- Email/password authentication
- Social login (Google, GitHub, etc.)
- Email verification
- Session management
- Protected routes with middleware
The dashboard integrates with the following StablePay API endpoints:
GET /protected/liquidity/my-info- Get provider informationGET /protected/liquidity/deposit-instructions- Get unique deposit addressPOST /protected/liquidity/confirm-deposit- Confirm a depositPOST /protected/liquidity/withdraw- Request a withdrawalGET /protected/liquidity/transactions- Get transaction historyGET /protected/liquidity/earnings- Get earnings dataGET /protected/liquidity/notifications- Get notificationsGET /protected/liquidity/settings- Get user settingsPUT /protected/liquidity/settings- Update user settings
GET /public/liquidity/stats- Get pool statistics
The application uses React Query hooks for data fetching:
import { useProviderInfo, usePoolStats, useDepositInstructions } from '@/lib/api/hooks';
function Component() {
const { data, isLoading, error } = useProviderInfo();
const { data: stats } = usePoolStats();
const { data: instructions } = useDepositInstructions();
// ...
}The dashboard uses a carefully crafted color palette:
- Primary: Purple/Blue (
#8b5cf6,#7c3aed,#6d28d9) - Secondary: Green (
#10b981,#059669) - Accent: Orange (
#f97316) - Success: Green (
#10b981) - Warning: Amber (
#f59e0b) - Error: Red (
#ef4444)
- Font Family: Inter (Google Fonts)
- Headings: Bold, 32px - 20px
- Body: Regular, 16px
- Small: 14px
- Caption: 12px
- ✅ JWT token validation via Clerk
- ✅ Protected routes with middleware
- ✅ Input validation with Zod
- ✅ HTTPS-only in production
- ✅ Secure environment variables
All withdrawal addresses are validated using:
function isValidEthAddress(address: string): boolean {
return /^0x[a-fA-F0-9]{40}$/.test(address);
}- User gets unique BlockRadar address with QR code
- User sends USDC to address via MetaMask
- User confirms deposit via dashboard
- System detects deposit and credits account
- Funds auto-sweep to master pool
- System checks 7-day lock period
- User enters amount and destination address
- User confirms withdrawal details
- System processes withdrawal from master pool
- User receives USDC within 24 hours
- Duration: 7 days from last deposit
- Purpose: Prevents gaming, ensures stable liquidity
- Resets: With each new deposit
- After Expiry: Withdraw anytime, any amount
The dashboard is fully responsive with breakpoints:
- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px
Mobile features:
- Collapsible sidebar
- Touch-optimized buttons
- Responsive tables and charts
- Push code to GitHub
- Import project to Vercel
- Add environment variables
- Deploy
npm run buildEnsure these are set in production:
NEXT_PUBLIC_API_URLNEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEY
Each component includes JSDoc comments for clarity and maintainability.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for type safety
- Follow ESLint rules
- Keep files under 500 lines
- Write meaningful commit messages
- Add comments for complex logic
This project is licensed under the MIT License.
- Next.js - React framework
- Clerk - Authentication
- Tailwind CSS - Styling
- Lucide - Icons
- React Query - Data fetching
- Recharts - Charts
- Email: support@goopenly.xyz
- Documentation: https://docs.goopenly.xyz
- Discord: https://discord.gg/goopenly
- Twitter: @GoOpenly
- Phase 1: MVP (Core Features)
- Phase 2: Enhanced Features
- Phase 3: Advanced Features
- VIP Dashboard
- Referral Program
- Mobile App (React Native)
- API Access
- Advanced Analytics
Built with ❤️ by the StablePay Team
Last updated: October 23, 2025