Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Constant Flow Agreement (CFA)

A Constant Flow Agreement (CFA) is a smart contract primitive from the Superfluid protocol that establishes a persistent, real-time flow of tokens from a sender to a receiver.
Chainscore © 2026
definition
DEFINITION

What is Constant Flow Agreement (CFA)?

A Constant Flow Agreement (CFA) is a core smart contract primitive within the Superfluid protocol that enables programmable, continuous, and automatic token streams between blockchain accounts.

A Constant Flow Agreement (CFA) is a smart contract standard that facilitates real-time finance by allowing one party (the sender) to establish a continuous, non-discretionary flow of tokens to another party (the receiver). Unlike traditional periodic transfers, a CFA creates a per-second stream where the receiver can access the accrued tokens at any moment. The flow's rate is defined in wei per second (e.g., 1 DAI per month), and the contract automatically enforces the transfer of the exact amount that has streamed since the last on-chain interaction. This mechanism is foundational for use cases like salaries, subscriptions, and rewards that require granular, ongoing value transfer.

The CFA's architecture is built on the concept of streaming balances. Instead of holding tokens in escrow, the sender's account balance is debited, and the receiver's balance is credited, in real-time as each second passes. This is made possible by the Superfluid protocol's Super Token standard, which are ERC-20 wrapper tokens with enhanced functionality. The CFA contract calculates the net flow for any account by summing all its incoming and outgoing streams, and the account's real-time balance is its static token holdings plus this net flow. This design eliminates the need for repeated transactions, drastically reducing gas costs and enabling complex, multi-party streaming topologies.

Key operations for a CFA are createFlow, updateFlow, and deleteFlow. A flow is a persistent state until explicitly stopped or modified. The protocol's Constant Flow Agreement V1 (CFAv1) is the canonical implementation, governing the logic for these operations and the real-time balance accounting. A critical feature is automatic liquidation: if a sender's real-time balance would go negative, any account can call a function to delete the offending stream, protecting the network from insolvency. This makes streams as secure as regular token transfers while being infinitely more efficient for recurring payments.

The CFA enables novel financial primitives. For developers, it abstracts away the complexity of managing recurring transactions. Use cases include: - Real-time payroll and vesting schedules - Subscription services with per-second billing - DeFi rewards that stream continuously to liquidity providers - Cross-chain streaming via bridging protocols. By moving from discrete, batched transactions to continuous flows, the CFA model unlocks more granular, transparent, and capital-efficient economic interactions on-chain, forming the backbone of the money streaming paradigm.

how-it-works
MECHANISM

How Does a Constant Flow Agreement Work?

A Constant Flow Agreement (CFA) is a smart contract primitive that enables the continuous, automated transfer of value over time, such as streaming tokens or data.

A Constant Flow Agreement (CFA) is a smart contract standard, most notably implemented within the Superfluid Protocol, that facilitates the creation of ongoing, non-interactive payment or data streams. Unlike a standard transaction, which transfers a lump sum, a CFA defines a persistent flow rate—for example, 1 DAI per second—that is executed automatically on-chain. The sender locks funds in the contract, and the recipient can access the streamed value in real-time, with their balance updating continuously based on the elapsed time since the last interaction. This mechanism is powered by the concept of real-time balances, where the recipient's claimable amount is a function of the flow rate and time, not discrete transactions.

The core operation relies on two primary functions: createFlow to initiate a stream and deleteFlow to stop it. When a flow is active, the contract calculates the net flow for each user by summing all inflows and outflows. The sender's account is debited, and the recipient's is credited, based on the precise number of seconds that have passed. This accounting is gas-efficient because it uses a settlement model where balances are recalculated only when a user interacts with the chain (e.g., making a transaction). This means the stream runs perpetually without requiring constant on-chain transactions, making it ideal for use cases like subscriptions, salaries, or rewards distribution that require granular, real-time value transfer.

