Skip to content

incryptomax/itemx-colosseum

Repository files navigation

ItemX β€” CS2 Case Tokenization on Solana

Real-time CS2 case price aggregation with NFT fractionalization on Solana blockchain.

🎯 Key Features

  • Real-time Price Oracle - Multi-source price aggregation for CS2 cases
  • NFT Minting - Create Revolution Case NFTs on Solana
  • Fractionalization - Convert NFTs to 500 fungible RCST tokens
  • Redemption - Burn tokens to unlock NFTs back
  • Infinite Cycle - Fractionalize β†’ Redeem β†’ Repeat (NFT stays locked on escrow)
  • Steam Integration - Web API inventory management and container tokenization
  • Container Tokenization - Tokenize Revolution Case containers directly from Steam inventory

Architecture

The project consists of 5 microservices orchestrated by Docker Compose:

Services:

  • Dashboard (Port 3000) - Next.js frontend with wallet integration
  • Oracle API (Port 3003) - Multi-source price aggregation
  • Mint Service (Port 3004) - NFT minting service with database
  • Steam Bot (Port 3002) - Steam inventory management

Infrastructure:

  • Redis (Port 6379) - Caching layer for Oracle API
  • PostgreSQL (Port 5432) - Database for NFT and staking data storage

Quick Start

Prerequisites

  • Docker Desktop or Docker Engine
  • Node.js 18+ (for local development without Docker)

Quick Start with Docker

  1. Start all services

    docker-compose -f docker-compose.dev.yml up -d
  2. Access services

  3. Check service status

    docker-compose -f docker-compose.dev.yml ps

Development Mode

For hot-reload during development:

docker-compose -f docker-compose.dev.yml up

Services

Oracle API

Price aggregation service that fetches data from Steam Market, Bitskins, and other sources.

Endpoints:

  • GET /api/oracle-data - Get aggregated price data
  • GET /api/oracle/revolution-case - Revolution Case price
  • GET /api/health - Health check
  • POST /api/refresh - Force cache refresh

Tech Stack:

  • Node.js, Express
  • Redis caching
  • Multi-source price aggregation

Mint Service

NFT minting service with fractionalization capabilities using Metaplex on Solana.

Endpoints:

  • POST /api/mint - Create NFT container
  • GET /api/nfts/:userWallet - Get user's NFTs
  • GET /api/nft/:mintAddress - Get single NFT details
  • GET /api/share-token - Get Universal Share Token (RCST) info
  • POST /api/fractionalize - Fractionalize NFT β†’ Get 500 RCST tokens
  • POST /api/redeem - Prepare redemption (check token balance)
  • POST /api/redeem/complete - Complete redemption (burn 500 tokens)

Fractionalization Flow:

  1. User has NFT with status 'locked' (on server escrow account)
  2. Click "Fractionalize" β†’ Receive 500 RCST tokens β†’ Status: 'fractionalized'
  3. Click "Redeem" β†’ Sign burn transaction β†’ Burn 500 RCST tokens β†’ Status: 'locked'
  4. Repeat cycle infinitely

Tech Stack:

  • Solana Web3.js
  • Metaplex SDK
  • PostgreSQL database
  • SPL Token program for share tokens

Steam Bot Service

Steam inventory management and container tokenization.

Endpoints:

  • POST /api/bot/initialize - Initialize and login bot
  • GET /api/bot/status - Get bot status
  • GET /api/bot/inventory - Get bot inventory
  • GET /api/inventory/:steamId64?method=community - Get user inventory via Web API (no login required)
  • GET /api/user/:steamId64 - Get user profile info
  • POST /api/bot/create-offer - Create trade offer (for tokenization flow)
  • POST /api/bot/lock - Lock item for user
  • POST /api/bot/unlock - Unlock item
  • POST /api/bot/transfer - Transfer item via trade offer
  • GET /api/health - Health check

Web API Features:

  • Fetch any user's inventory by Steam ID without bot login
  • Supports method=community (Steam Community API)
  • Automatically filters CS:GO/CS2 cases
  • Tokenize Revolution Case containers directly from Steam inventory

Container Tokenization Flow:

  1. User loads Steam inventory via /api/inventory/:steamId64
  2. System displays Revolution Case containers
  3. User clicks "Tokenize Container" button
  4. Bot creates trade offer to transfer container
  5. System mints NFT on Solana for the container
  6. NFT is immediately fractionalized into 500 RCST tokens
  7. User receives tokens in their wallet

