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

Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round.

POST
/v2/transactions/simulate

Authorizations

Parameters

Query Parameters

format
string
Allowed values: json msgpack

Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Request Body required

The transactions to simulate, along with any other inputs.

Request type for simulation endpoint.

object
allow-empty-signatures

Allows transactions without signatures to be simulated as if they had correct signatures.

boolean
allow-more-logging

Lifts limits on log opcode usage during simulation.

boolean
allow-unnamed-resources

Allows access to unnamed resources during simulation.

boolean
exec-trace-config

An object that configures simulation execution trace.

object
enable

A boolean option for opting in execution trace features simulation endpoint.

boolean
scratch-change

A boolean option enabling returning scratch slot changes together with execution trace during simulation.

boolean
stack-change

A boolean option enabling returning stack changes together with execution trace during simulation.

boolean
state-change

A boolean option enabling returning application state changes (global, local, and box changes) with the execution trace during simulation.

boolean
extra-opcode-budget

Applies extra opcode budget during simulation for each transaction group.

integer
fix-signers

If true, signers for transactions that are missing signatures will be fixed during evaluation.

boolean
round

If provided, specifies the round preceding the simulation. State changes through this round will be used to run this simulation. Usually only the 4 most recent rounds will be available (controlled by the node config value MaxAcctLookback). If not specified, defaults to the latest available round.

integer
txn-groups
required

The transaction groups to simulate.

Array<object>

A transaction group to simulate.

object
txns
required

An atomic transaction group.

Array<string>

Responses

200

Result of a transaction group simulation.

object
eval-overrides

The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways.

object
allow-empty-signatures

If true, transactions without signatures are allowed and simulated as if they were properly signed.

boolean
allow-unnamed-resources

If true, allows access to unnamed resources during simulation.

boolean
extra-opcode-budget

The extra opcode budget added to each transaction group during simulation

integer
fix-signers

If true, signers for transactions that are missing signatures will be fixed during evaluation.

boolean
max-log-calls

The maximum log calls one can make during simulation

integer
max-log-size

The maximum byte number to log during simulation

integer
exec-trace-config

An object that configures simulation execution trace.

object
enable

A boolean option for opting in execution trace features simulation endpoint.

boolean
scratch-change

A boolean option enabling returning scratch slot changes together with execution trace during simulation.

boolean
stack-change

A boolean option enabling returning stack changes together with execution trace during simulation.

boolean
state-change

A boolean option enabling returning application state changes (global, local, and box changes) with the execution trace during simulation.

boolean
initial-states

Initial states of resources that were accessed during simulation.

object
app-initial-states

The initial states of accessed application before simulation. The order of this array is arbitrary.

Array<object>

An application’s initial global/local/box states that were accessed during simulation.

object
app-boxes

An application’s global/local/box state.

object
account

The address of the account associated with the local state.

string
kvs
required

Key-Value pairs representing application states.

Array<object>

Represents an AVM key-value pair in an application store.

object
key
required
string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
app-globals

An application’s global/local/box state.

object
account

The address of the account associated with the local state.

string
kvs
required

Key-Value pairs representing application states.

Array<object>

Represents an AVM key-value pair in an application store.

object
key
required
string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
app-locals

An application’s initial local states tied to different accounts.

Array<object>

An application’s global/local/box state.

object
account

The address of the account associated with the local state.

string
kvs
required

Key-Value pairs representing application states.

Array<object>

Represents an AVM key-value pair in an application store.

object
key
required
string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
id
required

Application index.

integer
last-round
required

The round immediately preceding this simulation. State changes through this round were used to run this simulation.

integer
txn-groups
required

A result object for each transaction group that was simulated.

Array<object>

Simulation result for an atomic transaction group

object
app-budget-added

Total budget added during execution of app calls in the transaction group.

integer
app-budget-consumed

Total budget consumed during execution of app calls in the transaction group.

integer
failed-at

If present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions.

Array<integer>
failure-message

If present, indicates that the transaction group failed and specifies why that happened

string
txn-results
required

Simulation result for individual transactions

Array<object>

