Live demo: https://trovepilot-web-vo95.vercel.app/
Click the thumbnail below to watch the video 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.
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.
- 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.
- Frontend: Next.js 14, React, TypeScript, wagmi, viem.
- Contracts: Solidity, Hardhat, Mezo-compatible vault contracts.
- Tooling: npm workspaces, Vercel deployment.
- Node.js 20+
- npm 9+
- Mezo testnet wallet (for live onchain interaction)
| 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. |
npm install
cp apps/web/.env.example apps/web/.env.local
cp contracts/.env.example contracts/.envRun frontend:
npm run web:devUseful contract commands:
npm run contracts:compile
npm run contracts:test
npm run contracts:deploy:mezotrovepilot/
├─ 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
- 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.
- Connect wallet on Mezo testnet.
- Open/fund reserve via Vault page.
- Configure target ICR band and peg thresholds on Rules.
- Trigger BTC Up/Down or peg actions from Simulation/automation controls.
- Monitor reserve and debt effects in Dashboard and Timeline.
Run contract test suite:
npm run contracts:testBuild frontend:
npm run web:buildNo license file is currently included in this repository.
