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

Solana 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 is a measure of the requests needed to query computationally expensive API endpoints. Each request has both price and rate limit cost that are measured in terms of compute units. 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.

Price

Request price refers to the amount of compute units that will be calculated towards your API usage billing.

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 1 CU. If we wanted to fetch the balances of 5 addresses at once, then the CU cost for that particular call would be 5 CU.

Rate limit Cost

On the other hand, request rate limit cost refers to the amount of compute units that an API request cost in terms of rate limits.

NamePathPriceRate Limit Cost
BaseAdditional
balance/account/{network}/{address}/balance10010
getAggregatedTokenPairStats/token/{network}/{address}/pairs/stats500100
getBondingTokensByExchange/token/mainnet/exchange/:exchange/bonding1050
getCandleSticks/token/{network}/pairs/{pairAddress}/ohlcv1500150
getFilteredTokens/discovery/tokens250050
getGraduatedTokensByExchange/token/mainnet/exchange/:exchange/graduated1050
getHistoricalTokenHolders/token/mainnet/holders/:address/historical50020
getMultipleTokenAnalytics/tokens/analytics150050
getMultipleTokenPrices/token/:network/prices100020
getNewTokensByExchange/token/mainnet/exchange/:exchange/new1050
getNFTMetadata/nft/{network}/{address}/metadata20010
getNFTs/account/{network}/{address}/nft10010
getPairStats/token/:network/{address}/pairs/:pairAddress/stats100020
getPortfolio/account/{network}/{address}/portfolio10010
getSnipersByPairAddress/pairs/{address}/snipers50050
getSPL/account/{network}/{address}/tokens10010
getSwapsByPairAddress/token/{network}/pairs/{pairAddress}/swaps50050
getSwapsByTokenAddress/token/{network}/{tokenAddress}/swaps50050
getSwapsByWalletAddress/account/{network}/{walletAddress}/swaps50050
getTimeSeriesTokenAnalytics/tokens/analytics/timeseries200020
getTimeSeriesVolume/volume/timeseries150020
getTimeSeriesVolumeByCategory/volume/timeseries/{category}150020
getTokenAnalytics/tokens/:tokenAddress/analytics80050
getTokenBondingStatus/token/mainnet/:tokenAddress/bonding-status1050
getTokenHolders/token/:network/holders/:address50020
getTokenMetadata/token/{network}/{address}/metadata10010
getTokenPairs/token/{network}/{address}/pairs50050
getTokenPrice/token/{network}/{address}/price50010
getTopHolders/token/:network/holders/:address50020
getTrendingTokens/discovery/tokens/trending150050
getVolumeStatsByCategory/volume/categories150020
getVolumeStatsByChain/volume/chains150020
searchTokens/tokens/search150050

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": 5,
"rateLimitCost": 5
},
{
"endpoint": "getContractEvents",
"path": "/{address}/events",
"price": 2,
"rateLimitCost": 2
},
{
"endpoint": "getTransactions",
"path": "/transaction/{transaction_hash}",
"price": 1,
"rateLimitCost": 3
}
]

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.