Analyze EVM wallet asset distribution and identify high-risk protocol exposure.
Goal: Provide concise asset distribution analysis and risk assessment for EVM wallets.
wallet_address (required): EVM address (0x...)Primary: Zerion API via zerion-portfolio.py
# Get all assets
python3 zerion-portfolio.py <address>
# Get only DeFi positions
python3 zerion-portfolio.py <address> --only-defi
Environment: ZERION_API_KEY must be set. If not set, get your API key at: https://www.zerion.io/api
1. Check address format: 0x + 40 hex characters
2. If invalid format: Exit with error message
# Execute Zerion portfolio script
python3 skills/pubfi-wallet-portfolio-analysis/zerion-portfolio.py <address>
Handle Edge Cases:
Group by type:
Native: ETH, MATIC, BNB, etc.
Stablecoins: USDC, USDT, DAI, USDS
DeFi Positions: Has protocol attribute + position_type != 'wallet'
Other Tokens: Everything else
Track total value per category for distribution percentages
For each DeFi position:
1. Extract protocol name from attributes.protocol
2. Identify position type (Lending/Staking/LP/etc.)
3. Record position value and percentage of portfolio
4. Create list of unique protocols for risk assessment
For each identified protocol:
A. Fetch Protocol Data (parallel):
- DefiLlama API: curl "https://api.llama.fi/protocol/{slug}"
- Extract TVL, chains, audit info, category
B. Check Recent Exploits:
- Search rekt.news for protocol name
- Filter last 90 days
- Record any incidents
C. Calculate Risk Score:
Risk = Base + Events + Audit + TVL Trend
Factors:
- No audit: +5
- Recent exploit (90 days): +5
- TVL drop >50% (30 days): +3
- TVL drop 20-50%: +2
- New protocol (<6 months): +2
- Single audit: +1
- Multiple audits: -2
- Battle-tested (>1 year): -1
D. Assign Risk Level:
- Score > 7: 🔴 High Risk
- Score 4-7: 🟡 Medium Risk
- Score < 4: 🟢 Low Risk
E. Error Handling:
- DefiLlama fails: Mark TVL as "N/A", continue
- Rekt.news unavailable: Mark exploits as "Unknown"
Known Safe Protocols (auto 🟢):
- Aave V2/V3, Uniswap V2/V3, Compound V2/V3
- Lido, Curve, MakerDAO/Sky
Output structured markdown report following the Output Format section below.
Portfolio: 0x...
Total Value: $X,XXX USD
Chains: Ethereum, Arbitrum, Base
Asset Breakdown:
• Native: $XXX (XX%)
• Stablecoins: $XXX (XX%)
• DeFi Positions: $XXX (XX%)
• Other Tokens: $XXX (XX%)
Table format showing all positions sorted by value:
Protocol/Wallet | Position Type | Value | % Portfolio
----------------|---------------|-------|------------
Wallet Assets | Wallet | $XXX | XX%
Protocol A | Lending | $XXX | XX%
Protocol B | LP | $XXX | XX%
Table format:
Chain | Asset | Type | Amount | Value | % Portfolio
------|-------|------|--------|-------|------------
For each protocol with 🟡 Medium or 🔴 High risk only (skip 🟢 Low risk):
Protocol Name (Chain)
• Position Value: $XXX (XX% of portfolio)
• Position Type: Lending/Staking/LP/etc.
• Risk: 🟡/🔴
• TVL: $XXX (DefiLlama)
• Audit: Yes/No (auditor names)
• Recent Issues: None / [describe]
If all protocols are low risk, output: "All DeFi positions are in low-risk protocols (🟢)"
High Priority:
Medium Priority:
Overall Assessment:
Conciseness:
Accuracy:
Usefulness:
Last updated: 2026-02-05