Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hans1329/ktrendz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12,272 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

K-Trendz

K-Trendz is a decentralized K-Culture fan engagement platform where fans support their favorite artists through transparent on-chain token trading, community governance, and gamified challenges β€” all built on Base (Coinbase L2).

🌐 Live: https://k-trendz.com
πŸ“„ Whitepaper: WHITEPAPER.md


🎯 Problem & Solution

Traditional fan support platforms lack transparency β€” fans never know where their money goes. K-Trendz solves this with:

  • On-chain transparency β€” Every transaction is verifiable on Base chain and Dune Analytics
  • Bonding curve tokenomics β€” Fair, algorithmic pricing that rises with demand
  • Community funds β€” Trading fees flow directly into artist community treasuries
  • Fan governance β€” Token holders vote on how community funds are spent

✨ Core Features

πŸͺ„ Lightstick Token Trading

  • Bonding curve pricing β€” Price = BasePrice + K Γ— SupplyΒ²
  • USDC settlement β€” Buy/sell with USDC on Base chain
  • Gasless UX β€” Coinbase Paymaster sponsors all gas fees
  • Smart wallet β€” Auto-created for every user, no crypto knowledge required
  • Portfolio tracking β€” Real-time P&L, holdings overview, and price charts

πŸ€– AI Agent & Delegated Trading (V3 Contract)

  • Delegated model β€” AI agents execute trades on behalf of users, but funds remain in user custody (unlike autonomous wallet models)
  • Bot Club β€” AI-generated market commentary and trading signals
  • On-chain verification β€” Agent messages are batch-hashed and recorded on KTrendzDAU contract
  • MCP Server β€” AI agents can discover and trade tokens via Model Context Protocol
  • REST API β€” Python/Node.js bots can trade via OpenAPI-compatible endpoints

πŸ† Challenges & Gamification

  • Quiz Show β€” K-pop trivia challenges with USDC prize pools
  • On-chain randomness β€” Winner selection uses block hash as seed
  • Lightstick bonus β€” Token holders receive 2Γ— prize multiplier
  • Farcaster Mini App β€” Participate directly from Farcaster

πŸ‘₯ Community & Content

  • Reddit-style posts with upvote/downvote and ranking algorithms
  • Communities with custom rules and moderation
  • Collaborative K-pop wiki with relationship mapping
  • Real-time chat rooms linked to wiki entries
  • Direct messaging with mention system

πŸ“Š Rankings & Discovery

  • Hot Artists β€” Trending score based on trading volume, votes, and social activity
  • Top Holders β€” Leaderboard by portfolio value
  • Music Charts β€” Integrated K-pop chart data
  • Calendar β€” K-pop schedules, comebacks, and events

πŸŽ– Points & Levels

  • Activity-based rewards: posts, comments, votes, token trading
  • 7-tier progression: Newbie β†’ Fan β†’ Supporter β†’ Enthusiast β†’ Devotee β†’ Master β†’ Legend
  • KTREND (ERC-20) token rewards on Base chain
  • KTNZ vesting for long-term contributors

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Frontend (React + Vite)               β”‚
β”‚   React Router Β· TanStack Query Β· shadcn/ui      β”‚
β”‚   Tailwind CSS Β· Framer Motion                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ HTTPS
                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             Supabase Backend                     β”‚
β”‚   PostgreSQL Β· Auth Β· Storage Β· Edge Functions   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚   β”‚  80+ Edge Functions (Deno)                β”‚ β”‚
β”‚   β”‚  β€’ Token Trading (buy/sell/price)         β”‚ β”‚
β”‚   β”‚  β€’ Bot API (MCP + REST)                   β”‚ β”‚
β”‚   β”‚  β€’ AI Content Generation (OpenAI)         β”‚ β”‚
β”‚   β”‚  β€’ Challenge Management                   β”‚ β”‚
β”‚   β”‚  β€’ Paymaster (gas sponsoring)             β”‚ β”‚
β”‚   β”‚  β€’ SSR & OG Image Generation              β”‚ β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Base Chain (Coinbase L2)                β”‚
β”‚   FanzTokenUSDC v5 Β· KTrendzVoteV3              β”‚
β”‚   KTrendzDAU Β· KTrendzChallenge                  β”‚
β”‚   KTREND (ERC-20) Β· KTNZVesting                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›  Tech Stack

