Skip to content
Wuxie233Public

About

Wallet health analysis and a pre-transaction risk firewall for Mantle

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulse

Take the pulse of your onchain wealth.

Pulse is a defensive, consumer-facing AI agent for Mantle RWA and yield wallets. Paste a wallet address: Pulse reads your on-chain positions, scores your portfolio health on five risk dimensions, explains the risks in plain bilingual language, warns you before you sign a dangerous transaction, and anchors every report on Mantle so anyone can verify it.

Built for The Mantle Turing Test Hackathon 2026. Most submissions trade for you. Pulse does the opposite: it protects you.

Live

Modules

  1. Wallet Health Scan (/scan/[address]) — reads real Mantle holdings via viem multicall + live prices, computes a deterministic 5-dimension risk score, then a streaming bilingual (en/zh) AI narrative explains the findings and a prioritized action plan. The AI never sets the score; it explains the deterministic engine.
  2. Pre-Trade Firewall (/pre-trade) — paste calldata, a tx hash, or a target contract. Pulse decodes it with viem, applies deterministic rules (e.g. an unlimited approval to an unknown spender = danger), and the AI explains the verdict in plain language with a full-viewport safe / caution / danger flash.
  3. On-chain Proof + ERC-8004 identity + Share — report hashes (canonical keccak) are published on Mantle by the Pulse audit agent, which holds an on-chain ERC-8004 agent identity. Every report can be re-verified at /verify/[txhash], and exported as a 1080x1350 shareable health card.

Risk model

Score = weighted blend of five deterministic dimensions, each 0-100, normalized to 0-100.

Dimension Measures Weight
Concentration Value share in a single asset / protocol 25%
Liquidity Position depth vs. holdings 15%
Depeg / Oracle Stablecoin deviation, oracle quality 20%
Protocol Coverage, maturity, exposure 25%
Approval Open / unlimited ERC-20 approvals, spender risk 15%

Bands: 85-100 Healthy, 65-84 Watch, 40-64 Strained, 0-39 Critical.

ERC-8004 agent identity

ERC-8004 ("Trustless Agents") is one of the hackathon's defining features. Pulse's audit agent is registered on an on-chain ERC-8004 Identity Registry (ERC-721 + URIStorage, agentId == tokenId, agentURI == tokenURI) as agent #1, with a full registration document as its token URI. The same agent wallet that signs publishReport owns that identity NFT, so every report anchored on Mantle is attributable to a verifiable on-chain agent identity.

Architecture

Browser  --  Next.js (App Router) + Tailwind + GSAP + Lenis + View Transitions
                |
                v
Server   --  Next.js route handlers
                |- Data layer (viem): Mantle reads, multicall, prices, approvals
                |- Risk engine: deterministic 5-dimension scoring (no AI)
                |- AI layer: OpenAI-compatible gateway (gpt-5.5), streaming + JSON,
                |            deterministic bilingual fallback when unavailable
                |- Chain layer (viem): publish + read HealthReport, read AgentIdentity
                |
                v
Mantle   --  HealthReport (report hashes) + AgentIdentity (ERC-8004) + ERC-20 / RWA reads

Tech stack

  • Next.js (App Router) + TypeScript + Tailwind + GSAP + ScrollTrigger + Lenis
  • viem for all on-chain reads/writes; Redis cache
  • Solidity 0.8.24 + Hardhat + OpenZeppelin 5.0.2
  • AI via an OpenAI-compatible gateway (model gpt-5.5), pluggable
  • Self-hosted: Nginx + PM2 + Let's Encrypt, Cloudflare DNS-only (not Vercel)

Repo layout

pulse/
  README.md
  docs/            product, design, motion, architecture, roadmap, submission
  contracts/       Hardhat workspace (HealthReport.sol, AgentIdentity.sol)
  web/             Next.js app

Setup

Contracts

cd contracts
npm install
npm run compile
npm test                       # 20 tests (HealthReport + ERC-8004 AgentIdentity)

Deploy to Mantle Sepolia (requires a funded deployer key; copy .env.example to .env):

PULSE_DEPLOYER_KEY=0x... npm run deploy:sepolia
PULSE_DEPLOYER_KEY=0x... npm run deploy:identity:sepolia
HEALTH_REPORT_ADDRESS=0x... AGENT_IDENTITY_ADDRESS=0x... npm run verify

Verification falls back to Sourcify (no API key required); set MANTLESCAN_API_KEY to also verify on Mantlescan.

Web

cd web
pnpm install
# create .env.local with (names only):
#   PULSE_AI_BASE_URL, PULSE_AI_API_KEY, PULSE_AI_MODEL
#   PULSE_MANTLE_RPC_URL, PULSE_MANTLE_CHAIN_ID, PULSE_REDIS_URL
#   PULSE_PROOF_RPC_URL, PULSE_PROOF_CHAIN_ID, PULSE_HEALTHREPORT_ADDRESS,
#   PULSE_PROOF_AGENT_KEY, PULSE_PROOF_EXPLORER
#   PULSE_AGENT_IDENTITY_ADDRESS, PULSE_AGENT_ID
pnpm build
pnpm start            # or run under PM2: pm2 reload pulse

Never commit .env*, private keys, or API keys.

Demo video

Pulse generates its DoraHacks demo video with Remotion instead of manual screen recording:

cd web
pnpm video:render

The output is web/video/pulse-demo.mp4. Current public video asset: https://github.com/Wuxie233/pulse/releases/download/demo-video-v1/pulse-demo.mp4. See docs/demo-video.md for the timeline and submission checklist.

Demo wallets

  • 0x1111111111111111111111111111111111111111 — healthy yield wallet (sample)
  • 0x2222222222222222222222222222222222222222 — high-exposure wallet (sample)

Track alignment

  • AI x RWA (Application path): an end-user product that lowers the barrier to understanding RWA/yield positions on Mantle.
  • Best UI/UX: editorial color-blocking design system, GSAP motion, streaming AI, bilingual, responsive.
  • Consumer & Viral DApps: shareable health card + public verification.
  • 20 Project Deployment Award: contracts deployed and verified on Mantle; an AI-derived report hash is written on-chain by an ERC-8004 agent; public frontend; demo video.

License

MIT

About

Wallet health analysis and a pre-transaction risk firewall for Mantle

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages