Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old developer portal.

Costs & Constraints

MBR

The Minimum Balance Requirement (MBR) in Algorand refers to the minimum amount of Algos that an account must hold. This requirement is affected by various factors such as the creation or ownership of Algorand Standard Assets (ASAs), opting into or out of applications, and the storage of additional data.

TypeMinimum BalanceDescription
Basic Account0.1 AlgoIf ever a transaction is sent that will result in a balance lower than the minimum; the transaction will fail
Opting into ASA+0.1 AlgoIncreases: Opting into assets or applications, storing additional data (e.g., boxes in smart contracts)
Opting out ASA-0.1 AlgoDecreases: Opting out of assets or applications, removing stored data
Smart Contracts0.1 Algo upon creationAdditional Increases: Based on state schema and number of extra program pages

For eg. for a basic account the minimum balance requirement is 0.1 Algo

mbr for basic account #1

Now if this account creates an asset like below:

mbr for basic account #1

The min balance of the account increases by 0.1 Algos and now the minimum balance is 0.2 Algos

mbr for basic account #1

Program Constraints

Program Size Limits

TypeConstraint
Logic SignaturesMax size: 1000 bytes for logic signatures (consensus parameter LogicSigMaxSize). Components: The bytecode plus the length of all arguments
Smart ContractsMax size: 2048*(1+ExtraProgramPages) bytes Components: ApprovalProgram + ClearStateProgram

Application Call Arguments

ParameterConstraint
Number of ArgumentsMaximum 16 arguments can be passed to an application call. This limit is defined by the consensus parameter MaxAppArgs
Combined Size of ArgumentsThe maximum combined size of arguments is 2048 bytes. This limit is defined by the consensus parameter MaxAppTotalArgLen
Max Size of Compiled TEAL CodeThe maximum size of compiled TEAL code combined with arguments is 1000 bytes. This limit is defined by the consensus parameter LogicSigMaxSize
Max Cost of TEAL CodeThe maximum cost of TEAL code is 20000 for logic signatures and 700 for smart contracts. These limits are defined by the consensus parameters LogicSigMaxCost and MaxAppProgramCost respectively
Argument TypesThe arguments to pass to the ABI call can be one of the following types: boolean, number, bigint, string, Uint8Array, an array of one of the above types, algosdk.TransactionWithSigner, TransactionToSign, algosdk.Transaction, Promise<SendTransactionResult>. These types are used when specifying the ABIAppCallArgs for an application call

Opcode Constraints

In Algorand, the opcode budget measures the computational cost of executing a smart contract or logic signature. Each opcode (operation code) in the Algorand Virtual Machine (AVM) has an associated cost deducted from the opcode budget during execution.

ParameterConstraint
Cost of OpcodesMost opcodes have a computational cost of 1. Some operations (e.g., SHA256, keccak256, sha512_256, ed25519verify) have larger costs.
Budget ConstraintsMax opcode budget: Smart signatures: 20,000 units Smart contracts invoked by a single application transaction: 700 units. If invoked via a group: 700 * number of application transactions.
Clear State ProgramsInitial pooled budget must be >= 700 units or higher. Execution limit: 700 units.

Note: Algorand Python provides a helper method for increasing the available opcode budget, see algopy.ensure_budget.

Stack

In Algorand’s Algorand Virtual Machine (AVM), the stack is a key component of the execution environment.

ParameterConstraint
Maximum Stack Depth1000. If the stack depth is exceeded, the program fails.
Item Size LimitsThe stack can contain values of either uint64 or byte-arrays. Byte-arrays may not exceed 4096 bytes in length.
Type LimitationEvery element of the stack is restricted to the types uint64 and bytes.
Item Size LimitMaximum size for byte arrays is 4096 bytes. Maximum value uint64 is 18446744073709551615.
Operation FailureFails if an opcode accesses a position in the stack that does not exist.

Resources

In Algorand, the access and usage of resources such as account balance/state, application state, etc., by applications are subject to certain constraints and costs:

Resource Access Limit

AspectConstraint
Access RestrictionsLimited access to resources like account balance and application state to ensure efficient block evaluation.
Specification RequirementResources must be specified within the transaction for nodes to pre-fetch data.

Transaction Fees

AttributeDetails
Minimum Fee0.001 Algo per transaction, regardless of type.
Payment ConditionFees are only paid if the transaction is included in a block.

Smart Contract Constraints

Constraint TypeDetails
Opt-In ApplicationsNo limit on the number of applications an account can opt into.
Size and Opcode LimitsMust adhere to program size and opcode budget constraints outlined in Program Constraints and Opcode Constraints.

ASA Constraints

Constraint TypeDetails
QuantityUnlimited number of Algorand Standard Assets (ASAs).
Size LimitsAsset Name: 32 bytes, Unit Name: 8 bytes, URL: 96 bytes, Metadata Hash: 32 bytes.

Access Constraints

Access TypeConstraint
Block InformationPrograms cannot access information from previous blocks.
Transaction InformationCannot access other transactions in the current block unless part of the same atomic transaction group.

Logic Signatures

ParameterConstraint
Transaction CommitmentCannot determine the exact round or time of transaction commitment.
Stateless ProgramsCannot query account balances or asset holdings. Transactions must comply with standard accounting rules and may fail if rules are violated.

AVM Environment

ParameterConstraint
Indirect JumpsNot supported; all jumps must reference specific addresses.

Storage Constraints

Storage StructureKey LengthValue LengthUnique Key RequirementAdditional DetailsSafety from Unexpected Deletion
Local State StorageUp to 64 bytesKey + value ≤ 128 bytesYesLarger datasets require partitioningNot Safe — Can be cleared by users at any time using ClearState transactions
Box Storage1 to 64 bytesUp to 32KB (32,768 bytes)YesKey does not contribute to box size and values > 1,024 bytes need additional referencesBoxes persist after app deletion but lock the minimum balance if not deleted beforehand
Global State StorageUp to 64 bytesKey + value ≤ 128 bytesYesLarger datasets require partitioningSafe — Deleted only with the application; otherwise, data is safe from unexpected deletion