Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/crypto/on-chain-analytics/skills/analyzing-on-chain-data

analyzing-on-chain-data

Verified

Process perform on-chain analysis including whale tracking, token flows, and network activity. Use when performing crypto analysis. Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".

FileKindSize
ARD.mdmarkdown7.1 KB
PRD.mdmarkdown2.2 KB
SKILL.mdskill md5.7 KB
config/settings.yamlconfig1.1 KB
references/errors.mdmarkdown2.0 KB
references/examples.mdmarkdown3.3 KB
references/implementation.mdmarkdown1.5 KB
scripts/data_fetcher.pyscript7.6 KB
scripts/formatters.pyscript6.1 KB
scripts/metrics_calculator.pyscript7.6 KB
scripts/onchain_analytics.pyscript10.2 KB
# ARD: On-Chain Analytics

> Part of [Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)

## 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
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall