Skip to content
Back to skills

2032 Ard 60509e4b

ASecurity

Data Aggregation with Multi-Source Normalization

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
toolspythonapidatabasesecurity

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2032-ard_60509e4b --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2032 Ard 60509e4b?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2032 Ard 60509e4b
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2032-ard-60509e4b/badge)](https://www.skillsdirectory.com/skills/tools-only-2032-ard-60509e4b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# ARD: On-Chain Analytics

## Architectural Overview

### Pattern
Data Aggregation with Multi-Source Normalization

### Architecture Diagram
```
┌─────────────────────────────────────────────────────────────────┐
│                     User Request                                 │
│    "analyze defi tvl", "compare protocol revenue", "top dapps"  │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                   onchain_analytics.py                           │
│  ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌──────────────┐ │
│  │ tvl_cmd    │ │ revenue_cmd│ │ users_cmd  │ │ compare_cmd  │ │
│  └────────────┘ └────────────┘ └────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                     data_fetcher.py                              │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │ Multi-source aggregation with caching and normalization     ││
│  └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
       ┌───────────┐   ┌───────────┐   ┌───────────┐
       │ DeFiLlama │   │  Token    │   │ CoinGecko │
       │    API    │   │ Terminal  │   │    API    │
       └───────────┘   └───────────┘   └───────────┘
```

### Workflow
1. Parse user query (TVL, revenue, users, comparison)
2. Route to appropriate data fetcher
3. Aggregate data from multiple sources
4. Normalize and calculate derived metrics
5. Format and display results

## Progressive Disclosure Strategy

| Level | Content | Location |
|-------|---------|----------|
| L1: Quick Start | CLI examples, common queries | SKILL.md |
| L2: Configuration | API setup, defaults | config/settings.yaml |
| L3: Implementation | Data normalization, caching | references/implementation.md |
| L4: Advanced | Custom metrics, API queries | references/examples.md |

## Directory Structure

```
skills/analyzing-on-chain-data/
├── SKILL.md                    # Core instructions
├── PRD.md                      # Product requirements
├── ARD.md                      # Architecture (this file)
├── scripts/
│   ├── onchain_analytics.py    # Main CLI
│   ├── data_fetcher.py         # Multi-source data fetching
│   ├── metrics_calculator.py   # Derived metrics calculation
│   └── formatters.py           # Output formatting
├── references/
│   ├── errors.md               # Error handling
│   ├── examples.md             # Usage examples
│   └── implementation.md       # Implementation details
└── config/
    └── settings.yaml           # Configuration
```

## API Integration Architecture

### DeFiLlama (Primary - No Rate Limits)
```python
# Protocol TVL
GET /protocols

# Chain TVL
GET /v2/chains

# Protocol Revenue/Fees
GET /overview/fees/{protocol}

# Historical TVL
GET /protocol/{protocol}
```

### Token Terminal (Secondary)
```python
# Protocol metrics
GET /v2/protocols/{protocol}

# Market data
GET /v2/metrics/market_data
```

## Data Flow Architecture

```
Input: "top defi protocols by tvl"
         │
         ▼
┌─────────────────────────┐
│   Parse Query           │
│   - Metric: TVL         │
│   - Filter: DeFi        │
│   - Sort: descending    │
└─────────────────────────┘
         │
         ▼
┌─────────────────────────┐
│   Fetch Data            │
│   - DeFiLlama protocols │
│   - Cache check         │
│   - Rate limit handling │
└─────────────────────────┘
         │
         ▼
┌─────────────────────────┐
│   Calculate Metrics     │
│   - Market share        │
│   - Growth rates        │
│   - Rankings            │
└─────────────────────────┘
         │
         ▼
┌─────────────────────────┐
│   Format Output         │
│   - Table / JSON / CSV  │
│   - Charts if requested │
└─────────────────────────┘
```

## Error Handling Strategy

| Error | Cause | Recovery |
|-------|-------|----------|
| API unavailable | Service down | Use cached data, try backup |
| Rate limited | Too many requests | Exponential backoff |
| Missing protocol | Not in database | Suggest alternatives |
| Invalid date range | Future or malformed | Validate and suggest fix |

## Caching Strategy

- **Protocol list**: TTL 1 hour
- **TVL data**: TTL 5 minutes
- **Revenue data**: TTL 15 minutes (updates daily)
- **Historical data**: TTL 24 hours (immutable)
- **User metrics**: TTL 30 minutes

## Security Considerations

- API keys stored in environment variables
- No user data or private information
- Rate limit compliance
- Input validation for all parameters

Files in this skill

  • README.md1.2 KB
  • skill.md7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.