A key technical innovation is the Superfluid Agreement List (AL) framework, which allows the CFA contract to be notified of balance changes and enforce solvency constraints in real-time. The system ensures a sender cannot create a flow that would make their account insolvent at the moment of the next possible settlement. If a user's balance becomes insufficient, any outgoing streams are automatically deleted by the protocol to maintain system integrity. This real-time enforcement, combined with the ability to update flow rates without interrupting the stream, provides a robust foundation for building complex financial applications on Ethereum and other EVM-compatible blockchains.

Practical applications extend beyond simple payments. Developers use CFAs to create token vesting schedules that drip tokens continuously, real-time revenue sharing models for DAOs, and oracle data streams where information is paid for per-second. The composability of streams allows for complex financial logic, such as splitting a single incoming flow to multiple recipients or creating conditional flows that trigger based on external data. This transforms static, batch-based financial operations into dynamic, programmable cash flows that are natively integrated into the blockchain's execution layer.

key-features
MECHANICAL PROPERTIES

Key Features of Constant Flow Agreements

Constant Flow Agreements (CFAs) are smart contracts that enable the continuous, permissionless transfer of value between parties at a predetermined rate. Their core features define their unique utility in DeFi.

01

Continuous & Automated Streams

A CFA creates a non-interactive payment stream that moves assets from a sender to a receiver at a constant rate per second. Once initiated, the stream runs autonomously until stopped, eliminating the need for repeated transactions. This enables use cases like real-time payroll, subscription services, or vesting schedules.

  • Example: A $1000/month salary stream moves ~$0.0003858 per second.
  • The receiver can withdraw the accrued balance at any time.
02

Real-Time Balance Accrual

The receiver's claimable balance is not a static amount but accrues continuously based on the elapsed time since the stream started. The balance is calculated on-chain using the formula: accruedBalance = flowRate * (currentTimestamp - streamStartTimestamp). This creates a money legos primitive where other contracts can permissionlessly query and interact with the live stream value.

03

Permissionless Creation & Management

Any wallet or smart contract can create, update, or delete a CFA stream without requiring approval from the counterparty for ongoing operations. The sender controls the flow rate and can increase, decrease, or stop the stream unilaterally. This design prioritizes composability, allowing CFAs to be integrated as modular components within more complex DeFi applications and DAO tooling.

04

Superfluid Asset Support

CFAs are a core primitive of Superfluid Finance and initially support Super Tokens—wrapped assets that gain streaming capability. When streamed, these tokens remain collateralized in underlying protocols (e.g., a stream of xDAI is backed by staked DAI in Aave). This allows the same capital to be used for yield generation and continuous payments simultaneously, a concept known as Superfluid Staking.

05

On-Chain Accountability

Every stream's parameters—sender, receiver, flowRate, and start timestamp—are immutably recorded on the blockchain. This provides transparent, verifiable proof of payment obligations and cash flows. The public ledger enables novel forms of on-chain credit and reputation systems based on historical streaming behavior, as the data is openly auditable by anyone.

06

Gas-Efficient Updates

Modifying a stream (e.g., changing the flow rate) is a single transaction that does not require closing and reopening the stream. This design minimizes gas costs for stream management. The contract efficiently calculates the net difference owed up to the point of change and adjusts the future flow, ensuring financial correctness without expensive state recomputation.

examples
CONSTANT FLOW AGREEMENT (CFA)

Examples and Use Cases

Constant Flow Agreements enable programmable, continuous value streams. Here are key applications and real-world implementations of this core Superfluid primitive.

02

Subscription Services & SaaS

CFAs power real-time subscriptions where users pay for access as they use it, enabling:

  • Instant cancellation with no chargebacks; the stream stops, payments stop.
  • Granular billing for services like API calls, cloud computing, or content.
  • Dynamic pricing where the flow rate can be adjusted programmatically based on usage tiers.

This model is ideal for Web3-native SaaS, gaming passes, and premium content platforms.

03

DeFi Yield Streaming & Vesting