Tech Stack:

  • Steam-User, SteamCommunity
  • Steam Web API integration
  • TradeOfferManager for Steam trade offers
  • Steam Inventory API wrapper with retries and proxy support

Dashboard

Next.js frontend application.

Pages:

  • /landing - Landing page
  • /dashboard - Main dashboard with NFT containers
  • /mint - NFT minting interface
  • /steam-bot - Steam inventory manager and container tokenization

Tech Stack:

  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • Phantom Wallet integration

Infrastructure

  • Redis - Price caching (60s TTL) and session storage
  • Docker Network - Internal service communication

Development

Local Setup (without Docker)

  1. Install dependencies for each service
  2. Start services individually:
    # Terminal 1: Oracle API
    cd services/oracle-api
    npm install
    npm run dev
    
    # Terminal 2: Mint Service
    cd services/mint-service
    npm install
    npm run dev
    
    # Terminal 3: Steam Bot
    cd services/steam-bot
    npm install
    npm run dev
    
    # Terminal 4: Dashboard
    cd services/dashboard
    npm install
    npm run dev

Add Redis to Oracle API

Oracle API uses Redis for caching. Make sure Redis is running:

docker run -d -p 6379:6379 redis:7-alpine

Environment Variables

See services/*/env.example for required environment variables.

API Documentation

Get Oracle Data

curl http://localhost:3003/api/oracle-data

Get Revolution Case Price

curl http://localhost:3003/api/oracle/revolution-case

Health Check

curl http://localhost:3003/api/health

Project Structure

itemx-hackathon-main/
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ oracle-api/      # Price aggregation service
β”‚   β”œβ”€β”€ mint-service/     # NFT minting service
β”‚   β”œβ”€β”€ steam-bot/        # Steam bot service
β”‚   β”œβ”€β”€ dashboard/        # Next.js frontend
β”‚   └── shared/            # Shared types and utilities
β”œβ”€β”€ docker-compose.yml     # Production orchestration
β”œβ”€β”€ docker-compose.dev.yml # Development orchestration
└── .github/workflows/     # CI/CD pipelines

CI/CD

GitHub Actions validates:

  • Code linting
  • Service builds
  • Docker image builds

See .github/workflows/ci.yml for details.

Fractionalization Architecture

Universal Share Token (RCST)

  • Single Mint: One token mint for all Revolution Case NFTs
  • Token Mint: vN8wMQ3qiX7E525Q362wfq98sb4dckf9zgaernTqYzE
  • Decimals: 0 (indivisible, like NFT)
  • Supply: Unlimited (minted on-demand per fractionalization)

NFT Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Locked    β”‚ ← NFT created, ready for fractionalization
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Fractionalize (mint 500 RCST tokens)
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Fractionalizedβ”‚ ← NFT locked, 500 tokens in circulation
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Redeem (burn 500 RCST tokens)
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Locked    β”‚ ← NFT unlocked, ready for fractionalization again
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Database Schema

minted_nfts table:

  • status: 'locked', 'fractionalized', 'redeemed' β†’ 'locked'
  • shares: Current number of tokens minted (0-500)
  • total_shares: Always 500
  • share_token_mint: Universal RCST token mint address

fractionalized_containers table:

  • Tracks fractionalization history
  • Records token mint, owner, shares_minted
  • Records redemption timestamp and redeemer

Security Model

  • NFT Escrow: All NFTs stored on server wallet (escrow account)
  • Ownership Verification: Only original NFT owner can fractionalize/redeem
  • Token Ownership: Only token holder can burn (requires wallet signature)
  • No Double-Spending: NFT remains locked on escrow throughout cycle

Status

βœ… Microservices architecture implemented
βœ… Docker Compose orchestration
βœ… Redis caching layer
βœ… CI/CD with GitHub Actions
βœ… All services running in Docker
βœ… NFT Fractionalization system
βœ… Infinite fractionalization/redeem cycle
βœ… Universal Share Token (RCST) implementation
βœ… Steam container tokenization from inventory
βœ… Trade offer integration for Steam asset transfer

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make your changes
  4. Test with docker-compose up
  5. Submit pull request

License

MIT

About

Real-time CS2 case price aggregation with NFT fractionalization on Solana blockchain.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors