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
API | Endpoint | Base Fee | ICs to consider |
---|---|---|---|
Logs | Get Logs | 8 | topics, op_code, range, limit |
Logs | Get Decoded Logs | 12 | topics, op_code, range, limit |
Logs | Get CSV Export | 8 | topics, op_code, range, cu_limit |
Internal Transactions | Get Internal Transactions | 8 | topics, op_code, range, limit |
Internal Transactions | Get Decoded Internal Transactions | 12 | topics, op_code, range, limit |
Blocks | Get Latest Block | 4 | |
Blocks | Get Blocks | 6 | |
Transactions | Get Wallet Transactions | 32 | range, limit |
Transactions | Get Transaction by Hash | 6 | |
Transactions | Get Transaction Internals | 16 | |
Transfers | Get Wallet Transfers | 32 | asset_type, range, limit |
Transfers | Get Token Transfers | 32 | asset_type, range, limit |
Contracts | Get Contracts Self-Destructions | 6 | range, limit |
Contracts | Get Contracts Creations | 6 | range, limit |
Web3Hooks | Create Hook | 01 | |
Web3Hooks | Get Hook | 0 | |
Web3Hooks | List Hooks | 0 | |
Web3Hooks | Delete Hook | 0 | |
Transaction Lifecycle | Create Tx Hook | 32 | |
Transaction Lifecycle | Get Tx Hook | 0 | |
Transaction Lifecycle | List Tx Hooks | 0 | |
Transaction Lifecycle | Delete Tx Hook | 0 | |
NFT | Get NFT by Address | 16 | metadata, sale_prices, limit |
NFT | Get NFT History by Address | 16 | metadata, sale_prices, limit |
NFT | Get NFT History | 16 | metadata, sale_prices, limit |
NFT | Get NFT Metadata | 16 | metadata, sale_prices, limit |
NFT | Get Collection Metadata | 8 | |
NFT | Get NFT Collection Holders | 16 | metadata, sale_prices, limit |
Balances | Get Balances by Address | 16 | |
Balances | Get Balances by Contract | 16 | |
Balances | Get Contract Metadata | 16 |
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
.
Parameters | Topic cost (in CUs) |
---|---|
contract=0x00 | 0 |
contract=0x000&origin=0x0001 | 0 |
contract=0x00&topic0=val0 | 16 |
contract=0x00&topic0=val0,val1 | 18 |
contract=0x000&topic0=val0,val1&topic2=val0 | 34 |
contract=0x000&topic0=val0,val1&topic2=val0,val1,val2 | 38 |
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:
Range | Example | Multiplier |
---|---|---|
[1;1] | block_start=1&block_end=1 | 1 |
[1;1,000,000] | block_start=1&block_end=1,000,000 | 4 |
[1;1,000,001] | block_start=1&block_end=1,000,001 | 8 |
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.
Parameters | Asset type cost (in CUs) |
---|---|
asset_type=ft | 0 |
asset_type=ft,nft | 32 |
asset_type=ft,nft,multi | 64 |
asset_type=ft,nft,multi,native | 96 |
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.
Name | Value |
---|---|
Ethereum Mainnet | 1.0 |
Polygon PoS | 1.0 |
Polygon zkEVM | 1.0 |
BNB Smart Chain Mainnet | 1.0 |
Avalanche C-Chain | 1.0 |
Arbitrum One | 1.0 |
Metis Andromeda | 1.0 |
Ethereum Sepolia | 1.0 |
Ethereum Holešky | 1.0 |
BNB Smart Chain Testnet | 1.0 |
opBNB Testnet | 1.0 |
Arbitrum Sepolia | 1.0 |
Polygon Amoy | 1.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
-
Each item of your Web3Hooks delivery costs 4 CUs. ↩