Task Manager Overview
The Task Manager is a system that enables scheduling transactions for specific block heights on the Monad blockchain. It provides economic incentives for executors to include these transactions in their target blocks, creating a robust on-chain automation framework tailored for Monad's unique architecture.
While FastLane currently operates the executor service, the system is designed to support multiple competing executors in the future.
Why Choose Task Manager?
Task Manager goes beyond simple scheduling—it's purpose-built to leverage Monad's asynchronous execution environment. Traditionally, transactions on Monad consume gas upfront, often leaving significant unused capacity. Task Manager unlocks this latent potential, enabling protocols (such as FastLane's 4337 Paymaster and Atlas services) to strategically utilize surplus gas, turning would-be waste into valuable computation.
By replacing centralized keeper setups, Task Manager provides a decentralized, economically incentivized approach to on-chain automation, dramatically boosting ecosystem efficiency and reliability.
Key Benefits
- Optimized Gas Utilization: Transform unused gas from Monad's async execution into productive computational power.
- Robust On-Chain Automation: Reliably schedule and execute tasks without dependency on external, centralized systems.
- Effortless Integration: Seamlessly plug into your existing applications using intuitive
ITaskManager
andITaskExecutionEnvironment
interfaces. - Decentralized and Competitive Execution: Harness a competitive marketplace of executors, economically motivated to reliably execute your tasks.
- Adaptive and Scalable Pricing: Dynamic cost management ensures optimal resource allocation and incentivization, adjusting in real-time based on network traffic and historical execution data.
- Trustworthy Execution Model: Tasks are secured economically through bonded shMONAD, safeguarding against execution risks. Each task executes within an isolated environment, ensuring interference-free, predictable results.
Key Features
- Block-Height Scheduling: Schedule transactions to execute at specific block heights.
- Economic Incentives: Executors are rewarded for processing tasks by calling
executeTasks
. The Task Manager processes multiple tasks in a batch using the provided gas budget, and fees are distributed automatically to executors upon execution. - Secure Execution: Tasks execute in isolated
Execution Environments
with bonded shMONAD for economic security. Uses non-reentrant design patterns. - Dynamic Pricing: Execution costs adjust based on network conditions and historical metrics.
Core Concepts
Task Categories & Load Balancing
Tasks are categorized by gas usage to facilitate efficient scheduling and load balancing across blocks:
- Small Tasks: ≤ 100,000 gas
- Medium Tasks: ≤ 250,000 gas
- Large Tasks: ≤ 750,000 gas
The system maintains separate queues for each category and automatically advances block pointers to skip blocks with no pending tasks.
Scheduling vs. Execution
Scheduling
- Users submit tasks via
scheduleTask
(paying with MON) orscheduleWithBond
(using bonded shMONAD). - They specify target block, gas limit, the
implementation
contract containing the task logic, andtaskCallData
. - The Task Manager deploys a minimal, task-specific proxy contract (mimic).
- Requires payment (native MON) or bonding shMONAD tokens for economic security and execution costs.
- Bond amount calculated dynamically based on task size and network conditions.
Execution
- Tasks execute at their
targetBlock
(or later, if the block is congested). - Performed by Executors who call
executeTasks
. - The Task Manager
call
s the task-specific proxy contract, which thendelegatecall
s the user'simplementation
contract, running its logic in the proxy's context. - Automatic fee distribution occurs upon successful execution.
System Architecture
Economic Model
The Task Manager uses a transparent economic framework based on native MON and bonded shMONAD tokens:
Payment Structure
Task Type | Size Category | Gas Limit | Typical Bond Requirement* |
---|---|---|---|
Small | ≤ 100,000 gas | 100,000 | 0.01-0.05 shMONAD |
Medium | ≤ 250,000 gas | 250,000 | 0.05-0.15 shMONAD |
Large | ≤ 750,000 gas | 750,000 | 0.15-0.50 shMONAD |
Fee Distribution
When a task executes successfully, the collected fees are distributed:
- Task Executor (70%): Rewards the entity that provides computation resources
- Block Validator (20%): Compensates validators for including execution transactions
- shMONAD Yield (10%): Contributes to staking yields and protocol sustainability
The system dynamically adjusts pricing based on:
- Current network congestion
- Historical execution costs
- Task size category
Use estimateCost(targetBlock, gasLimit)
to get the current execution cost for a specific task before scheduling.
Getting Started
The Task Manager is straightforward to implement in your Monad blockchain applications. To begin working with the system:
- Ensure access to a Monad network environment
- Obtain MON tokens for task execution or bonding
- Learn how to schedule and manage tasks
For complete setup instructions, code examples, and implementation details, see our Getting Started Guide.
See the shMONAD documentation for instructions on managing MON and shMONAD tokens.
Next Steps
ITaskManager Interface
- Complete API reference for scheduling and management.ITaskExecutionEnvironment Interface
- Details on creating isolated task execution logic.- Example Implementation - Reference implementation and examples (Note: May require updates based on latest contract versions).
Glossary
- Definitions of key terms.