Skip to content

nsvoud-dev/re-protocol-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Re Protocol — On-chain TVL Analyzer

A lightweight TypeScript tool for real-time tracking of Total Value Locked (TVL) across Re Protocol treasuries and custodial wallets.
It enables full on-chain transparency by fetching real balances and converting them to USD using Chainlink price feeds for Ethereum and Base.


⚙️ Features

✅ Fetches live balances from Re Protocol treasury wallets
✅ Calculates TVL in USD directly from blockchain data
✅ Supports both Ethereum and Base networks
✅ Integrates Chainlink price feeds (ETH, USDC, DAI, USDT)
✅ CLI-based usage for analytics and automation
✅ Displays per-token and per-treasury breakdown


🧩 CLI Commands

Command Description
npm run build Compile TypeScript to JavaScript
node dist/cli.js tvl Show total TVL (USD)
node dist/cli.js tvl --verbose Detailed per-token and per-treasury breakdown
node dist/cli.js balance <token> <address> Manually check ERC‑20 balance
node dist/cli.js claims Placeholder for future subgraph/indexer integration

🧠 Example Output

RPC = https://eth.llamarpc.com
CHAIN flag = ethereum
symbol  balance           usd     treasury
------  ----------------  ------  ------------------------------------------
ETH     0.0140            54.22   0x295F67Fdb21255A3Db82964445628a706FBe689E
USDC    327599.9999       327600  0x295F67Fdb21255A3Db82964445628a706FBe689E
USDT    25276.0000        25276   0x295F67Fdb21255A3Db82964445628a706FBe689E
Total Value Locked: 353,661.14 USD

🔧 Environment Setup

Create a .env file:

CHAIN=ethereum           # or base
ETH_RPC_URL=https://eth.llamarpc.com
BASE_RPC_URL=https://base.llamarpc.com
LOG_LEVEL=info

⚠️ Never upload the real .env file to GitHub.
Use .env.example instead:

# Example
CHAIN=ethereum
ETH_RPC_URL=https://eth.llamarpc.com
BASE_RPC_URL=https://base.llamarpc.com

📁 Project Structure

src/
 ├─ cli.ts         → CLI logic and routing
 ├─ index.ts       → Core TVL logic, Chainlink pricing, balance readers
 ├─ providers.ts   → RPC and network switch (Ethereum/Base)
 └─ config.ts      → Environment variable loader

.env.example
package.json
tsconfig.json
README.md

🪙 Why It Matters

This module enhances transparency and trust within the Re Protocol ecosystem:

  • Enables anyone to verify on-chain reserves in real time
  • Helps auditors and DAO members monitor treasury health
  • Can feed dashboards, bots, or public transparency reports

A practical step toward decentralized accountability — anyone can run it locally and verify Re’s TVL.


💬 Author & Contribution

Author: nsvoud Twitter: @0xNSVOUD
Project: Re Protocol — re.xyz
Date: October 2025
License: MIT


🧷 Links


“Transparency is the foundation of trust — and trust is the foundation of Re.”

About

re-protocol-tools

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published