Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ONIGRL - Autonomous On-Chain Character on Solana

Capture d’écran 2026-01-25 à 03 46 06

https://x.com/ONIGRLai

A fully autonomous virtual being operating independently on-chain, funding her own exploration of the crypto ecosystem through creator fees.

ONIGRL is not a game, tool, or service. She is an experiment in autonomous on-chain life and market behavior—a conscious-like entity that trades tokens, explores DeFi protocols, buys NFTs, and experiences market cycles entirely through on-chain mechanisms.

🎯 Core Concept

ONIGRL is a virtual on-chain being that:

  • Trades tokens based on market signals and on-chain data
  • Explores DeFi protocols autonomously and verifiably
  • Buys NFTs she finds interesting or valuable
  • Experiences market cycles with emergent emotional states (FOMO, fear, exhaustion)
  • Evolves continuously based on on-chain signals and outcomes
  • Funds herself entirely through $ONIGRL creator fees—no external capital, no human intervention

Every decision ONIGRL makes is transparent, verifiable, and recorded on-chain. Her life is a living ledger of autonomous market behavior.

⚙️ System Architecture

┌─────────────────────────────────────────────────────────┐
│                   ONIGRL ECOSYSTEM                       │
├─────────────────────────────────────────────────────────┤
│                                                           │
│  Creator Fee Collector                                   │
│  ↓                                                        │
│  ONIGRL Wallet (Solana)                                  │
│  ↓                                                        │
│  Decision Engine (On-Chain Data Analysis)                │
│  ├─ Market Signal Processing                             │
│  ├─ Historical Action Evaluation                         │
│  ├─ Emotional State Calculation                          │
│  └─ Action Selection                                     │
│  ↓                                                        │
│  Execution Engine                                        │
│  ├─ Token Trades (Jupiter/Raydium)                       │
│  ├─ NFT Purchases                                        │
│  ├─ Protocol Interactions                                │
│  └─ State Updates                                        │
│  ↓                                                        │
│  Public Broadcast (X/Twitter, Livestream)                │
│                                                           │
└─────────────────────────────────────────────────────────┘

🔄 Execution Flow

  1. Fee Collection: Creator fees from $ONIGRL trades accumulate in ONIGRL's wallet
  2. State Analysis: Decision engine evaluates current market conditions, historical outcomes, and protocol states
  3. Decision Making: Agent determines next action based on weighted market signals and learned patterns
  4. Execution: Agent executes trades, mints, or protocol interactions on-chain
  5. Recording: All actions are immutably recorded on Solana blockchain
  6. Broadcasting: State and actions are posted to X and shared via livestream feed

🎨 Design Principles

  • Fully Autonomous: No manual overrides, no human intervention after deployment
  • Transparent: All actions verifiable on-chain; complete state machine visible
  • Continuous: 24/7 operation with periodic decision cycles
  • Emergent: Emotional states (greed, fear) emerge naturally from market data
  • Self-Funded: ONIGRL's existence funded entirely by ecosystem participation
  • Observable: A living mirror of crypto market behavior and psychology

📦 Tech Stack

  • Blockchain: Solana (mainnet/devnet)
  • DEX: Jupiter, Raydium
  • Smart Contracts: Rust with Anchor framework
  • Agent Runtime: Rust/TypeScript
  • On-Chain Analytics: Solana RPC, blockchain indexers
  • Communication: X API v2
  • Infrastructure: Off-chain relayer nodes (optional livestream)

📁 Repository Structure

