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.2

Aptos 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
getAccount/accounts/{address}20020
getAccountModules/accounts/{address}/modules20020
getAccountModule/accounts/{address}/resource/{module}20020
getAccountResources/accounts/{address}/resources20020
getAccountResource/accounts/{address}/resource/{resource_type}20020
getAccountTransactions/accounts/{address}/transactions30030
getBlockByHeight/blocks/{block_height}20020
getBlockByVersion/blocks/by_version/{version}20020
getEventsByCreationNumber/accounts/{address}/events/{creation_number}20020
getEventsByEventHandle/accounts/{address}/events/{event_handle}/{field_name}20020
getTransactions/transactions30030
getTransactionsByHash/transactions/by_hash/{txn_hash}20020
getTransactionsByVersion/transactions/by_version/{txn_version}20020
simulateTransaction/transactions/simulate30030
submitTransaction/transactions20020
submitBatchTransactions/transactions/batch50050
encodeSubmission/transactions/encode_submission20020
estimateGasPrice/transactions/estimate_gas_price20020
getNFTsById/nfts30+30 CUs per token_ids30
getNFTsByCollection/nfts/collections/{collection_data_id_hash}/tokens50050
getNFTsByCreators/nfts/creators50+50 CUs per creator_addresses50
getNFTCollections/collections30030
getNFTCollectionsById/collections/ids50+50 CUs per ids50
getNFTCollectionsByCreator/collections/creators50+50 CUs per creator_addresses50
getNFTOwnersByCollection/nfts/collections/{collection_data_id_hash}/owners50050
getNFTOwnersByToken/nfts/owners50+50 CUs per token_ids50
getNFTOwnersOfCollection/nfts/collections/{collection_data_id_hash}/owners/list50050
getNFTTransfersByIds/nfts/transfers30+30 CUs per token_ids30
getNFTTransfersByCollection/nfts/transfers/collections/:collection_data_id_hash50050
getNFTTransfersByCreators/nfts/transfers/creators50+50 CUs per creator_addresses50
getNFTTransfersByWallets/nfts/transfers/wallets50+50 CUs per wallet_addresses50
getCoinInfoByCoinTypeHashes/coins30+30 CUs per coin_type_hashes30
getLatestCoins/coins/latest30030
getCoinsByNameRange/coins/names50050
getCoinsBySymbolRange/coins/symbols50050
getCoinsByCreators/coins/creators50+50 CUs per creator_addresses50
getCoinTransfersByCoinType/coins/transfers/{coin_type}50050
getCoinTransfersByOwnerAddresses/coins/transfers/wallets50+50 CUs per owner_addresses50
getCoinTransferByBlockHeights/coins/transfers/blocks50+50 CUs per undefined50
getCoinTransfersByWalletAddresses/wallets/coins/transfers50+50 CUs per wallet_addresses50
getTopHoldersByCoin/coins/owners/{coin_type_hash}/top-holders50050
getCoinBalancesByWallets/wallets/coins30+30 CUs per owner_addresses30
getHistoricalCoinBalancesByWallets/wallets/coins/history100+100 CUs per owner_addresses100
getWalletNFTTransfers/wallets/nfts/transfers50+50 CUs per owner_addresses50

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.