| name | alchemy-rate-limits |
| description | 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".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*) |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","blockchain","web3","alchemy","rate-limiting"] |
| compatibility | Designed for Claude Code |
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
import Bottleneck from 'bottleneck';
const CU_COSTS: Record<string, number> = {
'eth_blockNumber': ,
: ,
: ,
: ,
: ,
: ,
};
limiter = ({
: ,
: ,
: ,
: ,
: ,
});
limiter.(, {
.();
});
throttledAlchemyCall<T>(
: ,
: <T>,
): <T> {
cost = [method] || ;
limiter.({ : cost }, operation);
}
{ throttledAlchemyCall, limiter };