Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key

EVM Compute Units

All Moralis plans have generous limits on the number of requests you can make per month. How many included requests you have depends on the plan you have, check the pricing page for more details.

Some requests are more expensive than others. By giving some heavy requests higher weight, we ensure that you only pay for what you use and not a cent more.

This allows you to get cheaper requests for most use cases while protecting our systems from abuse by weighing the computationally expensive endpoints.

What is a Compute Unit (CU)?

A Compute Unit (CU) measures the computational complexity of a specific API request. Each API request carries a corresponding CU weight. For instance, simple endpoints like getNativeBalance have a low computational load, whereas more complex ones like getWalletNetworth, which fetches native balance, ERC20 balances, and prices across various chains, are more resource-intensive and therefore carry a higher CU.

Each request has both price and rate limit cost that are measured in terms of compute units. The rate limit cost of an API request is what contributes towards your CU/s throughput.

It is also important to note that some API will have dynamic pricing that will cost more CU the more inputs you add for the request.

CU Price

Request price denotes the number of compute units (CUs) counted towards your monthly or daily API usage billing. This means that the CU cost of an API endpoint will be subtracted from the limits defined by your plan. For instance, the free plan offers 40,000 CUs per day, while paid plans provide 100,000,000 CUs per month or more. If usage exceeds the allocated CUs on a paid plan, overage charges apply, determined by the excess CUs consumed.

CU Rate Limit Cost

CUs also play a crucial role in regulating the frequency of API requests through rate limits. Rate limit costs help manage your "API health" by preventing system overload caused by an excessive number of requests within a short timeframe.

Each API request is assigned two weights:

  1. CU price, which contributes to billing as discussed earlier
  2. Rate Limit CU Cost, which determines the frequency of calls to an endpoint and contributes to the CU/second throughput of your plan
tip

When you're setting up a function call, remember to factor in the query parameters as well! These can sometimes add to the CU cost. To stay on top of it, always check the individual query parameter costs in the query parameters table to have a clear picture of the total CU cost your call will incur. This way, you can make well-informed decisions and prevent any unexpected surprises in your CU usage.

By taking a moment to consult the table before making a call, you can avoid unexpected CU charges and keep your API interactions smooth and efficient.

Compute Units and Rate Limit prices

