Skip to content

LuminDev/casper-agentic-buildathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Casper Yield Sentinel

Autonomous AI Yield Optimization Agent for Casper Network

Built for the Casper Agentic Buildathon 2026 — $150,000 prize pool.

What It Does

Casper Yield Sentinel is an autonomous AI agent that:

  1. Monitors Casper DeFi yield opportunities via CSPR.trade MCP
  2. Analyzes risk using an LLM-based scoring model
  3. Executes optimized yield strategies on-chain via a YieldVault smart contract
  4. Pays for premium data feeds using x402 micropayments

Architecture

┌─────────────────────────────────────────────────────────┐
│                   Yield Sentinel Agent                   │
│                                                         │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────┐ │
│  │ Monitor  │→ │  Risk    │→ │ Executor │→ │  x402   │ │
│  │ (yields) │  │ Analyzer │  │ (txns)   │  │ Client  │ │
│  └────┬─────┘  └──────────┘  └────┬─────┘  └────┬────┘ │
│       │                           │              │      │
└───────┼───────────────────────────┼──────────────┼──────┘
        │                           │              │
        ▼                           ▼              ▼
┌───────────────┐   ┌───────────────────────┐   ┌──────────────┐
│ CSPR.trade    │   │  Casper Testnet        │   │ x402         │
│ MCP Server    │   │  ┌─────────────────┐   │   │ Facilitator  │
│ (yield data)  │   │  │  YieldVault     │   │   │ (payments)   │
└───────────────┘   │  │  (Odra/Rust)    │   │   └──────────────┘
                    │  └─────────────────┘   │
                    │  • deposit()           │
                    │  • withdraw()          │
                    │  • execute_strategy()  │
                    │  • StrategyExecuted    │
                    └───────────────────────┘

Project Structure

casper-agentic-buildathon/
├── contract/              # Odra smart contract (Rust/WASM)
│   ├── Cargo.toml
│   └── src/
│       └── yield_vault.rs
├── agent/                 # AI agent (Python)
│   ├── __init__.py
│   ├── config.py          # Environment configuration
│   ├── monitor.py         # Yield data polling
│   ├── risk.py            # LLM risk analysis
│   ├── executor.py        # Transaction execution
│   ├── main.py            # Orchestrator loop
│   └── x402_client.py     # x402 micropayments
├── requirements.txt
├── DESIGN.md
└── README.md

Setup

Prerequisites

  • Python 3.9+
  • Rust (for Odra contract compilation)
  • Casper Testnet account with CSPR
  • Deployed YieldVault contract

Installation

# Clone the repo
git clone https://github.com/LuminDev/casper-agentic-buildathon.git
cd casper-agentic-buildathon

# Install Python deps
pip install -r requirements.txt

Configuration

Set environment variables (or create a .env file):

export CASPER_RPC_URL="https://rpc.testnet.casper.network"
export CONTRACT_HASH="<your-deployed-contract-hash>"
export AGENT_PRIVATE_KEY="<ed25519-private-key-hex>"
export AGENT_PUBLIC_KEY="<ed25519-public-key-hex>"
export RISK_THRESHOLD=40           # minimum risk score to act
export POLL_INTERVAL=300           # seconds between checks
export X402_FACILITATOR_URL="https://x402-facilitator.testnet.casper.network"

Deploy the Contract

cd contract

# Build the Odra contract
cargo build --release --target wasm32-unknown-unknown

# Deploy to Casper Testnet (using casper-client)
casper-client put-deploy \
  --chain-name casper-test \
  --session-path target/wasm32-unknown-unknown/release/yield_vault.wasm \
  --payment-amount 5000000000 \
  --secret-key /path/to/secret_key.pem

# Set CONTRACT_HASH from deploy output

Run the Agent

python -m agent.main

The agent will:

  • Poll yield data every POLL_INTERVAL seconds
  • Analyze risk and produce an allocation plan
  • Execute strategies by calling YieldVault on-chain
  • Pay for premium data via x402

Demo Instructions

  1. Deploy the YieldVault contract on Casper Testnet
  2. Fund the agent account with test CSPR
  3. Start the agent: python -m agent.main
  4. Observe the orchestrator loop:
    • Monitor phase logs current yields
    • Risk analysis shows scored opportunities
    • Execution phase produces StrategyExecuted events on-chain
    • x402 payments for premium data
  5. Verify on-chain: check Casper Testnet explorer for transactions

Hackathon Info

  • Event: Casper Agentic Buildathon 2026 — Qualification Round
  • Deadline: June 30, 2026
  • Prize Pool: $150,000 USD
  • Focus: Agentic AI + DeFi + RWA on Casper Network
  • Requirements: Working prototype on Testnet, open-source repo, demo video

Tech Stack

Component Technology
Smart Contract Odra Framework (Rust/WASM)
Agent Core Python 3.9+
Blockchain Casper Network (Testnet)
Payments x402 Protocol (CEP-18)
AI/ML LLM-based risk scoring
Data CSPR.trade MCP, Casper MCP Server

Built by LuminDev for the Casper Agentic Buildathon 2026

About

Casper Agentic Buildathon 2026 — Agentic AI + DeFi + RWA on Casper Network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors