API Reference
Supra provides APIs for interacting with automation services, monitoring execution, and retrieving registry data. The sections below cover the on-chain registry module, the REST endpoints, and the error codes and events the registry defines.
All amounts are in quants (1 SUPRA = 100,000,000 quants). Governance can change the registry parameters, such as the cycle duration, the gas capacity and the fee parameters. Read them from the chain as shown in Calculate task-expiry-time & task-automation-fee.
Automation Registry Move Module
The on-chain module 0x1::automation_registry provides the following APIs.
Registration
Users cannot call the register() function directly. Instead, a task is registered by submitting a signed transaction
whose payload is of type AutomationRegistration. The payload wraps the target entry function, its arguments and the
registration parameters. The Supra CLI builds and submits this transaction. The registry validates the task and
accepts it according to the submitted parameters and network rules.
Example: Registering a Task Using Supra CLI
supra move automation register \
--task-max-gas-amount <MAX_GAS> \
--task-gas-price-cap <GAS_PRICE_CAP> \
--task-expiry-time-secs <EXPIRY> \
--task-automation-fee-cap <FEE_CAP> \
--function-id "<ADDRESS>::<MODULE>::<FUNCTION>" \
--args address:<RECIPIENT> u64:<AMOUNT> \
--rpc-url <RPC_URL>Derive each placeholder as follows:
| Placeholder | How to derive it |
|---|---|
<MAX_GAS> | The gas one execution of the function needs. It must fit in the registry’s remaining gas capacity. |
<GAS_PRICE_CAP> | At or above max_gas_price from <RPC_URL>/rpc/v3/transactions/estimate_gas_price. |
<EXPIRY> | start_time + duration_secs + buffer, with start_time and duration_secs from get_cycle_info. |
<FEE_CAP> | At or above the result of estimate_automation_fee for <MAX_GAS>. |
This command builds the registration transaction for the specified function with the given arguments. It does not call
register() directly. The registration fee (flat_registration_fee_in_quants) and a deposit equal to <FEE_CAP> are
taken from the account when the transaction executes. See Fee Structure for when the deposit is
refunded.
To simulate task creation without submission, add --simulate:
supra move automation register --simulate ...Cancellation
public entry fun cancel_task(owner_signer: &signer, task_index: u64)This function cancels the task with the given index. A pending task is removed at once. An active task stays scheduled until the current cycle ends and is removed at the next cycle boundary.
public entry fun stop_tasks(owner_signer: &signer, task_indexes: vector<u64>)This function stops the listed tasks immediately and refunds part of the fees. The CLI equivalents are
supra move automation cancel and supra move automation stop-tasks. See
Canceling Your Automation Task.
Read Functions
The functions below are view functions. Call them with supra move tool view:
supra move tool view \
--function-id 0x1::automation_registry::<FUNCTION> \
--args <TYPE>:<VALUE> \
--rpc-url <RPC_URL>or with a POST request to <RPC_URL>/rpc/v3/view:
curl -X POST <RPC_URL>/rpc/v3/view \
-H 'content-type: application/json' \
-d '{"function": "0x1::automation_registry::<FUNCTION>", "type_arguments": [], "arguments": [<ARGUMENTS>]}'Omit --args for functions without parameters. Pass u64 arguments as strings in the REST body.
| Function | Functionality |
|---|---|
get_cycle_info(): AutomationCycleInfo | Returns index, state, start_time and duration_secs of the current cycle. |
get_cycle_duration(): u64 | Returns the current cycle duration in seconds. |
get_automation_registry_config(): AutomationRegistryConfig | Returns the active registry configuration: duration cap, gas cap and fee parameters. |
get_next_epoch_registry_max_gas_cap(): u64 | Returns the maximum total gas the registry accepts for the next cycle. |
is_registration_enabled(): bool | Returns whether the registry currently accepts new tasks. |
get_task_ids(): vector<u64> | Lists all registered task indexes. |
get_active_task_ids(): vector<u64> | Lists the task indexes active in the current cycle, including cancelled tasks. |
get_task_details(task_index: u64): AutomationTaskMetaData | Returns the metadata of a task. Aborts with EAUTOMATION_TASK_NOT_FOUND if absent. |
get_task_details_bulk(task_indexes: vector<u64>): vector<AutomationTaskMetaData> | Returns the metadata of several tasks. |
get_task_count(): u64 | Returns the number of tasks in the registry. |
get_next_task_index(): u64 | Returns the index the next registered task receives. |
has_sender_active_task_with_id(sender: address, task_index: u64): bool | Returns whether the account owns a non-pending task with the index, including a cancelled task not yet removed. |
get_gas_committed_for_next_epoch(): u64 | Returns the gas committed by the tasks for the next cycle. |
get_gas_committed_for_current_epoch(): u64 | Returns the gas committed by the tasks for the current cycle. |
get_epoch_locked_balance(): u64 | Returns the cycle fees locked in the registry account. It takes no arguments. |
get_locked_deposit_balance(): u64 | Returns the task deposits locked in the registry account. |
get_registry_total_locked_balance(): u64 | Returns the sum of the two locked balances above. |
get_registry_fee_address(): address | Returns the address of the registry account that holds fees and deposits. |
estimate_automation_fee(task_occupancy: u64): u64 | Returns the automation fee for one cycle for a task with the given max gas. |
estimate_automation_fee_with_committed_occupancy(task_occupancy: u64, committed_occupancy: u64): u64 | Same estimate, for an assumed amount of gas already committed. |
calculate_automation_fee_multiplier_for_current_cycle(): u64 | Returns the fee per second, in quants, for the full registry capacity in the current cycle. A task pays the share max_gas_amount / registry_max_gas_cap. |
get_epoch_locked_balance and get_gas_committed_for_*_epoch keep their names from before cycles were introduced;
they refer to cycles.
Devnet also provides register_without_validation and register_system_task_without_validation, which let a smart
contract register a task. They require the supra_automation_v2_1 feature, abort with
EDISABLED_AUTOMATION_V2_1_FEATURE when it is off, and do not validate the payload. They are not available on Mainnet
and Testnet.
The diagram below shows the API architecture map.

