Skip to content

anmol0b/Harvester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌾 Harvester — Permissionless RWA Yield Protocol on Solana

Register any tokenized asset • Accrue yield every second • Claim on-chain with one click.

Live Demo: https://harvester-beta.vercel.app
Program ID (Devnet): AujdsDt1vs3RZ497KhoPxzKeRFghdEbjNKVqYSypEP1W


What is Harvester?

Harvester is a permissionless, non-custodial yield protocol for tokenized real-world assets built on Solana. Users register any SPL token as an RWA position and earn HRVST tokens as yield — calculated every second, claimable on-chain at any time.

The program is written in Pinocchio — a zero-dependency Solana program framework with no Anchor overhead, minimal binary size, and direct account access. No macros, no bloat.


Key Features

  • Permissionless — Register any SPL token mint as an RWA position
  • Zero-dependency program — Built with Pinocchio, not Anchor
  • Three yield tiers — Retail, Institutional, Wholesale unlock automatically by deposit size
  • MagicBlock Ephemeral Rollup readydelegate_position, tick_yield, and commit_and_undelegate instructions implemented for real-time ER yield accrual
  • Non-custodial — Tokens never leave your wallet
  • Full-stack — Custom indexer, Supabase DB, Next.js frontend, live on devnet

Yield Tiers

Tier Threshold Bonus
Retail < 1M tokens +0 bps
Institutional ≥ 1M tokens +20 bps
Wholesale ≥ 10M tokens +50 bps

Base rate: 5% APY (500 bps, set at initialization)


MagicBlock Ephemeral Rollup Integration

Harvester implements the full MagicBlock ER lifecycle for yield positions:

Instruction Description
delegate_position Delegates a UserPosition PDA to the ER via DLP CPI
tick_yield Called by the ER runtime to accumulate yield into accrued_yield
commit_and_undelegate Commits ER state back to L1, clears delegation flag

Once a position is delegated, tick_yield runs on the ER at high frequency — eliminating L1 transaction costs for yield accrual. When the user is ready to claim, commit_and_undelegate settles the accumulated yield to L1, then claim_yield mints HRVST tokens.

Tests: Full ER lifecycle tested with LiteSVM — tick accumulation, delegation guards, claim-after-commit flow. DLP-dependent tests marked #[ignore] and run on devnet.


Architecture

Architecture

graph LR
    A[Next.js 15 Frontend<br/>Vercel]
    B[Pinocchio Program<br/>Solana Devnet]
    C[MagicBlock ER Layer<br/>delegate • tick • commit]
    D[TypeScript Indexer<br/>Render]
    E[Supabase PostgreSQL]

    A -->|Transactions| B
    B -->|Delegates execution| C
    C -->|Commits state| B

    B -->|Program logs & events| D
    D -->|Store indexed data| E

    E -->|Portfolio & analytics| A
Loading

Tech Stack

Layer Technology Notes
Program Pinocchio (Rust) Zero-dependency, no Anchor
ER Integration MagicBlock Ephemeral Rollup delegate / tick / commit
Tests LiteSVM Full lifecycle unit tests
Frontend Next.js 15, TypeScript, Tailwind Wallet adapter, SWR
Wallets Phantom, Solflare Solana Wallet Adapter
Indexer Node.js, TypeScript, Express Poll mode, event parsing
Database Supabase (PostgreSQL) Positions, claims, leaderboard
Deployment Vercel + Render + Supabase Fully hosted

Program Instructions

Instruction Description
initialize(yield_rate_bps) Creates GlobalConfig PDA, initializes HRVST mint
register_position(mint, amount) Creates UserPosition PDA
claim_yield() Mints accrued HRVST to user ATA
close_position() Closes position, refunds rent
update_config(rate, paused) Admin-only config update
delegate_position Delegates position to MagicBlock ER
tick_yield ER runtime yield accumulation tick
commit_and_undelegate Commits ER state back to L1

Local Setup

Prerequisites

  • Node.js 20+, Bun, Rust, Solana CLI, Supabase account

1. Clone

git clone https://github.com/anmol0b/Harvester.git
cd Harvester

2. Build & Deploy Program

cd program
cargo build-sbf
solana program deploy target/deploy/program.so --url devnet

3. Run Tests

cargo test                    # unit tests
cargo test -- --ignored       # ER tests (needs DLP binary or devnet)

4. Indexer

cd ../indexer
npm install
cp .env.example .env
# Fill DATABASE_URL, RPC_HTTP, PROGRAM_ID
npm run dev

5. Frontend

cd ../frontend
bun install
cp .env.local.example .env.local
# Fill NEXT_PUBLIC_RPC_URL, NEXT_PUBLIC_INDEXER_URL, NEXT_PUBLIC_PROGRAM_ID
bun run dev

Environment Variables

Indexer .env Frontend .env.local

API Endpoints

Endpoint Description
GET /health Health check
GET /portfolio/:wallet Positions + TVL
GET /history/:wallet Paginated claim history
GET /yields/top Leaderboard
GET /stats Protocol-wide stats

Development Status

  • ✅ Pinocchio program deployed on devnet
  • ✅ MagicBlock ER implemented
  • ✅ LiteSVM tests passing
  • ✅ Frontend live on Vercel
  • ✅ Indexer live on Render
  • ✅ Supabase DB operational
  • 🔄 Rust indexer with Yellowstone gRPC (post-submission)

Roadmap

  • Rust indexer with Yellowstone gRPC streaming
  • Pyth oracle for dynamic yield rates
  • Mainnet deployment
  • Governance for yield rate updates

Built For

Solana India Fellowship — Capstone 2026

Author: Anmol Bhardwaj

About

Permissionless RWA yield claimer on Solana — register tokenized asset positions and claim accrued yield on-chain.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors