alchemy-rate-limits

Featured

Implement Alchemy Compute Unit (CU) rate limiting and request throttling. Use when handling 429 errors, optimizing CU usage, or managing concurrent blockchain queries within plan limits. Trigger: "alchemy rate limit", "alchemy 429", "alchemy compute units", "alchemy throttling", "alchemy CU budget".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Alchemy Rate Limits ## Overview Alchemy uses Compute Units (CU) to measure API usage. Different methods cost different CU amounts. Rate limits are per-second, and exceeding them returns 429 errors. ## Compute Unit Costs | Method | CU Cost | Category | |--------|---------|----------| | `eth_blockNumber` | 10 | Core | | `eth_getBalance` | 19 | Core | | `eth_call` | 26 | Core | | `eth_getTransactionReceipt` | 15 | Core | | `getTokenBalances` | 50 | Enhanced | | `getTokenMetadata` | 50 | Enhanced | | `getAssetTransfers` | 150 | Enhanced | | `getNftsForOwner` | 50 | NFT | | `getNftMetadataBatch` | 50 | NFT | | `getContractMetadata` | 50 | NFT | ## Plan Limits | Plan | CU/sec | Monthly CU | Price | |------|--------|------------|-------| | Free | 330 | 300M | $0 | | Growth | 660 | 1.2B | $49/mo | | Scale | Custom | Custom | Custom | ## Instructions ### Step 1: CU-Aware Request Throttler ```typescript // src/alchemy/throttler.ts import Bottleneck from 'bottleneck'; const CU_COSTS: Record<string, number> = { 'eth_blockNumber': 10, 'eth_getBalance': 19, 'eth_call': 26, 'getTokenBalances': 50, 'getAssetTransfers': 150, 'getNftsForOwner': 50, }; // Free tier: 330 CU/sec = ~16 getBalance calls/sec const limiter = new Bottleneck({ reservoir: 330, // CU budget per interval reservoirRefreshInterval: 1000, // Refresh every second reservoirRefreshAmount: 330, // Reset to max CU/sec maxConcurrent: 10, // Max parallel r...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category