Loading...
Loading...
Analyze EVM wallet asset distribution and identify high-risk protocol exposure.
npx skill4agent add helixbox/pubfi-skills pubfi-wallet-portfolio-analysisGoal: Provide concise asset distribution analysis and risk assessment for EVM wallets.
wallet_addresszerion-portfolio.py# Get all assets
python3 zerion-portfolio.py <address>
# Get only DeFi positions
python3 zerion-portfolio.py <address> --only-defiZERION_API_KEY1. 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>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 percentagesFor 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 assessmentFor 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/SkyPortfolio: 0x...
Total Value: $X,XXX USD
Chains: Ethereum, Arbitrum, BaseAsset Breakdown:
• Native: $XXX (XX%)
• Stablecoins: $XXX (XX%)
• DeFi Positions: $XXX (XX%)
• Other Tokens: $XXX (XX%)Protocol/Wallet | Position Type | Value | % Portfolio
----------------|---------------|-------|------------
Wallet Assets | Wallet | $XXX | XX%
Protocol A | Lending | $XXX | XX%
Protocol B | LP | $XXX | XX%Chain | Asset | Type | Amount | Value | % Portfolio
------|-------|------|--------|-------|------------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]