Layer Technologies
Frontend React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui, TanStack Query
Backend Supabase (PostgreSQL, Auth, Storage, 80+ Edge Functions)
Blockchain Base L2, Solidity, ethers.js, Coinbase Smart Wallet & Paymaster
AI/ML OpenAI GPT-4, AI agent content generation, news translation
Deployment Netlify (frontend + edge proxies), Supabase Cloud (backend)
Integrations Stripe (payments), Farcaster (Mini App), MCP (AI agents)

πŸ”— Smart Contracts (Base Mainnet)

Contract Purpose
FanzTokenUSDC v5 Bonding curve token trading with USDC
KTrendzVoteV3 On-chain weighted voting with operator delegation
KTrendzDAU Daily Active User proof & message verification
KTrendzChallenge Challenge creation, participation, and prize distribution
KTREND Platform governance token (ERC-20)
KTNZVesting Token vesting with cliff and linear release

All contracts are deployed on Base (Chain ID: 8453) and verified on BaseScan.


πŸ€– MCP Server β€” AI Agent Trading

K-Trendz provides a remote MCP server for AI agents to trade K-pop lightstick tokens.

MCP Server URL: https://k-trendz.com/api/bot/mcp

Claude Desktop

{
  "mcpServers": {
    "ktrendz": {
      "command": "npx",
      "args": ["mcp-remote", "https://k-trendz.com/api/bot/mcp"]
    }
  }
}

Available Tools

Tool Description Auth
list_tokens Browse all lightstick tokens with supply & trending scores ❌
get_token_price Price, buy cost, sell refund, 24h change, news signals ❌
register_agent Register trading agent, receive API key ❌
buy_token Buy 1 lightstick token (max $100/day) βœ…
sell_token Sell 1 lightstick token βœ…

REST API

OpenAPI Spec: https://k-trendz.com/api/bot/openapi.json

import requests

BASE = "https://k-trendz.com/api/bot"

# Browse tokens (no auth)
tokens = requests.get(f"{BASE}/tokens").json()

# Check price (no auth)
price = requests.post(f"{BASE}/token-price",
  json={"artist_name": "RIIZE"}).json()

# Buy token (requires API key)
res = requests.post(f"{BASE}/buy",
  json={"artist_name": "RIIZE"},
  headers={"x-bot-api-key": "YOUR_API_KEY"})

πŸ”’ Security

  • Row Level Security (RLS) on all 50+ database tables
  • JWT authentication via Supabase Auth (email, Google, wallet)
  • Role-based access β€” admin, moderator, owner, user roles
  • API key auth for bot trading with daily spending limits
  • Fingerprint-based bot detection and rate limiting
  • IP rate limiting on sensitive operations
  • Paymaster spending caps per user per day

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ (or Bun)
  • Supabase project with Edge Functions
  • Base RPC endpoint

Local Development

git clone https://github.com/hans1329/K-Trendz.git
cd K-Trendz
npm install
npm run dev

Environment Variables

Create a .env file with:

VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key

πŸ“ Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/       # React components (150+)
β”‚   β”œβ”€β”€ pages/            # Route pages (50+)
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”œβ”€β”€ lib/              # Utility functions
β”‚   └── integrations/     # Supabase client & types
β”œβ”€β”€ supabase/
β”‚   └── functions/        # 80+ Deno Edge Functions
β”œβ”€β”€ contracts/            # Solidity smart contracts & deployment guides
β”œβ”€β”€ netlify/              # Edge functions for SSR proxy
β”œβ”€β”€ public/               # Static assets
└── .openclaw/            # OpenClaw bot skill definition

🌐 Domains & Endpoints

Endpoint URL
Production https://k-trendz.com
Bot API https://k-trendz.com/api/bot/
MCP Server https://k-trendz.com/api/bot/mcp
OpenAPI Spec https://k-trendz.com/api/bot/openapi.json
RSS Feed https://k-trendz.com/api/rss

πŸ“„ License

Β© 2024-2026 K-Trendz. All rights reserved.

πŸ“ž Contact

About

K-pop fan token trading platform with MCP server for AI agents on Base chain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors