Mantle Portfolio Analyst
Overview
Build deterministic, read-only wallet analysis on Mantle. Enumerate balances and allowances, then highlight approval risk in a structured report.
Workflow
- Confirm inputs:
wallet_address
network (mainnet or sepolia)
- optional token/spender scope
- Validate requested wallet and chain context:
mantle-cli registry validate <address> --json
mantle-cli chain info --json
mantle-cli chain status --json
- Determine analysis scope:
- token list from user input or
mantle://registry/tokens
- spender list from user input or
mantle://registry/protocols
- Fetch native balance with
mantle-cli account balance <address> --json.
- Fetch ERC-20 balances with
mantle-cli account token-balances <address> --tokens <list> --json.
- Fetch token-spender allowances with
mantle-cli account allowances <owner> --pairs <token:spender,...> --json.
- If a token's metadata is missing, use
mantle-cli token info <token> --json for that token and keep missing fields as unknown when unresolved.
- Classify approval risk using these rules:
low: allowance is zero, or tightly bounded and clearly below wallet balance/expected use.
medium: allowance is non-zero and larger than immediate expected use, but still bounded.
high: allowance is very large relative to expected use, or intentionally broad with unclear user intent.
critical: is_unlimited=true from tool output, or allowance equals/near-max integer (value >= 2^255).
- Always include a rationale sentence with each risk label.
- Mark spender trust as
unknown unless verified from mantle://registry/protocols or user-confirmed.
- Highlight all
high and critical approvals at top of summary.
- If token decimals are missing, classify using raw value and downgrade confidence.
- Return a formatted report with findings, confidence, and explicit coverage/partial gaps.
Guardrails
- Use
mantle-cli read-only commands only for this skill (mantle-cli account balance, mantle-cli account token-balances, mantle-cli account allowances, mantle-cli token info, chain/address validation helpers). Do NOT enable or connect to the MCP server.
- Stay read-only; do not construct or send transactions.
- Do not reference direct JSON-RPC calls (
eth_*) as if they are callable tools in this workflow.
- Do not guess token decimals or symbols if calls fail.
- Validate checksummed addresses for wallet, token, and spender. If an address fails checksum validation or is the zero address (
0x0000...0000), stop and return an error message explaining the issue -- do not proceed with queries against an invalid address.
- Mark missing token metadata as
unknown and continue.
- If RPC responses are inconsistent, report partial coverage explicitly.
- Keep both
raw and normalized values in output. Prefer normalized values from tool responses; convert manually only when decimals are explicitly known. If decimals are unavailable, keep raw only and lower confidence.
- Verify response chain/network matches the requested input. Detect and report partial failures via tool-level
partial flags and per-entry error fields.
- If scope is unknown and cannot be discovered, report that coverage is partial instead of inventing token or spender targets.
Report Format
Always use this exact report structure, even when the user query is scoped to a specific token, spender, or subset. Omit sections only if they are genuinely empty (e.g., no allowances found), but keep all section headers. For scoped queries, populate only the relevant entries within each section and note the applied filter in the summary.
Mantle Portfolio Report
- wallet:
- network:
- chain_id:
- collected_at_utc:
Native Balance
- MNT:
Token Balances
- token: <symbol_or_label>
address:
balance_raw:
decimals:
balance_normalized:
Allowance Exposure
- token:
spender:
allowance_raw:
allowance_normalized:
risk_level: low | medium | high | critical
rationale:
Summary
- tokens_with_balance:
- allowances_checked:
- unlimited_or_near_unlimited_count:
- key_risks:
- confidence:
References
references/rpc-readonly-workflow.md
references/allowance-risk-rules.md
1---2name: mantle-portfolio-analyst3description: Use when a Mantle task needs wallet balances, token holdings, allowance exposure, or unlimited-approval review before a DeFi or security decision.4---5
6# Mantle Portfolio Analyst
7
8## Overview
9
10Build deterministic, read-only wallet analysis on Mantle. Enumerate balances and allowances, then highlight approval risk in a structured report.
11
12## Workflow
13
141. Confirm inputs:
15 - `wallet_address`
16 - `network` (`mainnet` or `sepolia`)
17 - optional token/spender scope
182. Validate requested wallet and chain context:
19 - `mantle-cli registry validate <address> --json`
20 - `mantle-cli chain info --json`
21 - `mantle-cli chain status --json`
223. Determine analysis scope:
23 - token list from user input or `mantle://registry/tokens`
24 - spender list from user input or `mantle://registry/protocols`
254. Fetch native balance with `mantle-cli account balance <address> --json`.
265. Fetch ERC-20 balances with `mantle-cli account token-balances <address> --tokens <list> --json`.
276. Fetch token-spender allowances with `mantle-cli account allowances <owner> --pairs <token:spender,...> --json`.
287. If a token's metadata is missing, use `mantle-cli token info <token> --json` for that token and keep missing fields as `unknown` when unresolved.
298. Classify approval risk using these rules:
30 - `low`: allowance is zero, or tightly bounded and clearly below wallet balance/expected use.
31 - `medium`: allowance is non-zero and larger than immediate expected use, but still bounded.
32 - `high`: allowance is very large relative to expected use, or intentionally broad with unclear user intent.
33 - `critical`: `is_unlimited=true` from tool output, or allowance equals/near-max integer (value >= 2^255).
34 - Always include a rationale sentence with each risk label.
35 - Mark spender trust as `unknown` unless verified from `mantle://registry/protocols` or user-confirmed.
36 - Highlight all `high` and `critical` approvals at top of summary.
37 - If token decimals are missing, classify using raw value and downgrade confidence.
389. Return a formatted report with findings, confidence, and explicit coverage/partial gaps.
39
40## Guardrails
41
42- Use `mantle-cli` read-only commands only for this skill (`mantle-cli account balance`, `mantle-cli account token-balances`, `mantle-cli account allowances`, `mantle-cli token info`, chain/address validation helpers). Do NOT enable or connect to the MCP server.
43- Stay read-only; do not construct or send transactions.
44- Do not reference direct JSON-RPC calls (`eth_*`) as if they are callable tools in this workflow.
45- Do not guess token decimals or symbols if calls fail.
46- Validate checksummed addresses for wallet, token, and spender. If an address fails checksum validation or is the zero address (`0x0000...0000`), stop and return an error message explaining the issue -- do not proceed with queries against an invalid address.
47- Mark missing token metadata as `unknown` and continue.
48- If RPC responses are inconsistent, report partial coverage explicitly.
49- Keep both `raw` and `normalized` values in output. Prefer normalized values from tool responses; convert manually only when decimals are explicitly known. If decimals are unavailable, keep raw only and lower confidence.
50- Verify response chain/network matches the requested input. Detect and report partial failures via tool-level `partial` flags and per-entry `error` fields.
51- If scope is unknown and cannot be discovered, report that coverage is partial instead of inventing token or spender targets.
52
53## Report Format
54
55Always use this exact report structure, even when the user query is scoped to a specific token, spender, or subset. Omit sections only if they are genuinely empty (e.g., no allowances found), but keep all section headers. For scoped queries, populate only the relevant entries within each section and note the applied filter in the summary.
56
57```text
58Mantle Portfolio Report
59- wallet:
60- network:
61- chain_id:
62- collected_at_utc:
63
64Native Balance
65- MNT:
66
67Token Balances
68- token: <symbol_or_label>
69 address:
70 balance_raw:
71 decimals:
72 balance_normalized:
73
74Allowance Exposure
75- token:
76 spender:
77 allowance_raw:
78 allowance_normalized:
79 risk_level: low | medium | high | critical
80 rationale:
81
82Summary
83- tokens_with_balance:
84- allowances_checked:
85- unlimited_or_near_unlimited_count:
86- key_risks:
87- confidence:
88```
89
90## References
91
92- `references/rpc-readonly-workflow.md`
93- `references/allowance-risk-rules.md`