Skip to main content
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}202
getAccountModules/accounts/{address}/modules202
getAccountModule/accounts/{address}/resource/{module}202
getAccountResources/accounts/{address}/resources202
getAccountResource/accounts/{address}/resource/{resource_type}202
getAccountTransactions/accounts/{address}/transactions303
getBlockByHeight/blocks/{block_height}202
getBlockByVersion/blocks/by_version/{version}202
getEventsByCreationNumber/accounts/{address}/events/{creation_number}202
getEventsByEventHandle/accounts/{address}/events/{event_handle}/{field_name}202
getTransactions/transactions303
getTransactionsByHash/transactions/by_hash/{txn_hash}202
getTransactionsByVersion/transactions/by_version/{txn_version}202
simulateTransaction/transactions/simulate303
submitTransaction/transactions202
submitBatchTransactions/transactions/batch505
encodeSubmission/transactions/encode_submission202
estimateGasPrice/transactions/estimate_gas_price202
getNFTsById/nfts3+3 CUs per token_ids3
getNFTsByCollection/nfts/collections/{collection_data_id_hash}/tokens505
getNFTsByCreators/nfts/creators5+5 CUs per creator_addresses5
getNFTCollections/collections303
getNFTCollectionsById/collections/ids5+5 CUs per ids5
getNFTCollectionsByCreator/collections/creators5+5 CUs per creator_addresses5
getNFTOwnersByCollection/nfts/collections/{collection_data_id_hash}/owners505
getNFTOwnersByToken/nfts/owners5+5 CUs per token_ids5
getNFTOwnersOfCollection/nfts/collections/{collection_data_id_hash}/owners/list505
getNFTTransfersByIds/nfts/transfers3+3 CUs per token_ids3
getNFTTransfersByCollection/nfts/transfers/collections/:collection_data_id_hash505
getNFTTransfersByCreators/nfts/transfers/creators5+5 CUs per creator_addresses5
getNFTTransfersByWallets/nfts/transfers/wallets5+5 CUs per wallet_addresses5
getCoinInfoByCoinTypeHashes/coins3+3 CUs per coin_type_hashes3
getLatestCoins/coins/latest303
getCoinsByNameRange/coins/names505
getCoinsBySymbolRange/coins/symbols505
getCoinsByCreators/coins/creators5+5 CUs per creator_addresses5
getCoinTransfersByCoinType/coins/transfers/{coin_type}505
getCoinTransfersByOwnerAddresses/coins/transfers/wallets5+5 CUs per owner_addresses5
getCoinTransferByBlockHeights/coins/transfers/blocks5+5 CUs per undefined5
getCoinTransfersByWalletAddresses/wallets/coins/transfers5+5 CUs per wallet_addresses5
getTopHoldersByCoin/coins/owners/{coin_type_hash}/top-holders505
getCoinBalancesByWallets/wallets/coins3+3 CUs per owner_addresses3
getHistoricalCoinBalancesByWallets/wallets/coins/history10+10 CUs per owner_addresses10
getWalletNFTTransfers/wallets/nfts/transfers5+5 CUs per owner_addresses5

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.