Hooks: A Powerful DeFi Building Block
On-chain hooks that react to Super Token events in real time. Get notified when streams are created, updated, or deleted — enabling composable, programmable financial logic on-chain.
How Hooks Work
When a user opens, updates, or closes a stream to an app with Superfluid Hooks, the Superfluid Host contract invokes hook functions on the app before and after the agreement state changes. This lets your contract automatically respond — for example, splitting an incoming stream across multiple recipients, or opening a counter-stream.
Hook Lifecycle
Architecture
User calls Host
All stream operations go through the Superfluid Host contract via callAgreement() or batchCall().
Host invokes hooks
If the receiver is a registered Hook, the Host calls the app's before/after hooks with the Superfluid context.
App executes logic
Your hook can open new streams, distribute tokens, update state — all atomically within the same transaction.
Host validates rules
After execution, the Host checks that the app didn't violate any rules (e.g. the jailing rule for reverting deletes).
Building DeFi with Hooks
Hooks allow you to build DeFi applications that natively support money streams, distribution pools, and other Superfluid primitives. Instead of polling or relying on off-chain infrastructure, your smart contracts react automatically to every token event — enabling composable financial logic that was never possible with standard tokens.
Apps Built with Hooks
Projects across DeFi, social, and public goods using hooks to power real-time financial logic.
And many more...
Who's Building
Projects powered by Super Tokens
Getting Started
Build your first Hook with the CFASuperAppBase contract and the SuperTokenV1Library.
contract MySuperApp is CFASuperAppBase {
using SuperTokenV1Library for ISuperToken;
function onFlowCreated(
ISuperToken token,
address sender,
int96 flowRate,
bytes calldata ctx
) internal override returns (bytes memory) {
// Split incoming flow 50/50
int96 half = flowRate / 2;
ctx = token.createFlowWithCtx(
recipientA, half, ctx
);
ctx = token.createFlowWithCtx(
recipientB, half, ctx
);
return ctx;
}
}Resources
Hooks Documentation
Complete guide to building, registering, and deploying Hooks.
CFASuperAppBase Reference
The recommended base contract for CFA-based Hooks.
SuperTokenV1Library
Solidity library for stream and distribution operations inside hooks.
Example Contracts
Reference implementations and example hooks to get started quickly.
Register Your Hook
Built a Hook? Register it with the Superfluid ecosystem so it can be discovered and integrated by dashboards and partner applications.
Register Your App