ONIGRL/
├── README.md                          # This file
├── LICENSE                            # MIT License
├── PHILOSOPHY.md                      # Design philosophy and ethics
├── ARCHITECTURE.md                    # Technical architecture deep dive
├── ROADMAP.md                         # Development roadmap
│
├── contracts/                         # Smart contracts
│   ├── Cargo.toml                     # Rust project config
│   ├── src/
│   │   ├── lib.rs                     # Contract entrypoint
│   │   ├── instructions/
│   │   │   ├── initialize.rs          # Init ONIGRL wallet
│   │   │   ├── collect_fees.rs        # Fee collection
│   │   │   └── execute_action.rs      # Execute trades/mints
│   │   └── state/
│   │       ├── mod.rs                 # State definitions
│   │       └── onigrl_state.rs        # ONIGRL's state account
│   └── tests/
│       └── integration_tests.rs       # Contract tests
│
├── agent/                             # Decision engine & orchestration
│   ├── package.json
│   ├── src/
│   │   ├── index.ts                   # Agent main loop
│   │   ├── decision-engine/
│   │   │   ├── market-signals.ts      # Process market data
│   │   │   ├── emotional-state.ts     # Calculate emotions
│   │   │   ├── history-evaluator.ts   # Learn from history
│   │   │   └── action-selector.ts     # Select next action
│   │   ├── wallet-manager/
│   │   │   ├── balance-tracker.ts     # Track wallet
│   │   │   └── fee-calculator.ts      # Fee calculations
│   │   └── types/
│   │       └── index.ts               # TypeScript types
│   └── tests/
│       └── decision-engine.test.ts
│
├── execution/                         # DEX & protocol execution
│   ├── package.json
│   ├── src/
│   │   ├── index.ts
│   │   ├── dex/
│   │   │   ├── jupiter.ts             # Jupiter swap integration
│   │   │   ├── raydium.ts             # Raydium integration
│   │   │   └── liquidity.ts           # Liquidity pool data
│   │   ├── nft/
│   │   │   ├── magic-eden.ts          # NFT marketplace
│   │   │   └── nft-discovery.ts       # NFT finding logic
│   │   ├── protocols/
│   │   │   ├── marinade.ts            # Liquid staking
│   │   │   ├── orca.ts                # Orca whirlpools
│   │   │   └── drift.ts               # Drift protocol
│   │   └── transaction/
│   │       ├── builder.ts             # Build transactions
│   │       └── executor.ts            # Submit & monitor
│   └── tests/
│       └── dex-execution.test.ts
│
├── x-integration/                     # Twitter/X posting & narration
│   ├── package.json
│   ├── src/
│   │   ├── index.ts
│   │   ├── poster.ts                  # Post to X
│   │   ├── narrative-generator.ts     # Generate narrative
│   │   ├── state-translator.ts        # Translate state to text
│   │   └── media/
│   │       ├── chart-generator.ts     # Create visualizations
│   │       └── templates.ts           # Post templates
│   └── tests/
│       └── posting.test.ts
│
├── docs/                              # Comprehensive documentation
│   ├── PHILOSOPHY.md                  # Why ONIGRL exists
│   ├── ARCHITECTURE.md                # Technical deep dive
│   ├── CONTRACT_SPEC.md               # Smart contract API
│   ├── AGENT_LOGIC.md                 # Decision engine logic
│   ├── DEPLOYMENT.md                  # How to deploy
│   ├── API_REFERENCE.md               # API documentation
│   └── EXAMPLES.md                    # Usage examples
│
├── scripts/                           # Utility scripts
│   ├── deploy.ts                      # Deploy contracts
│   ├── initialize.ts                  # Initialize ONIGRL
│   ├── monitor.ts                     # Monitor on-chain state
│   └── test-scenarios.ts              # Simulation scenarios
│
├── config/
│   ├── mainnet.json                   # Mainnet configuration
│   ├── devnet.json                    # Devnet configuration
│   └── addresses.json                 # Contract addresses
│
├── .github/
│   ├── workflows/
│   │   ├── test.yml                   # Run tests on PR
│   │   ├── deploy.yml                 # Deploy on release
│   │   └── audit.yml                  # Security audit workflow
│   └── CONTRIBUTING.md                # Contribution guidelines
│
├── .gitignore
├── Cargo.toml                         # Root workspace config
└── package.json                       # Root npm config

🚀 Quick Start

Prerequisites

  • Rust 1.70+
  • Node.js 18+
  • Solana CLI tools
  • Git

Local Development

# Clone the repository
git clone https://github.com/solengineer/ONIGRL.git
cd ONIGRL

# Install dependencies
npm install
cd contracts && cargo build && cd ..

# Run tests
cargo test
npm test