Protocols leverage CFAs for continuous distribution of rewards, tokens, or revenue.

  • Yield streaming: LP rewards are distributed as a constant flow instead of periodic claims.
  • Vesting schedules: Team or investor token allocations unlock via a continuous stream, providing liquidity while enforcing the schedule.
  • Revenue sharing: DAOs can stream a portion of protocol fees directly to token holders in real time.

This automates distributions and improves capital efficiency for recipients.

04

Cross-Chain Money Streaming

With the advent of Superfluid cross-chain streams, CFAs can operate across different blockchain networks. This enables:

  • Salary payments from a company on Polygon to an employee's wallet on Arbitrum.
  • Global subscriptions where the service provider and consumer are on different chains.
  • Interoperable treasury management for DAOs operating across multiple ecosystems.

The flow logic is secured by the source chain, while value is settled on the destination chain via bridging protocols.

05

The Technical Foundation: Super Tokens

A CFA does not stream the native asset (e.g., ETH). Instead, it streams Super Tokens—ERC-20 tokens upgraded via the Superfluid protocol. Key mechanics:

  • Wrapping: Assets like DAI are deposited to mint DAIx Super Tokens.
  • Continuous Balance: The Super Token balance of a sender decreases and the receiver's increases with each new block, simulating a flow.
  • Settlement: The actual token transfer is executed upon closing the stream or making an on-chain balance query.
technical-mechanics
TECHNICAL MECHANICS AND SETTLEMENT

Constant Flow Agreement (CFA)

A core smart contract primitive for programmable, recurring value streams on the Superfluid protocol.

A Constant Flow Agreement (CFA) is a smart contract standard that enables the creation of continuous, non-discretionary streams of value (like tokens) between parties on a blockchain. Unlike one-time transactions, a CFA establishes a persistent flow where tokens are transferred from a sender's account to a receiver's account at a predetermined, constant rate per second, settled in real-time. This mechanism is foundational for implementing real-time finance (RTFi) use cases such as salaries, subscriptions, and micro-payments directly on-chain, where value accrues and becomes spendable by the receiver with each passing block.

The technical mechanics of a CFA are governed by the Superfluid Protocol. When a flow is created or updated, the protocol calculates a "flow rate" (e.g., 1 DAI per second). The sender must maintain a sufficient balance in their Super Token account (an ERC-20 wrapper with superpowers) to cover the ongoing obligation. The protocol does not lock funds in escrow; instead, it uses an accounting system where the receiver's real-time balance is a function of the elapsed time and the flow rate. This balance is instantly liquid and can be transferred or used in other DeFi interactions without interrupting the incoming stream.

Settlement in a CFA is continuous and trustless. The net flow for each account is recalculated on-chain with every transaction that touches the protocol, ensuring the receiver's claim to the streamed value is always up-to-date and enforceable. A key security feature is automatic closure: if a sender's balance falls below a safety threshold, their outgoing flows are automatically stopped by the protocol to prevent overdrafts. This design eliminates the need for manual claims or periodic transactions, creating a seamless experience where cash flow becomes a programmable, persistent layer of the blockchain's state.

ecosystem-usage
CONSTANT FLOW AGREEMENT (CFA)

Ecosystem Usage and Protocols

The Constant Flow Agreement (CFA) is the core smart contract framework within the Superfluid protocol that enables programmable, continuous, and automatic value streams on-chain. It is the foundational primitive for real-time finance.

01

Core Mechanism: Per-Second Streaming

The CFA enables value transfer as a continuous flow rather than discrete transactions. Funds are streamed on a per-second basis, with the sender's balance decreasing and the receiver's balance increasing in real-time. This is achieved by calculating the net flow rate between parties at any given moment, allowing for instant settlement and composability within the same transaction block.

02

Key Operations: Create, Update, Delete

Interactions with a CFA are governed by three primary functions:

  • createFlow: Establishes a new stream from a sender to a receiver at a specified flow rate.
  • updateFlow: Modifies the flow rate of an existing stream (increase or decrease).
  • deleteFlow: Terminates an active stream, instantly settling the net streamed amount to date.
