alchemy-performance-tuning

Featured

Optimize Alchemy SDK performance with caching, batching, and multi-chain parallelism. Use when reducing latency for blockchain queries, optimizing CU consumption, or scaling dApps for high request volumes. Trigger: "alchemy performance", "alchemy slow", "alchemy optimization", "alchemy caching", "alchemy batch requests".

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 Performance Tuning ## Performance Targets | Operation | Target Latency | CU Cost | |-----------|---------------|---------| | `getBlockNumber` | < 50ms | 10 | | `getBalance` | < 100ms | 19 | | `getTokenBalances` | < 200ms | 50 | | `getNftsForOwner` | < 300ms | 50 | | `getAssetTransfers` | < 500ms | 150 | | Multi-chain portfolio | < 2s | ~400 | ## Instructions ### Step 1: Response Caching with TTL ```typescript // src/performance/cache.ts import { Alchemy, Network } from 'alchemy-sdk'; class BlockchainCache { private store = new Map<string, { data: any; expiry: number }>(); // Different TTLs for different data freshness needs private TTL: Record<string, number> = { blockNumber: 12000, // 12s (~1 block) balance: 30000, // 30s tokenBalances: 60000, // 60s nftOwnership: 300000, // 5 min (NFTs transfer less frequently) contractMetadata: 3600000, // 1 hour (rarely changes) tokenMetadata: 86400000, // 24 hours (almost never changes) }; async cached<T>(category: string, key: string, fetcher: () => Promise<T>): Promise<T> { const cacheKey = `${category}:${key}`; const entry = this.store.get(cacheKey); if (entry && entry.expiry > Date.now()) return entry.data; const data = await fetcher(); this.store.set(cacheKey, { data, expiry: Date.now() + (this.TTL[category] || 30000) }); return data; } invalidate(category: string): void { for (const key of this.store.keys()) { if (key.start...

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