Super Tokens

Hooks

Smart contracts that react to Super Token events in real time. Hooks receive callbacks 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 a Hook, the Superfluid Host contract invokes callback 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.

Callback Lifecycle

onFlowCreated

Triggered when a new stream is opened to your app. Open counter-streams, update state, or validate the sender.

onFlowUpdated

Called when an existing stream's flow rate changes. Receives both new and previous flow rate for proportional adjustments.

onFlowDeleted

Fired when a stream is closed. Must not revert — a reverting delete callback causes the app to be jailed.

Architecture

1

User calls Host

All stream operations go through the Superfluid Host contract via callAgreement() or batchCall().

2

Host invokes callbacks

If the receiver is a registered Hook, the Host calls the app's before/after hooks with the Superfluid context.

3

App executes logic

Your callback can open new streams, distribute tokens, update state — all atomically within the same transaction.

4

Host validates rules

After execution, the Host checks that the app didn't violate any rules (e.g. the jailing rule for reverting deletes).

Use Cases

Hooks unlock financial primitives that aren't possible with standard tokens. Here are some of the patterns being used in production.

Payment Splitters

Split incoming streams across multiple recipients based on configurable shares. Revenue sharing, DAO treasury management, referral fees.

Subscription Services

Gate access based on active streams. Users stream to subscribe, stop to cancel. No recurring charge approvals needed.

Streaming DEXes

Dollar-cost averaging via continuous token swaps. Stream one token in, receive another out. SuperBoring and Ricochet pioneered this.

Vesting & Payroll

Continuous token vesting with cliff periods. Contributors receive tokens every second instead of monthly batches.

Lending & Liquidation

Stream interest payments instead of accruing debt. Automatic liquidation when stream deposits are insufficient.

Reward Distribution

Stream rewards to LPs or stakers proportionally via GDA pools. Rewards flow every second, no claiming required.

Apps Built with Hook Callbacks

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

AlfaFrens

AlfaFrens

Social streaming — fans subscribe to creators with per-second payments.

Flow State

Flow State

Quadratic funding and continuous community grants.

SuperBoring

SuperBoring

Stream-based DCA into any token via Uniswap.

Nerite

Nerite

Borrowing protocol with streaming interest payments.

Getting Started

Build your first Hook with the CFASuperAppBase contract and the SuperTokenV1Library.

MySuperApp.sol
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;
    }
}

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