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
Version: 2.0

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
getPortfolio/account/{network}/{address}/portfolio10010
getSPL/account/{network}/{address}/tokens10010
getNFTs/account/{network}/{address}/nft10010
getNFTMetadata/nft/{network}/{address}/metadata10010
getTokenMetadata/token/{network}/{address}/metadata10010
getTokenPrice/token/{network}/{address}/price10010
getCandleSticks/token/{network}/pairs/{pairAddress}/ohlcv1500150
getTokenPairs/token/{network}/{address}/pairs50050
getTokenPairStats/token/{network}/{address}/pairs/{pairAddress}/stats50050
getAggregatedTokenPairStats/token/{network}/{address}/pairs/stats1000100
getSnipersByPairAddress/pairs/{address}/snipers50050
getSwapsByPairAddress/token/{network}/pairs/{pairAddress}/swaps50050
getSwapsByWalletAddress/account/{network}/{walletAddress}/swaps50050
getSwapsByTokenAddress/token/{network}/{tokenAddress}/swaps50050
getNewTokensByExchange/token/mainnet/exchange/:exchange/new50050
getBondingTokensByExchange/token/mainnet/exchange/:exchange/bonding50050
getGraduatedTokensByExchange/token/mainnet/exchange/:exchange/graduated50050
getTokenBondingStatus/token/mainnet/:tokenAddress/bonding-status50050
getVolumeStatsByChain/volume/chains150020
getVolumeStatsByCategory/volume/categories150020
getTimeSeriesVolume/volume/timeseries150020
getTimeSeriesVolumeByCategory/volume/timeseries/{category}150020
getTokenAnalytics/tokens/:tokenAddress/analytics80050
getMultipleTokenAnalytics/tokens/analytics150050
getTimeSeriesTokenAnalytics/tokens/analytics/timeseries200020
getFilteredTokens/discovery/tokens250050
searchTokens/tokens/search150050
getTrendingTokens/discovery/tokens/trending250050
getTokenHolderStats/token/mainnet/holders/:address50020
getHistoricalTokenHolders/token/mainnet/holders/:address/historical50020

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.