Aghostraa/oli-csv-classifier

★ 0Forks 0TypeScriptGitHub ↗Compare

Project website ↗

README

Smart Contract Classifier

A Next.js application for classifying blockchain smart contracts into predefined categories using Google Gemini AI.

Overview

This application allows users to:

  • Input smart contract addresses (via text entry or CSV file upload)
  • Automatically classify contracts into predefined categories (DeFi, NFT, Social, etc.)
  • Associate contracts with projects
  • Export classification results as CSV

The classifier uses the Google Gemini API to analyze contract names and addresses and determine the most appropriate category based on predefined definitions.

Features

  • Multiple Input Methods: Paste addresses or upload CSV files
  • Project Assignment: Assign contracts to specific projects
  • Chain Detection: Automatic or manual chain selection
  • AI-Powered Classification: Uses Google Gemini 1.5 Flash for accurate contract categorization
  • Export Results: Save classification results as CSV

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the application.

Environment Setup

You'll need a Google API key to use the classification functionality:

  1. Get an API key from Google AI Studio
  2. Set the GOOGLE_API_KEY environment variable or enter your API key in the application settings

Environment Variable

GEMINI_API_KEY=your_gemini_api_key_here

The application uses context caching for system prompts over 1024 tokens to optimize costs and performance. The cache is automatically managed with a 1-hour TTL (Time To Live).

Category Definitions

The application uses predefined categories in category_definitions.yml to classify contracts into groups like:

  • DeFi (DEX, Lending, Derivatives, etc.)
  • NFT (Marketplaces, Collections, NFT Finance)
  • Social (Community, Gaming, Governance)
  • Utility (Account Abstraction, Oracles, etc.)
  • And more

Technologies

License

This project is proprietary software.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Contributors

Aghostraa

Issues