solana-launchpad-ecosystem

This repository contains a multi-program Solana ecosystem in Rust, architected for **AI-driven tokenomics**. For a complete, machine-readable architecture, see `manifest.json`.

Documentation (2)

Project documentation and guides

Programs/Affiliate Program (1)

Files in programs/affiliate-program/

Programs/Barter Dex Program (1)

Files in programs/barter-dex-program/

Programs/Factory Program (1)

Files in programs/factory-program/

Project Overview

Solana Launchpad Ecosystem (Rust) - AI Edition

This repository contains a multi-program Solana ecosystem in Rust, architected for AI-driven tokenomics. For a complete, machine-readable architecture, see manifest.json.

System Overview

This project demonstrates a hybrid blockchain architecture. Deterministic on-chain programs handle asset management, while off-chain bots use the OpenRouter API to make intelligent economic decisions.

  • ICO Factory: A standard bonding curve launchpad.
  • Affiliate System: An on-chain program whose commission rates are dynamically set by an AI bot.
  • Barter DEX: An oracle-based DEX that uses AI-generated prices for swaps, instead of a traditional AMM formula.

Repository Structure and Component Documentation

  • manifest.json: Primary source of truth for the system architecture.
  • programs/factory-program: The core ICO launchpad. (See README)
  • programs/affiliate-program: Manages affiliate data, controlled by AI. (See README)
  • programs/barter-dex-program: The AI-powered oracle DEX. (See README)
  • bots/optimizer-bot: Off-chain bot to set affiliate commissions via AI.
  • bots/price-keeper-bot: Off-chain bot that acts as a price oracle for the DEX.
  • crates/genesis-common: Shared library of constants.
  • tests/integration.rs: End-to-end tests.

AI-Hybrid Interaction Diagram

graph TD
    subgraph "Off-Chain (AI Decision-Making)"
        OpenRouterAPI[OpenRouter API]
        OptimizerBot[Optimizer Bot]
        PriceKeeperBot[Price Keeper Bot]

        OptimizerBot --(HTTP POST with on-chain data)--> OpenRouterAPI
        OpenRouterAPI --(JSON response with new rate)--> OptimizerBot

        PriceKeeperBot --(HTTP POST with token info)--> OpenRouterAPI
        OpenRouterAPI --(JSON response with price)--> PriceKeeperBot
    end

    subgraph "On-Chain (Solana)"
        AffiliateProgram[Affiliate Program]
        BarterDEX[Barter DEX Program]
        FactoryProgram[Factory Program]

        User --(Buys Tokens)--> FactoryProgram
        User --(Swaps Tokens at AI Price)--> BarterDEX
    end

    OptimizerBot --(TX: set_commission_rate)--> AffiliateProgram
    PriceKeeperBot --(TX: update_oracle_price)--> BarterDEX

Setup and Execution

  1. Prerequisites: Install Rust, Solana CLI, Anchor Framework (v0.28.0).
  2. API Key: Create a file at ~/.api-openrouter and place your OpenRouter API key inside it.
  3. Build: anchor build
  4. Test: cargo test-bpf -- --nocapture

Source Code

View the full repository on GitHub