Skip to content

Budgets ​

Choose a budget to decide how much a trigger may use: an amount accrued over time, the treasury's whole token balance, or an account's remaining entitlement. Each budget supports one ERC20 token. Funds stay in the DAO.sol contract; the budget calculates availability.

Core concepts ​

  • Availability: an amount in the token's smallest unit, computed before the tree runs. These raw units are the integer amounts used in Asset.
  • Caller and data: the trigger caller and its budgetData, bytes supplied to the budget for this run. A budget may use them to verify an entitlement—the amount an account is allowed to claim—or ignore them.
  • Commit: accounting after a successful run. Restarting a stream begins the next accrual period; recording a claim prevents the same entitlement being paid again.

The budget interface ​

IBudget returns an IERC20 token reference and Action[] calls:

solidity
interface IBudget {
    function token() external view returns (IERC20);

    /// @notice Calculates what this caller may use in the current run.
    /// @param caller The account or contract that called the plugin's trigger function.
    /// @param data Budget-specific trigger data, such as a claim proof.
    /// @return amount Available amount in raw token units.
    function available(address caller, bytes calldata data)
        external view returns (uint256 amount);

    /// @notice Builds accounting calls for the DAO.sol contract to execute after the tree succeeds.
    /// @dev Receives the same caller and data as available; actual spend is not supplied.
    function commitActions(address caller, bytes calldata data)
        external view returns (Action[] memory);
}

The plugin reads token() and available(), runs the tree and checks total spend, then requests commitActions() with the same caller and data. All three methods are read-only; the DAO.sol contract executes the returned accounting calls. A failed commit rolls back the run.

On completion, a Stream budget restarts even if some allocation was retained, while a Merkle budget records the full entitlement processed.

Choose a budget ​

BudgetAvailabilityCommit
StreamGrows over time, bounded by funding and an optional capRestart from zero
BalanceCurrent token balanceNo calls
Merkle ClaimCaller's remaining cumulative entitlementRecord the claim

Stream also exposes a checkpoint interface for restarting availability. See Execution for allocation checks and component setup for initialization and commit permissions.