Your personalized year in Polymarket trading - discover your stats, wins, and trading personality
A delightful, social, data-driven Wrapped experience for Polymarket traders, with an onchain footprint on Base.
- π Wallet Connect - Connect your wallet to instantly view your trading stats
- π Trading Analytics - Comprehensive breakdown of your 2025 trading activity
- Total trades, volume, and P&L
- Win rate and best/worst trades
- Favorite market categories
- Trading persona (Whale, Day Trader, Strategic Investor, etc.)
- Activity timeline and streaks
- π Pin Code Sharing - Generate shareable pin codes for any trader's wrapped
- πΌοΈ Export & Share - Download beautiful images to share on social media
- ποΈ NFT Badge Minting - Mint your Wrapped Badge as an NFT on Base (gasless!)
- Next.js 16 with App Router and Server Components
- RainbowKit + Wagmi for seamless wallet connection
- Polymarket CLOB API integration for real-time trading data
- Base Chain deployment with ERC-4337 account abstraction
- Gasless Minting via Paymaster integration
- Beautiful UI inspired by modern design patterns
- Node.js 18+ and npm/yarn/pnpm
- A WalletConnect Project ID (get one here)
- (Optional) Polymarket API key for rate limit increases
-
Clone the repository
cd /home/lyton/Documents/GitRepos/PolymarketWrapped -
Install dependencies
npm install # or pnpm install # or yarn install
-
Set up environment variables
Copy
.env.exampleto.env.local:cp .env.example .env.local
Then fill in your values:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id NEXT_PUBLIC_BADGE_CONTRACT_ADDRESS=your_deployed_contract_address NEXT_PUBLIC_PAYMASTER_URL=your_paymaster_url POLYMARKET_API_KEY=optional_polymarket_api_key
-
Run the development server
npm run dev
-
Open http://localhost:3000 in your browser
The PolymarketWrappedBadge contract is located in /contracts/PolymarketWrappedBadge.sol.
See CONTRACT_DEPLOYMENT.md for detailed deployment instructions using:
- β¨ Remix IDE (easiest, browser-based)
- π¨ Foundry (recommended for production)
- π¦ Separate Hardhat project
Contract Features:
- ERC-721 compliant NFT
- One badge per address per year
- Custom metadata URI for each badge
- Gas-efficient minting
- Compatible with ERC-4337 account abstraction
For gasless minting, integrate with a Paymaster service:
-
Alchemy Account Kit (Recommended)
- Sign up at Alchemy
- Enable Paymaster for Base
- Get your Paymaster URL
-
Pimlico
- Sign up at Pimlico
- Configure Base sponsorship
- Get your Paymaster endpoint
-
Update
.env.localwith your Paymaster URL
polymarket-wrapped/
βββ app/
β βββ api/
β β βββ wrapped/[address]/ # Fetch wrapped data for an address
β β βββ pincode/[code]/ # Resolve pin codes to addresses
β βββ layout.tsx # Root layout with providers
β βββ page.tsx # Main page
β βββ providers.tsx # Wagmi/RainbowKit setup
β βββ globals.css # Global styles
βββ components/
β βββ BackgroundEffects.tsx # Animated background
β βββ HeroSection.tsx # Landing section
β βββ StatsOverviewCard.tsx # Trading stats display
β βββ PersonaCard.tsx # Trading persona card
βββ config/
β βββ app.ts # App configuration
β βββ chains.ts # Chain configuration
βββ contracts/
β βββ PolymarketWrappedBadge.sol # NFT badge contract
βββ lib/
β βββ polymarket-client.ts # Polymarket API client
β βββ analytics-engine.ts # Trading analytics
β βββ nft-client.ts # NFT minting logic
β βββ utils.ts # Utility functions
βββ types/
β βββ trading.ts # TypeScript types
βββ package.json
Fetch wrapped data for a specific address.
Response:
{
"address": "0x...",
"year": 2025,
"stats": {
"totalTrades": 150,
"totalVolume": 50000,
"totalPnL": 2500,
"winRate": 0.65,
"tradingPersona": {
"type": "Strategic Investor",
"description": "...",
"traits": ["High Win Rate", "Calculated"],
"emoji": "π―"
},
...
},
"trades": [...],
"positions": [...]
}Resolve a pin code to wrapped data.
Generate a new pin code for an address (admin use).
Request:
{
"address": "0x..."
}Response:
{
"code": "ABC123",
"address": "0x...",
"expiresAt": 1234567890
}The app classifies traders into 8 unique personas based on their behavior:
| Persona | Criteria |
|---|---|
| π Whale | High volume (>$100k) and large trades (>$2k avg) |
| β‘ Day Trader | Very active (>200 trades) |
| π― Strategic Investor | High win rate (>65%) and consistent trading |
| π² Degen Trader | High risk, large individual bets |
| π₯ Risk Taker | Negative P&L but persistent trading |
| π HODL King | Few trades but high volume, patient |
| π§ Market Maven | Diverse trading across many categories |
| π± Cautious Bettor | New trader, just getting started |
- Core wrapped experience
- Wallet connection
- Pin code sharing
- Smart contract development
- Paymaster integration for gasless minting
- Image export functionality
- Social media sharing (Twitter cards)
- Historical data (2024, 2023)
- Leaderboards
- Community challenges
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details
- Polymarket for the trading platform and API
- Base for the L2 infrastructure
- RainbowKit for the beautiful wallet connection UI
- The Ethereum community for ERC-4337 standards
For issues, questions, or suggestions, please open an issue.
Built with β€οΈ for the Polymarket community
The NFT badge contract needs to be deployed once by the app maintainer. All users will then mint from this contract.
Quick Deploy with Remix:
- Visit Remix IDE
- Copy
contracts/PolymarketWrappedBadge.sol - Compile and deploy to Base Mainnet
- Copy the deployed contract address
See CONTRACT_DEPLOYMENT.md for detailed instructions.
Deploy to Vercel (Recommended):
# Install Vercel CLI
npm i -g vercel
# Deploy
vercelEnvironment Variables (set in Vercel dashboard):
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID- From cloud.walletconnect.comNEXT_PUBLIC_BADGE_CONTRACT_ADDRESS- Your deployed contract addressPOLYMARKET_API_KEY- Optional, for higher rate limits