Algorand transaction performance

Algorand transaction performance

Urtho
Urtho

Theoretical performance

Algorand transaction performance is limited by protocol constants.
The protocol is updated quarterly so it is important to reference a particular version and its settings when calculating maximum throughput.

As of Q4’2023 the limits are:

  • block size: 5MB
  • target block time average: 3.3 sec

To calculate maximum throughput we have to assume some average transaction data length. Algorand is used in many real-world scenarios where transactions contain an additional note, like air sensor data. This causes the average transaction length to be around 350 bytes.
On the other hand, blocks filled with DeFi transactions (application calls) have a shorter average length of 120 bytes.

With the average TX size of 120 to 350 bytes and block time of 3.3 seconds we calculate the maximum transaction throughput to be anywhere between 4500 to 13000 TPS depending on the mix of transaction types.

It is worth noting that mainnet block #25836244 with ≤4 sec block time contained 58888 transactions — this translates to 14500+ TPS.

Transaction types

DeFi transactions often spawn additional transactions that are the result of a smart contract execution. Such transactions are called inner transactions (or inners) and as an optimization do not have a full transaction ID assigned but only an offset within a block. This saves precious space in the block but does not demote the transaction in any way. Such transactions can be addressed individually with a block number and transaction offset.

Calculating historical throughput

Instead of downloading and parsing a block, it is enough to parse headers of two consecutive blocks to arrive at the transaction count per block as each block header contains both block timestamp as well as a monotonically increasing transaction count.

This protocol transaction counter includes all transaction types.

Algorand nodes are not required to have synchronized clocks and the block timestamps are rounded to 1 full second it is therefore best to calculate the throughput on 10 or 100-block intervals.

Block headers can be fetched using indexer API :

https://mainnet-idx.algonode.cloud/v2/blocks/34801047?header-only=true
https://mainnet-idx.algonode.cloud/v2/blocks/34801147?header-only=true

With headers from two blocks 34801047 and 34801147 one can infer that

  • the transaction counter difference is 1170701
  • timestamp difference is 362 seconds.

This translates to an average throughput of 3234 TPS over 100 blocks.

Inner transactions in this block range constituted 0.2% of all transactions.