Skip to content

manueldezman/trovepilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrovePilot

Live demo: https://trovepilot-web-vo95.vercel.app/
Click the thumbnail below to watch the video demo.
Watch the demo

TrovePilot is an automation layer for Mezo borrowers that stabilizes target ICR and coordinates dual-asset reserves (MUSD + USDC accounting) through BTC volatility and MUSD peg changes.

Features

It helps a borrower:

  • monitor trove health and reserve state,
  • simulate BTC and MUSD market scenarios,
  • run BTC-up/BTC-down operational actions,
  • rotate reserve liquidity across stability and opportunity lanes.

Core behavior

  • BTC Down scenarios can trigger debt repayment from reserve flow.
  • BTC Up scenarios can mint additional MUSD and route it into reserve.
  • MUSD premium/discount scenarios rotate reserve balances using peg-aware conversion logic.
  • Reserve operations support deposit/withdraw management from the app.

Tech Stack

  • Frontend: Next.js 14, React, TypeScript, wagmi, viem.
  • Contracts: Solidity, Hardhat, Mezo-compatible vault contracts.
  • Tooling: npm workspaces, Vercel deployment.

Prerequisites

  • Node.js 20+
  • npm 9+
  • Mezo testnet wallet (for live onchain interaction)

Environment Variables

Variable Scope Required Description
NEXT_PUBLIC_MEZO_RPC_URL apps/web Yes Mezo RPC URL used by frontend reads/writes.
NEXT_PUBLIC_MEZO_CHAIN_ID apps/web Yes Mezo chain ID for wallet/network checks.
NEXT_PUBLIC_MEZO_EXPLORER_URL apps/web Yes Explorer link base for tx linking.
NEXT_PUBLIC_TROVE_PILOT_VAULT_ADDRESS apps/web Yes Active deployed vault contract address.
NEXT_PUBLIC_OLD_TROVE_PILOT_VAULT_ADDRESS apps/web No Previous vault for migration/withdraw UX.
NEXT_PUBLIC_DEMO_AUTOMATION apps/web No (local demo only) Enables local demo signer flow for BTC Up/Down.
DEMO_BORROWER_PRIVATE_KEY apps/web No (local demo only) Server-only key for local demo automation route.
MEZO_RPC_URL contracts Yes (deploy/write) RPC URL used by Hardhat scripts.
MEZO_CHAIN_ID contracts Yes (deploy/write) Chain ID used by Hardhat network config.
MEZO_PRIVATE_KEY contracts Yes (deploy/write) Deployer private key (never commit).
TROVE_PILOT_VAULT_ADDRESS contracts No Existing deployed vault address for script ops.
MOCK_MARKET_ORACLE_ADDRESS contracts No Optional oracle address used by deploy/script flows.

Installation & Quick Start

npm install
cp apps/web/.env.example apps/web/.env.local
cp contracts/.env.example contracts/.env

Run frontend:

npm run web:dev

Useful contract commands:

npm run contracts:compile
npm run contracts:test
npm run contracts:deploy:mezo

Repository Structure

trovepilot/
├─ apps/
│  └─ web/                 # Next.js app (dashboard, vault, rules, sim, timeline)
├─ contracts/
│  ├─ contracts/           # Solidity vault contracts
│  ├─ scripts/             # Deployment / operational scripts
│  └─ test/                # Hardhat tests
├─ package.json            # Workspace scripts
└─ README.md

Architecture Overview

  • Web app (apps/web) reads trove/reserve state, configures rules, and triggers automation actions.
  • Vault contracts (contracts/contracts) hold and coordinate reserve accounting plus action execution logic.
  • Mezo protocol integration provides trove debt/collateral capacity data and borrow/repay operations.
  • Automation model: target-ICR stabilization + reserve lane coordination under BTC and peg regime changes.

Example Usage

  1. Connect wallet on Mezo testnet.
  2. Open/fund reserve via Vault page.
  3. Configure target ICR band and peg thresholds on Rules.
  4. Trigger BTC Up/Down or peg actions from Simulation/automation controls.
  5. Monitor reserve and debt effects in Dashboard and Timeline.

Testing Instructions

Run contract test suite:

npm run contracts:test

Build frontend:

npm run web:build

License

No license file is currently included in this repository.

About

TrovePilot is an automation layer for Mezo borrowers that stabilizes target ICR and coordinates dual-asset reserves (MUSD + USDC accounting) through BTC volatility and MUSD peg changes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors