This repository contains a multi-program Solana ecosystem in Rust, architected for **AI-driven tokenomics**. For a complete, machine-readable architecture, see `manifest.json`.
Project documentation and guides
Files in programs/affiliate-program/
Files in programs/barter-dex-program/
Files in programs/factory-program/
This repository contains a multi-program Solana ecosystem in Rust, architected for AI-driven tokenomics. For a complete, machine-readable architecture, see manifest.json.
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.
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.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
~/.api-openrouter and place your OpenRouter API key inside it.anchor buildcargo test-bpf -- --nocaptureView the full repository on GitHub