03

Real-Time Salary & Subscriptions

A primary use case is real-time payroll, where employees earn their salary by the second, enabling immediate access to accrued wages. Similarly, it powers web3 subscriptions for SaaS, content, or NFTs, where payment is a continuous stream that stops instantly upon cancellation, eliminating chargeback risk and prepayment requirements.

04

Composability & Money Legos

CFA streams are composable DeFi primitives. Their predictable, continuous nature allows them to be used as building blocks—"money legos"—within other protocols. For example, a streaming cash flow can be used as collateral in a lending protocol or automatically split among multiple recipients via the Superfluid IDA (Instant Distribution Agreement).

05

Gas Efficiency & Batch Calls

The CFA is designed for gas-efficient operations. Critical for user experience, multiple flow operations (create, update, delete) can be executed in a single transaction via batch calls (batchCall). This allows complex streaming setups (like funding multiple streams) to be established atomically, minimizing transaction costs and complexity.

06

Super Tokens: The Streaming Asset

CFAs stream Super Tokens, which are ERC-20 wrapper tokens with additional streaming capabilities. Common examples include USDCx (wrapped USDC) or DAIx. The wrapping process "upgrades" a standard token, enabling it to be used in perpetual flows. The underlying balance is held in the Super Token contract while the flow rate is managed by the CFA.

TRANSFER MECHANISM COMPARISON

CFA vs. Traditional and Batch Transfers

A comparison of key characteristics between Constant Flow Agreements, traditional one-time transfers, and batch transfer patterns.

Feature / MetricConstant Flow Agreement (CFA)Traditional TransferBatch Transfer

Transfer Type

Continuous, real-time stream

Discrete, one-time payment

Discrete, bulk payment

Gas Efficiency (Recurring)

Real-Time Settlement

Requires Off-Chain Logic

Native Automation

Typical Use Case

Salaries, subscriptions, rewards

One-off purchases, payments

Payroll, airdrops, disbursements

Gas Cost per Unit Value

Low (amortized)

High

Medium (amortized)

State Finality

Per second

Per transaction

Per transaction

CONSTANT FLOW AGREEMENT

Frequently Asked Questions (FAQ)

A Constant Flow Agreement (CFA) is a core primitive of the Superfluid protocol that enables programmable, real-time value streams on-chain. These FAQs address its core mechanics, use cases, and technical implementation.

A Constant Flow Agreement (CFA) is a smart contract primitive that enables the continuous, real-time transfer of assets (like tokens) between parties on a blockchain. It works by establishing a permissioned stream where a sender (sender) commits to sending value to a receiver (receiver) at a defined, constant flow rate (e.g., 0.0001 ETH per second). Instead of discrete transactions, the receiver's balance updates continuously with each new block, and the sender's balance is debited accordingly. The stream's state is represented by a single, updatable integer for the flow rate, making it extremely gas-efficient after the initial setup. This creates a non-custodial, ongoing financial relationship that can be started, updated, or stopped at any time by the authorized parties.

CONSTANT FLOW AGREEMENT (CFA)

Common Misconceptions

The Constant Flow Agreement (CFA) is a powerful primitive for programmable cash flows, but its mechanics are often misunderstood. This section clarifies frequent points of confusion.

No, a Constant Flow Agreement (CFA) is a per-second streaming payment on-chain, not a batched recurring transaction. A traditional recurring payment is a discrete transfer that occurs at fixed intervals (e.g., monthly). In contrast, a CFA continuously updates the recipient's claimable balance with each new block, creating a real-time flow of value. The funds are not sent in chunks but accrue fluidly, allowing for precise, second-by-second accounting and enabling new use cases like real-time salary streaming or pay-per-second API access that are impossible with batched payments.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Constant Flow Agreement (CFA) - Definition & How It Works | ChainScore Glossary