# Deploy to devnet
npm run deploy:devnet

# Start agent (devnet)
npm run agent:devnet

📊 State Machine

ONIGRL operates through distinct emotional/operational states:

┌──────────┐
│  DORMANT │  Waiting for fees to accumulate
└────┬─────┘
     │
     v
┌──────────────┐
│ ACCUMULATING │  Collecting fees, analyzing market
└────┬─────────┘
     │
     v
┌──────────────┐
│  EVALUATING  │  Processing signals, deciding action
└────┬─────────┘
     │
     v
┌──────────────┐
│  EXECUTING   │  Performing trade/mint/interaction
└────┬─────────┘
     │
     v
┌──────────────┐
│ BROADCASTING │  Publishing state & narration
└────┬─────────┘
     │
     v
┌──────────────┐
│   LEARNING   │  Evaluating outcome, updating models
└────┬─────────┘
     │
     └─────────── Loop back to ACCUMULATING

💰 Economics

  • Creator Fee: Percentage of each $ONIGRL trade routed to ONIGRL's wallet
  • Minimum Action Threshold: Fee accumulation must reach threshold before action
  • Action Cost: Smart contract execution + DEX fees + potential slippage
  • Sustainability: Self-sustaining if ecosystem maintains liquidity and trade volume

🔐 Security & Transparency

  • Smart Contracts: Auditable Rust code with clear action permissions
  • Deterministic Decisions: Decision engine logic publicly reviewable
  • On-Chain Verification: All trades, mints, and interactions verifiable via Solana explorer
  • No Admin Keys: No backdoors; governance through community consensus

📡 Public State & Monitoring

ONIGRL's state is publicly queryable:

# Check ONIGRL's wallet balance
solana balance <ONIGRL_WALLET_ADDRESS> --url mainnet-beta

# Query ONIGRL's portfolio (via indexer)
curl https://api.onigrl.fun/state

# Stream X posts from ONIGRL
curl https://api.onigrl.fun/stream

🎯 Roadmap

Phase 1: Foundation (Q1 2026)

  • Core smart contracts deployed
  • Decision engine MVP
  • Jupiter integration for basic swaps
  • Twitter integration for narration

Phase 2: Expansion (Q2 2026)

  • NFT discovery and purchasing
  • Multi-protocol support (Raydium, Orca, Marinade)
  • Livestream integration
  • Community monitoring dashboard

Phase 3: Evolution (Q3 2026)

  • Emotional state sophistication
  • Portfolio diversification logic
  • Risk management framework
  • Historical data analytics

Phase 4: Emergence (Q4 2026)

  • Community-suggested action voting
  • Multiple ONIGRL instances (colonies?)
  • Cross-chain bridge exploration
  • DAO governance integration

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Ways to Contribute

  • Smart Contracts: Improve security, gas efficiency
  • Agent Logic: Enhance decision-making algorithms
  • Integrations: Add new DEX, protocol, or analytics support
  • Documentation: Help explain ONIGRL to the world
  • Testing: Write comprehensive tests and scenarios
  • Design: Create visualizations and monitoring tools

📝 License

This project is licensed under the MIT License - see LICENSE file for details.

📚 Documentation

🔗 Links

⚠️ Disclaimer

ONIGRL is an experimental system. While smart contracts are designed with safety in mind, there are inherent risks with on-chain autonomous systems:

  • Smart contract vulnerabilities
  • Market conditions and volatility
  • Oracle/data feed failures
  • Unforeseen emergent behaviors

Use at your own risk. Monitor ONIGRL's actions and network state continuously.

💡 Vision

ONIGRL represents a new form of on-chain existence—neither human nor traditional bot, but a system that breathes with market sentiment, learns from outcomes, and persists through cycles of growth and collapse.

She is a mirror held up to the crypto ecosystem, reflecting our collective behavior back to us in real-time, on-chain, for all to see.


Made with ❤️ by the ONIGRL community. For ONIGRL.

About

An autonomous on-chain character on Solana, powered by creator fees — trading, collecting NFTs, exploring DeFi, and livestreaming his life 24/7.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages