A real-time Web3 trading dashboard powered by the Bags.fm API on Solana.
- π΄ Live Token Feed β Real-time token launches from Bags.fm, auto-refreshing every 15 seconds
- π Trade Quotes β Instant swap quotes with price impact, slippage control, and route plans
- π Token Analytics β Lifetime fees, creator breakdown, claim stats per token
- π Swarm Visualization β Animated particle network background
- π API Key Manager β Secure browser-side key storage with live validation
- π± Responsive β Works on mobile, tablet, and desktop
- Next.js 14 (Pages Router)
- TypeScript
- Tailwind CSS
- Recharts (charts)
- Lucide React (icons)
- Bags.fm REST API
git clone https://github.com/YOUR_USERNAME/bags-swarm-model.git
cd bags-swarm-modelnpm installcp .env.example .env.localEdit .env.local and add your Bags API key (optional β users can also enter it in the UI):
BAGS_API_KEY=your_bags_api_key_hereGet your API key at dev.bags.fm
npm run devOpen http://localhost:3000 in your browser.
- Go to github.com/new
- Name it
bags-swarm-model - Set it to Public (required for free Vercel hobby plan)
- Do NOT initialize with README (your local repo already has one)
- Click Create repository
In your project directory, run:
git init
git add .
git commit -m "feat: initial Bags Swarm Model dashboard"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/bags-swarm-model.git
git push -u origin mainReplace YOUR_USERNAME with your actual GitHub username.
- Go to vercel.com and sign in (use GitHub OAuth)
- Click "Add New β Project"
- Click "Import" next to your
bags-swarm-modelrepository - Vercel will auto-detect it as a Next.js project
- Under Environment Variables, optionally add:
BAGS_API_KEYβ your Bags API key
- Click "Deploy"
- Wait ~60 seconds β your app is live! π
Your URL will be: https://bags-swarm-model.vercel.app
# Install Vercel CLI
npm i -g vercel
# Login
vercel login
# Deploy (from your project directory)
vercel
# Follow the prompts:
# - Set up and deploy? Y
# - Which scope? (your account)
# - Link to existing project? N
# - Project name: bags-swarm-model
# - In which directory is your code? ./
# - Override settings? N
# For production deploy:
vercel --prodbags-swarm-model/
βββ src/
β βββ components/
β β βββ ApiKeyModal.tsx # API key connect modal
β β βββ StatsBar.tsx # Live stats overview cards
β β βββ SwarmBackground.tsx # Animated particle canvas
β β βββ TokenCard.tsx # Token feed card
β β βββ TokenDetailPanel.tsx # Token analytics panel
β β βββ TradePanel.tsx # Buy/Sell quote panel
β βββ hooks/
β β βββ useBags.ts # React hooks for Bags API
β βββ lib/
β β βββ bags-api.ts # Bags API client & types
β βββ pages/
β β βββ _app.tsx
β β βββ _document.tsx
β β βββ index.tsx # Main dashboard page
β βββ styles/
β βββ globals.css
βββ public/
β βββ favicon.svg
βββ .env.example
βββ .gitignore
βββ next.config.js
βββ package.json
βββ postcss.config.js
βββ tailwind.config.js
βββ tsconfig.json
βββ vercel.json
| Endpoint | Description |
|---|---|
GET /auth/me |
Validate API key & get user info |
GET /token-launch/feed |
Live token launch feed |
GET /trade/quote |
Swap quote with price impact |
GET /analytics/token-lifetime-fees |
Total fees earned per token |
GET /analytics/token-launch-creators |
Creator breakdown |
GET /analytics/token-claim-stats |
Claim statistics |
GET /state/pools |
All Bags liquidity pools |
Full API docs: docs.bags.fm
To enable actual on-chain trading, integrate a Solana wallet adapter:
npm install @solana/wallet-adapter-react @solana/wallet-adapter-wallets @solana/web3.jsThen call POST /trade/swap with the quote requestId and your wallet's public key to get a transaction, sign it with the wallet adapter, and submit via POST /solana/send-transaction.
MIT β build freely, trade responsibly.
Built with β€οΈ using Bags.fm API Β· Powered by Solana
