Computational Units
Overview
computational-units

Overview

To ensure clarity and consistency in pricing for our API, we have introduced the concept of a computational unit (CU). This serves as a standard unit of measurement for estimating the cost of a request within our product.

CU Cost Calculation

The CU cost of a request is determined by using the following formula:

total CUs = (base fee + input complexity) / blockchain complexity

To better understand the components of the formula, see the sections below.

Base Fee

The processing complexity fee is charged for each endpoint based on various actions involved in handling a request, such as extraction, processing, storage, activation, and delivery. Each of these actions is considered to consume 1 CU. The processing complexity fee is determined before implementing an endpoint and remains constant even in minor version updates.

Base Fee Costs

APIEndpointBase FeeICs to consider
LogsGet Logs8topics, op_code, range, limit
LogsGet Decoded Logs12topics, op_code, range, limit
LogsGet CSV Export8topics, op_code, range, cu_limit
Internal TransactionsGet Internal Transactions8topics, op_code, range, limit
Internal TransactionsGet Decoded Internal Transactions12topics, op_code, range, limit
BlocksGet Latest Block4
BlocksGet Blocks6
TransactionsGet Wallet Transactions32range, limit
TransactionsGet Transaction by Hash6
TransactionsGet Transaction Internals16
TransfersGet Wallet Transfers32asset_type, range, limit
TransfersGet Token Transfers32asset_type, range, limit
ContractsGet Contracts Self-Destructions6range, limit
ContractsGet Contracts Creations6range, limit
Web3HooksCreate Hook01
Web3HooksGet Hook0
Web3HooksList Hooks0
Web3HooksDelete Hook0
Transaction LifecycleCreate Tx Hook32
Transaction LifecycleGet Tx Hook0
Transaction LifecycleList Tx Hooks0
Transaction LifecycleDelete Tx Hook0
NFTGet NFT by Address16metadata, sale_prices, limit
NFTGet NFT History by Address16metadata, sale_prices, limit
NFTGet NFT History16metadata, sale_prices, limit
NFTGet NFT Metadata16metadata, sale_prices, limit
NFTGet Collection Metadata8
NFTGet NFT Collection Holders16metadata, sale_prices, limit
BalancesGet Balances by Address16
BalancesGet Balances by Contract16
BalancesGet Contract Metadata16

Input Complexity

The input complexity (IC) measures how complex a user's request becomes based on their inputs. It primarily applies to raw data requests for most endpoints. Base inputs, such as origin, contract, and op_code, are already included in the base cost and will not incur additional CU costs. However, other factors, such as topics, range, and asset_type, can increase the IC and incur additional charges.

The IC cost is determined by using the following formula:

input complexity = (topic complexity + asset type complexity) * range complexity

Where the costs of topic complexity, asset type complexity, and range complexity are calculated as follows:

topic complexity = (amount of topics in the field - 1) * 2 + 16 for each separate topic (topic 0, topic 1, etc.)

asset type complexity = if (asset type amount > 1) -> (amount of types - 1) * 32; else 0

range complexity = 1 block: 1; 2-1,000,000: 4; >1,000,000: 8

Topics

Topics play a significant role in determining the IC cost. The more topics you provide, the more expensive the request will get. Introducing topics by adding topicN to the query incurs a cost of CUtopic_introduction. Each additional value added to the topicN array incurs an extra charge of CUtopic_value.

ParametersTopic cost (in CUs)
contract=0x00 0
contract=0x000&origin=0x00010
contract=0x00&topic0=val016
contract=0x00&topic0=val0,val118
contract=0x000&topic0=val0,val1&topic2=val034
contract=0x000&topic0=val0,val1&topic2=val0,val1,val238

Ranges

When sending a request, the specified range values will also affect the IC. The cost of range complexity is determined by the range given and can be calculated in the following manner:

RangeExampleMultiplier
[1;1]block_start=1&block_end=11
[1;1,000,000]block_start=1&block_end=1,000,0004
[1;1,000,001]block_start=1&block_end=1,000,0018

Asset type

The endpoints with the asset_type parameter increase difficulty when introducing a new asset type. One asset type is always included with the base fee of the request. Submitting a new asset type should add CUasset_type to the price of the request.

ParametersAsset type cost (in CUs)
asset_type=ft0
asset_type=ft,nft32
asset_type=ft,nft,multi64
asset_type=ft,nft,multi,native96

Blockchain complexity

When calculating the CU cost, the complexity of the blockchain being queried is multiplied by a factor called blockchain complexity. Below is a list of our available blockchains and their corresponding BC value, usually set to 1.0.

NameValue
Ethereum Mainnet1.0
Polygon PoS1.0
Polygon zkEVM1.0
BNB Smart Chain Mainnet1.0
Avalanche C-Chain1.0
Arbitrum One1.0
Metis Andromeda1.0
Ethereum Sepolia1.0
Ethereum Holešky1.0
BNB Smart Chain Testnet1.0
opBNB Testnet1.0
Arbitrum Sepolia1.0
Polygon Amoy1.0

You can determine the pricing for various requests by understanding how to calculate CU costs. To estimate the CU of your requests, consider the base fee, input complexity, and blockchain complexity.


Footnotes

  1. Each item of your Web3Hooks delivery costs 4 CUs.