Simulation result for an individual transaction

object
app-budget-consumed

Budget used during execution of an app call transaction. This value includes budged used by inner app calls spawned by this transaction.

integer
exec-trace

The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way.

object
approval-program-hash

SHA512_256 hash digest of the approval program executed in transaction.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
approval-program-trace

Program trace that contains a trace of opcode effects in an approval program.

Array<object>

The set of trace information and effect from evaluating a single opcode.

object
pc
required

The program counter of the current opcode being evaluated.

integer
scratch-changes

The writes into scratch slots.

Array<object>

A write operation into a scratch slot.

object
new-value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
slot
required

The scratch slot written.

integer
spawned-inners

The indexes of the traces for inner transactions spawned by this opcode, if any.

Array<integer>
stack-additions

The values added by this opcode to the stack.

Array<object>

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
stack-pop-count

The number of deleted stack values by this opcode.

integer
state-changes

The operations against the current application’s states.

Array<object>

An operation against an application’s global/local/box state.

object
account

For local state changes, the address of the account associated with the local state.

string
app-state-type
required

Type of application state. Value g is global state, l is local state, b is boxes.

string
key
required

The key (name) of the global/local/box state.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
new-value

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
operation
required

Operation type. Value w is write, d is delete.

string
clear-state-program-hash

SHA512_256 hash digest of the clear state program executed in transaction.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
clear-state-program-trace

Program trace that contains a trace of opcode effects in a clear state program.

Array<object>

The set of trace information and effect from evaluating a single opcode.

object
pc
required

The program counter of the current opcode being evaluated.

integer
scratch-changes

The writes into scratch slots.

Array<object>

A write operation into a scratch slot.

object
new-value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
slot
required

The scratch slot written.

integer
spawned-inners

The indexes of the traces for inner transactions spawned by this opcode, if any.

Array<integer>
stack-additions

The values added by this opcode to the stack.

Array<object>

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
stack-pop-count

The number of deleted stack values by this opcode.

integer
state-changes

The operations against the current application’s states.

Array<object>

An operation against an application’s global/local/box state.

object
account

For local state changes, the address of the account associated with the local state.

string
app-state-type
required

Type of application state. Value g is global state, l is local state, b is boxes.

string
key
required

The key (name) of the global/local/box state.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
new-value

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
operation
required

Operation type. Value w is write, d is delete.

string
clear-state-rollback

If true, indicates that the clear state program failed and any persistent state changes it produced should be reverted once the program exits.

boolean
clear-state-rollback-error

The error message explaining why the clear state program failed. This field will only be populated if clear-state-rollback is true and the failure was due to an execution error.

string
inner-trace
Array<object> recursive
logic-sig-hash

SHA512_256 hash digest of the logic sig executed in transaction.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
logic-sig-trace

Program trace that contains a trace of opcode effects in a logic sig.

Array<object>

The set of trace information and effect from evaluating a single opcode.

object
pc
required

The program counter of the current opcode being evaluated.

integer
scratch-changes

The writes into scratch slots.

Array<object>

A write operation into a scratch slot.

object
new-value
required

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
slot
required

The scratch slot written.

integer
spawned-inners

The indexes of the traces for inner transactions spawned by this opcode, if any.

Array<integer>
stack-additions

The values added by this opcode to the stack.

Array<object>

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
stack-pop-count

The number of deleted stack values by this opcode.

integer
state-changes

The operations against the current application’s states.

Array<object>

An operation against an application’s global/local/box state.

object
account

For local state changes, the address of the account associated with the local state.

string
app-state-type
required

Type of application state. Value g is global state, l is local state, b is boxes.

string
key
required

The key (name) of the global/local/box state.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
new-value

Represents an AVM value.

object
bytes

Bytes value.

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
type
required

Value type. Value 1 refers to bytes, value 2 refers to uint64

integer
uint

Uint value.

integer
operation
required

Operation type. Value w is write, d is delete.

string
fixed-signer

The account that needed to sign this transaction when no signature was provided and the provided signer was incorrect.

string
logic-sig-budget-consumed