REST API Endpoints
Supra exposes these REST endpoints for tracking automation activity:
| Endpoint | Activity |
|---|---|
/rpc/v3/block/height/{height}?with_finalized_transactions=true&type=auto | Returns the automated transactions executed in the block at the given height. |
/rpc/v3/accounts/{address}/automated_transactions | Lists the automated transactions executed for tasks registered by the given account. |
/rpc/v3/transactions/{hash} | Looks up a transaction by its hash. The type query parameter filters by auto, user, meta or record. |
/rpc/v3/view | Calls a view function, such as those in the table above. |
/rpc/v3/transactions/estimate_gas_price | Returns the current gas unit prices, for choosing --task-gas-price-cap. |
Error Codes and Fee Events
Error Codes
The registry aborts with named error codes when a task fails validation. The codes most relevant to registration and cancellation are:
| Error Code | Meaning |
|---|---|
EINVALID_EXPIRY_TIME | The expiry time is not after the registration time. |
EEXPIRY_TIME_UPPER | The task duration exceeds task_duration_cap_in_secs. |
EEXPIRY_BEFORE_NEXT_CYCLE | The expiry time is not after the end of the current cycle. |
EINVALID_GAS_PRICE | The gas price cap is zero. |
EINVALID_MAX_GAS_AMOUNT | The max gas amount is zero. |
EGAS_AMOUNT_UPPER | The task’s max gas would take the total committed gas above the registry’s gas cap. |
EINSUFFICIENT_AUTOMATION_FEE_CAP_FOR_EPOCH | The fee cap is lower than the estimated automation fee. |
EREGISTRY_IS_FULL | The registry already holds task_capacity tasks. |
ETASK_REGISTRATION_DISABLED | Registration is currently disabled. |
ECYCLE_TRANSITION_IN_PROGRESS | The registry is moving between cycles. Retry after the transition. |
EOWNER_NOT_ELIGIBLE_TO_RECEIVE_SUPRA | The account is not registered to receive SUPRA. |
EAUTOMATION_TASK_NOT_FOUND | No task exists with the given index. |
EUNAUTHORIZED_TASK_OWNER | The caller does not own the task. |
EALREADY_CANCELLED | The task is already cancelled. |
EEMPTY_TASK_INDEXES | stop_tasks received an empty list. |
EDISABLED_AUTOMATION_V2_1_FEATURE | Error code 49. Devnet only. A *_without_validation function was called while the supra_automation_v2_1 feature is off. |
A registration from an account with too little SUPRA fails in the coin transfer, not with an automation error code.
These codes are visible in the status of a failed transaction and are useful for debugging or monitoring failed submissions.
Fee and Registry Events
These events are emitted by the registry module and are indexed for external observability:
| Event | Description |
|---|---|
AutomationTaskMetaData | Emitted when a task is accepted into the registry. |
TaskRegistrationDepositFeeWithdraw | Emitted at registration with the registration fee and the locked deposit. |
TaskEpochFeeWithdraw | Emitted when the automation fee for a cycle is charged for a task. |
TaskFeeRefund | Emitted when governance suspends automation and a task is refunded the fee for the rest of the cycle. |
TaskDepositFeeRefund | Emitted when a deposit is refunded. |
TaskCancelledV2 | Emitted when the owner cancels a task with cancel_task. |
TasksStoppedV2 | Emitted with the refund per task when tasks are stopped with stop_tasks. On Devnet, also emitted when the runtime cancels a task. |
TaskCancelledCapacitySurpassedV2 | Emitted when a task is removed because its fee for the cycle exceeds its fee cap. |
TaskCancelledInsufficentBalanceV2 | Emitted when a task is removed because the owner’s balance cannot cover the fee for the cycle. |
RemovedTasks, ActiveTasks | Emitted at a cycle transition with the removed and the newly active task indexes. |
A task removed for an insufficient balance does not receive its deposit back.
On Devnet, the registry also emits TaskCancelledByRuntime when the runtime cancels a task that registered without
payload validation and turned out to be invalid. Its diagnostic_message field gives the reason.
Registry API Overview
The Automation Registry is a native on-chain module that stores all registered tasks. This registry controls task lifecycle, execution ordering, and expiry/cancellation management. Automation tasks are treated as internal transactions. These are executed directly by the blockchain’s validator layer.
This diagram gives an overview of the interaction of the registry system.

