Discover your on-chain identity on the Sui Blockchain.
My Sui Wrapped is a data visualization platform that analyzes a user's transaction history on the Sui Network to generate a personalized "Year in Review." It indexes on-chain data to calculate trading volume, identify top interacted assets, and classify users into behavioral archetypes (e.g., "Diamond Hands," "Degen," or "NFT Collector").
- 📊 Financial Analytics:
- Total Volume (USD), Inflow vs. Outflow.
- Biggest Transaction tracking.
- Peak activity days.
- 🎭 User Archetypes:
- Algorithmic classification of users based on tx frequency and asset holding time.
- Rank Percentile: See where you stand among all Sui users.
- 🤝 Social Graph:
- Top Interactors: Visualizes which addresses you interact with most.
- Top Assets: Breakdown of your most traded tokens/NFTs.
- 🚀 High Performance:
- Built with TanStack Start for server-side rendering.
- Leverages Supabase Connection Pooling for high-concurrency read operations.
- Framework: TanStack Start (React)
- Language: TypeScript
- Database: PostgreSQL (via Supabase)
- ORM: Prisma (v7.2.0)
- Blockchain SDK: @mysten/sui.js
- Styling: Tailwind CSS
The core logic relies on three main models defined in prisma/schema.prisma:
| Model | Description |
|---|---|
| User | Stores the wallet address and indexing status (isIndexed, lastIndexedAt). |
| UserStats | The heavy lifter. Stores calculated metrics like totalVolumeUSD, archetype, topAssets (JSON), and rankPercentile. |
| Transaction | Caches specific transactions (digest, timestamp, balanceChanges) for historical lookups. |
git clone [https://github.com/Verifieddanny/my-sui-wrapped.git](https://github.com/Verifieddanny/my-sui-wrapped.git)
cd my-sui-wrappednpm install
# or
pnpm installCreate a .env file in the root directory. You need two database URLs for Supabase to handle migrations correctly.
# Port 6543 (Pooler) - Used for the App (Queries)
DATABASE_URL="postgresql://postgres.projectid:password@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true"
# Port 5432 (Direct) - Used for Migrations
DIRECT_URL="postgresql://postgres:password@db.projectid.supabase.co:5432/postgres?connect_timeout=30"
COIN_GECKO_API="api key"Note: The ?connect_timeout=30 in the DIRECT_URL is crucial for preventing timeout errors during migrations on slower networks.
We use the new prisma.config.ts setup.
npx prisma migrate dev --name init
npx prisma generatenpm run devThis project uses Prisma v7+ with a custom configuration file prisma.config.ts.
- Runtime Operations: The application connects via the Transaction Pooler (Port 6543) defined in
DATABASE_URL. This allows for thousands of concurrent users. - CLI Operations (Migrations): Prisma CLI operations connect via the Direct Connection (Port 5432) defined in
DIRECT_URL.
If you encounter P1001: Can't reach database server during migration:
- Check that
DIRECT_URLis using port5432. - Ensure you have
?connect_timeout=30appended to the URL string. - Verify your IP is allowed in Supabase Network settings (if restricted).
Contributions are welcome!
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Danny
- GitHub: @Verifieddanny
- X (Twitter): @dannyclassi_c
Distributed under the MIT License. See LICENSE for more information.