Skills.MD
# Analyzing NFT Rarity
## Overview
NFT rarity analysis skill that:
- Fetches collection metadata from OpenSea API
- Parses and normalizes trait attributes
- Calculates rarity using multiple algorithms
- Ranks tokens by composite rarity score
- Exports data in JSON and CSV formats
## Prerequisites
- Python 3.8+ with requests library
- Optional: `OPENSEA_API_KEY` for higher rate limits
- Optional: `ALCHEMY_API_KEY` for direct metadata fetching
## Instructions
### 1. Analyze a Collection
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py collection boredapeyachtclub
```
Options:
- `--limit 500`: Fetch more tokens for analysis
- `--top 50`: Show top 50 tokens
- `--traits`: Include trait distribution
- `--rarest`: Show rarest traits
- `--algorithm [statistical|rarity_score|average|information]`
### 2. Check Specific Token
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py token pudgypenguins 1234
```
### 3. Compare Multiple Tokens
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py compare azuki 1234,5678,9012
```
### 4. View Trait Distribution
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py traits doodles
```
### 5. Export Rankings
JSON:
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py export coolcats > rankings.json
```
CSV:
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py export coolcats --format csv > rankings.csv
```
### 6. Manage Cache
```bash
cd {baseDir}/scripts && python3 rarity_analyzer.py cache --list
cd {baseDir}/scripts && python3 rarity_analyzer.py cache --clear
```
## Rarity Algorithms
| Algorithm | Description | Best For |
|-----------|-------------|----------|
| `rarity_score` | Sum of 1/frequency (default) | General use, matches rarity.tools |
| `statistical` | Same as rarity_score | Backward compatibility |
| `average` | Mean of trait rarities | Balanced scoring |
| `information` | Entropy-based (-log2) | Information theory approach |
## Output
- **Collection Summary**: Name, supply, trait types
- **Rankings**: Tokens sorted by rarity score with percentile
- **Token Detail**: Full trait breakdown with contribution
- **Comparison**: Side-by-side trait comparison
## Supported Collections
Works with any ERC-721/ERC-1155 collection that has:
- OpenSea listing
- Standard attributes array format
- Accessible metadata
## Error Handling
See `{baseDir}/references/errors.md` for:
- API rate limiting
- IPFS gateway issues
- Collection not found
- Token ID not found
## Examples
See `{baseDir}/references/examples.md` for:
- Collection analysis workflows
- Token comparison
- Export and caching
- Algorithm comparison
## Resources
- [OpenSea API](https://docs.opensea.io/reference/api-overview) - Metadata source
- [Rarity Tools](https://rarity.tools/) - Reference rankings
- [IPFS](https://ipfs.io/) - Decentralized metadata
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「analyzing-nft-rarity」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次