Registration Parameters
The registration transaction carries these parameters:
| Parameter | Meaning |
|---|---|
owner | Account that signs the transaction and owns the task |
payload_tx | The entry function call to execute, with its arguments |
expiry_time | Time in seconds since the Unix epoch after which the task is no longer executed |
max_gas_amount | Maximum gas allowed per execution |
gas_price_cap | Highest gas unit price the owner accepts |
automation_fee_cap_for_epoch | Maximum automation fee for a single cycle |
The registry also stores tx_hash, the hash of the registration transaction, and aux_data, which holds the task
type and its priority.
Task Metadata Structure
get_task_details returns an AutomationTaskMetaData with these fields:
task_indexandownerpayload_tx: the encoded entry function callexpiry_timeandregistration_time, in secondsmax_gas_amount,gas_price_capandautomation_fee_cap_for_epochlocked_fee_for_next_epoch: the deposit locked for the tasktx_hashandaux_datastate:0for pending,1for active,2for cancelled
Fee Structure
Flat Registration Fee
Paid once during registration. Non-refundable.
Deposit
At registration, the account also locks a deposit equal to the automation fee cap. It is returned in full when an active task expires, is cancelled or stopped, or is removed because its fee for a cycle exceeds the cap, and for every task when governance suspends automation. Cancelling or stopping a pending task returns half of it. A task removed because the owner’s balance cannot cover a cycle’s fee does not get it back. The deposit does not pay cycle fees.
Automation Fee (Per Cycle)
Charged from the account balance at the start of each cycle in which the task is active, based on:
- The task’s max gas
- The registry’s congestion level
- The length of the cycle, or the time the task remains active in the cycle if that is shorter. A task that is new in a cycle is always charged for the full cycle.
The fee is:
fee = (automation_base_fee_in_quants_per_sec + congestion_fee_per_sec) * duration_secs * max_gas_amount / registry_max_gas_capBoth per-second rates are for the full registry capacity, and the task pays the share
max_gas_amount / registry_max_gas_cap.
congestion_fee_per_secis computed from the gas committed for the next cycle plus the task’s own gas, so the task’s own gas can raise it.estimate_automation_feedivides by the next cycle’s cap,get_next_epoch_registry_max_gas_cap. The charge at a cycle boundary uses the activeregistry_max_gas_cap.duration_secsis the cycle length, except that an active task whose expiry falls inside the cycle pays forexpiry - now.
Call estimate_automation_fee with a gas amount to get the fee for that amount.
Congestion Fee
The congestion fee applies when the gas committed by tasks exceeds congestion_threshold_percentage of the registry’s
maximum gas cap. It equals congestion_base_fee_in_quants_per_sec * ((1 + s) ^ congestion_exponent - 1) per second, for
the full registry capacity, where s is the fraction of the registry capacity above the threshold. The fee estimate
uses the next cycle’s cap, get_next_epoch_registry_max_gas_cap. The charge at a cycle boundary uses the active
registry_max_gas_cap.
Refunds
Part of a cycle fee is refunded in two cases:
- Suspension. When governance suspends automation during a cycle, each active task is refunded the fee for the rest of the cycle, in proportion to the time left, and every task is refunded its deposit in full. A suspension at a cycle boundary, before the next cycle’s fees are charged, refunds only the deposits.
stop_tasks. An active or cancelled task is refunded half of the fee for the rest of the cycle, and its deposit in full. A pending task is refunded half of its deposit.
Cancelling a task with cancel_task, or letting it expire, refunds no part of the current cycle’s fee.
Events
The registry emits events on:
- Task registration
- Fee withdrawals and refunds
- Cancellations and stops
- Removal of tasks at a cycle transition
- Registry configuration changes