NamePathPriceRate Limit Cost
BaseAdditional
endpointWeights/info/endpointWeights1010
getAggregatedTokenPairStats/pairs/{address}/stats50020
getBlock/block/{block_number_or_hash}100020
getBondingTokensByExchange/token/{exchange}/bonding1020
getCandleSticks/pairs/:address/ohlcv150050
getContractNFTs/nft/{address}50020
getDateToBlock/block/dateToBlock1020
getDefiPositionsByProtocol/wallets/:address/defi/:protocol/positions15010
getDefiPositionsSummary/wallets/{address}/defi/positions50020
getDefiSummary/wallets/{address}/defi/summary50020
getDiscoveryToken/discovery/token50050
getEntitiesByCategory/entities/categories/{categoryId}50020
getEntity/entities/{entityId}50020
getEntityCategories/entities/categories10020
getFilteredTokens/discovery/tokens250050
getGraduatedTokensByExchange/token/{exchange}/graduated1020
getHistoricalTokenHolders/erc20/:tokenAddress/holders/historical50020
getLatestBlockNumber/latestBlockNumber/{chain}10010
getMultipleNFTs/nft/getMultipleNFTs150020
getMultipleTokenAnalytics/tokens/analytics150050
getMultipleTokenPrices/erc20/prices100020
getNativeBalance/{address}/balance10010
getNativeBalancesForAddresses/wallets/balances10+10 CUs per wallet addresses10
getNewTokensByExchange/token/{exchange}/new1020
getNFTBulkContractMetadata/nft/metadata5020
getNFTByContractTraits/nft/{address}/nfts-by-traits50020
getNFTCollectionStats/nft/{address}/stats50050
getNFTContractMetadata/nft/{address}/metadata50020
getNFTContractSalePrices/nft/{address}/price1030
getNFTContractTransfers/nft/{address}/transfers50020
getNFTFloorPriceByContract/nft/{address}/floor-price30020
getNFTFloorPriceByToken/nft/{address}/{token_id}/floor-price30020
getNFTHistoricalFloorPriceByContract/nft/{address}/floor-price/historical50020
getNFTMetadata/nft/{address}/metadata20020
getNFTs/{address}/nft10020
getNFTSalePrices/nft/{address}/{token_id}/price30030
getNFTTokenIdOwners/nft/{address}/{token_id}/owners50020
getNFTTrades/nft/{address}/trades40020
getNFTTradesByToken/nft/{address}/{token_id}/trades40020
getNFTTradesByWallet/wallets/{address}/nfts/trades40020
getNFTTraitsByCollection/nft/{address}/traits50020
getNFTTraitsByCollectionPaginate/nft/{address}/nfts-by-traits10010
getNFTTransfers/{address}/nft/transfers20020
getPairAddress/pairs/{address}/address1020
getPairCandlesticks/pairs/{address}/ohlcv150020
getPairReserves/{pair_address}/reserves10010
getPairStats/pairs/:address/stats100020
getSnipersByPairAddress/pair/:address/snipers50020
getSwapsByPairAddress/pair/:address/swaps50020
getSwapsByTokenAddress/erc20/:address/swaps50020
getSwapsByWalletAddress/wallets/:address/swaps50020
getTimeSeriesTokenAnalytics/tokens/analytics/timeseries200020
getTimeSeriesVolume/volume/timeseries150020
getTimeSeriesVolumeByCategory/volume/timeseries/{category}150020
getTokenAnalytics/tokens/:tokenAddress/analytics80050
getTokenBondingStatus/token/{address}/bonding-status1020
getTokenHolders/erc20/:token_address/owners50020
getTokenMetadata/erc20/metadata10020
getTokenMetadataBySymbol/erc20/metadata/symbols10010
getTokenOwners/erc20/{address}/owners50020
getTokenPairs/erc20/{address}/pairs50020
getTokenPrice/erc20/{address}/price50020
getTokenStats/erc20/{address}/stats50050
getTokenTransfers/{address}/erc20/transfers50020
getTopGainersTokens/discovery/tokens/top-gainers2500250
getTopLosersTokens/discovery/tokens/top-losers2500250
getTopProfitableWalletPerToken/erc20/{address}/top-gainers50050
getTransaction/transaction/{transaction_hash}10010
getTransactionVerbose/transaction/{transaction_hash}/verbose20010
getTrendingTokens/discovery/tokens/trending1500250
getUniqueOwnersByCollection/nft/{address}/owners50020
getVolumeStatsByCategory/volume/categories150020
getVolumeStatsByChain/volume/chains150020
getWalletActiveChains/wallets/{address}/chains50+50 CUs per chains50
getWalletHistory/wallets/{address}/history150030
getWalletNetWorth/wallets/{address}/net-worth250+250 CUs per chains50
getWalletNFTCollections/nft/{address}/collections50020
getWalletNFTs/{address}/nft50020
getWalletNFTTransfers/{address}/nft/transfers50020
getWalletProfitability/wallets/{address}/profitability50020
getWalletProfitabilitySummary/wallets/{address}/profitability/summary30020
getWalletStats/wallets/{address}/stats50050
getWalletTokenApprovals/wallets/{address}/approvals100020
getWalletTokenBalances/{address}/erc20100020
getWalletTokenBalancesPrice/{address}/tokens100020
getWalletTokenTransfers/{address}/erc20/transfers50020
getWalletTransactions/{address}30020
getWalletTransactionsVerbose/{address}/verbose50020
resolveAddress/resolve/{address}/reverse10010
resolveAddressToDomain/resolve/{address}/domain10010
resolveDomain/resolve/{domain}10010
resolveENSDomain/resolve/ens/{domain}10010
reSyncMetadata/nft/{address}/{token_id}/metadata/resync50050
resyncNFTTrait/nft/{address}/traits/resync10010
searchEntities/entities/search50020
searchTokens/tokens/search150050
syncNFTContract/nft/{address}/sync50050
web3ApiVersion/web3/version1001

Dynamic Prices

Some endpoints have a dynamically priced CU cost based on the number of resources being requested. The more resources being requested, the higher the CU cost for that particular request. Taking getNativeBalancesForAddresses as an example; the base CU cost of this endpoint when fetching the balance of a single address is 10 CU. If we wanted to fetch the balances of 5 addresses at once, then the CU cost for that particular call would be 50 CU.

Query Parameters

In addition to having compute units charged on each API request, there are additional query parameters that cost additional compute units when added to an API request.

Query parameterCU Cost
include=internal_transactions on /{address}50
include=internal_transactions on /transaction/{transaction_hash}30
include=internal_transactions on /block/{block_number_or_hash}100

How to Check Compute Units?

To check the latest compute units of our API offerings, you can use endpointWeights to do so.

const Moralis = require("moralis").default;

await Moralis.start({
apiKey: "YOUR_API_KEY",
// ...and any other configuration
});

const response = await Moralis.EvmApi.utils.endpointWeights();

console.log(response?.toJSON());

Your output for the API request will be as follows:

[
{
"endpoint": "getBlock",
"path": "/block/{block_number_or_hash}",
"price": 100,
"rateLimitCost": 20
},
{
"endpoint": "getContractEvents",
"path": "/{address}/events",
"price": 20,
"rateLimitCost": 20
},
{
"endpoint": "getTransaction",
"path": "/transaction/{transaction_hash}",
"price": 10,
"rateLimitCost": 10
}
]

where price refers to how much CU does the API request cost in terms of billing and rateLimitCost refers to how much CU does the API request cost in terms of rate limits.

Streams and Compute Units

For Moralis Streams, it is important to note that each record has a fixed cost of 10 Compute Units.

tip

You can read the article Records and Pricing to understand how records play a crucial role in the Streams API, allowing you to make the right decisions regarding usage and pricing.