Budget used during execution of a logic sig transaction.

integer
txn-result
required

Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.

object
application-index

The application index if the transaction was found and it created an application.

integer
asset-closing-amount

The number of the asset’s unit that were transferred to the close-to address.

integer
asset-index

The asset index if the transaction was found and it created an asset.

integer
close-rewards

Rewards in microalgos applied to the close remainder to account.

integer
closing-amount

Closing amount for the transaction.

integer
confirmed-round

The round where this transaction was confirmed, if present.

integer
global-state-delta

Application state delta.

Array<object>

Key-value pairs for StateDelta.

object
key
required
string
value
required

Represents a TEAL value delta.

object
action
required

[at] delta action.

integer
bytes

[bs] bytes value.

string
uint

[ui] uint value.

integer
inner-txns
Array<object> recursive
local-state-delta

Local state key/value changes for the application being executed by this transaction.

Array<object>

Application state delta.

object
address
required
string
delta
required

Application state delta.

Array<object>

Key-value pairs for StateDelta.

object
key
required
string
value
required

Represents a TEAL value delta.

object
action
required

[at] delta action.

integer
bytes

[bs] bytes value.

string
uint

[ui] uint value.

integer
logs

Logs for the application being executed by this transaction.

Array<string>
pool-error
required

Indicates that the transaction was kicked out of this node’s transaction pool (and specifies why that happened). An empty string indicates the transaction wasn’t kicked out of this node’s txpool due to an error.

string
receiver-rewards

Rewards in microalgos applied to the receiver account.

integer
sender-rewards

Rewards in microalgos applied to the sender account.

integer
txn
required

The raw signed transaction.

object
unnamed-resources-accessed

These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.

object
accounts

The unnamed accounts that were referenced. The order of this array is arbitrary.

Array<string>
app-locals

The unnamed application local states that were referenced. The order of this array is arbitrary.

Array<object>

References an account’s local state for an application.

object
account
required

Address of the account with the local state.

string
app
required

Application ID of the local state application.

integer
apps

The unnamed applications that were referenced. The order of this array is arbitrary.

Array<integer>
asset-holdings

The unnamed asset holdings that were referenced. The order of this array is arbitrary.

Array<object>

References an asset held by an account.

object
account
required

Address of the account holding the asset.

string
asset
required

Asset ID of the holding.

integer
assets

The unnamed assets that were referenced. The order of this array is arbitrary.

Array<integer>
boxes

The unnamed boxes that were referenced. The order of this array is arbitrary.

Array<object>

References a box of an application.

object
app
required

Application ID which this box belongs to

integer
name
required

Base64 encoded box name

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
extra-box-refs

The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.

integer
unnamed-resources-accessed

These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.

object
accounts

The unnamed accounts that were referenced. The order of this array is arbitrary.

Array<string>
app-locals

The unnamed application local states that were referenced. The order of this array is arbitrary.

Array<object>

References an account’s local state for an application.

object
account
required

Address of the account with the local state.

string
app
required

Application ID of the local state application.

integer
apps

The unnamed applications that were referenced. The order of this array is arbitrary.

Array<integer>
asset-holdings

The unnamed asset holdings that were referenced. The order of this array is arbitrary.

Array<object>

References an asset held by an account.

object
account
required

Address of the account holding the asset.

string
asset
required

Asset ID of the holding.

integer
assets

The unnamed assets that were referenced. The order of this array is arbitrary.

Array<integer>
boxes

The unnamed boxes that were referenced. The order of this array is arbitrary.

Array<object>

References a box of an application.

object
app
required

Application ID which this box belongs to

integer
name
required

Base64 encoded box name

string format: byte
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
extra-box-refs

The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.

integer
version
required

The version of this response object.

integer

400

Bad Request

An error response with optional data field.

object
data
object
message
required
string

401

Invalid API Token

An error response with optional data field.

object
data
object
message
required
string

500

Internal Error

An error response with optional data field.

object
data
object
message
required
string

503

Service Temporarily Unavailable

An error response with optional data field.

object
data
object
message
required
string

default

Unknown Error