Superfluid Protocol Documentation

website·Indexed 34 days ago

https://docs.superfluid.org/

Documentation for the Superfluid protocol, a system for real-time money streaming. It covers the SDK, Super Tokens, Distribution Pools, and advanced topics such as Super Apps, the Stream Scheduler, and solvency mechanisms including liquidations and sentinels. Includes technical references for ISuperToken and SuperTokenV1Library, as well as guides for batching transactions via the Macro Forwarder.

Tokens
55.7K
Snippets
228
Records
345
Agent score
67%

What's inside Superfluid

  1. Overview of the Superfluid Stream Scheduler

    The Stream Scheduler is a Superfluid feature used to automate the lifecycle of token streams. While standard Superfluid streams are perpetual (running until manually canceled or funds are depleted), the Stream Scheduler allows users to:

    1. Schedule the closing of an existing stream.
    2. Schedule the start of a new stream.
    3. Schedule both the start and end dates for a new stream.

    This is primarily used for time-bound payments such as payroll, subscriptions, and token vesting. The feature is available via the Superfluid Dashboard (requires approval) or through underlying contracts and off-chain automations.

  2. Overview of the Superfluid Protocol

    Superfluid is a non-custodial, permissionless asset streaming and distribution protocol. It extends the ERC-20 standard via the Super Token framework to enable programmable, composable, and modular cash flows. Key technical advantages include the ability to execute transfers automatically over time in a non-interactive way, without locking up capital, and netting all inflows and outflows in real-time at every block without consuming gas.
  3. Overview of the FlowSplitter smart contract

    The FlowSplitter smart contract leverages the Superfluid protocol to automatically route incoming streams of Super Tokens between two recipients: a main receiver and a side receiver. The distribution is controlled by the sideReceiverPortion parameter, which specifies the percentage of the incoming flow routed to the side receiver, while the remaining balance is routed to the main receiver (e.g., if sideReceiverPortion is 30%, the side receiver gets 30% and the main receiver gets 70%).
  4. Overview of Superfluid Distributions

    Distributions are a Superfluid primitive designed for scalable one-to-many or many-to-many transfers of value. This is achieved through the creation of Distribution Pools, which are denominated in a single Super Token. There are two primary methods of distributing funds:

    1. Instant Distribution: A single transaction that distributes Super Tokens to any number of receivers with a fixed gas cost.
    2. Streaming Distribution: A continuous flow of funds to receivers via Superfluid Money Streaming into a Pool.
  5. Overview of the Superfluid Vesting Scheduler

    The Vesting Scheduler is a non-custodial smart contract used to automate token vesting schedules. It moves tokens directly from a sender's wallet or Safe to a recipient. The system supports customizable cliffs and linear vesting via Superfluid streams, meaning recipients receive tokens automatically in their wallets without needing to manually claim them.

    Key capabilities include:

    • Implementing linear vesting schedules with customizable cliffs.
    • Specifying cliff dates, times, and amounts.
    • Defining total vesting amounts and time frames.
    • Retaining tokens in the sender's wallet/Safe until the scheduled transfer occurs.
  6. Overview of Superfluid Distribution Pools

    Distribution Pools (also known as the General Distributions Agreement or GDA) enable scalable one-to-many token distributions at a fixed gas cost. They support two types of distributions:

    • Instant Distributions: A one-time distribution of a specified token amount to all pool members.
    • Streaming Distributions: A continuous flow of tokens to pool members over time.

    A single pool can be used to distribute any Super Token for either instant or streaming distributions.

  7. Overview of Superfluid Distributions

    Distributions provide a scalable, gas-efficient method for one-to-many fund transfers in DeFi. Instead of sending individual transactions to multiple recipients, Distributions use Pools to allocate tokens proportionally. The gas cost for executing a distribution remains constant regardless of the number of pool members, making it infinitely scalable compared to traditional multi-send solutions.
  8. Overview of SuperfluidStaking architecture

    The SuperfluidStaking system implements a stake-based reward distribution platform using Superfluid Distribution Pools (General Distributions Agreement - GDA). It consists of two primary contract components:

    1. SuperfluidStaking: The core manager responsible for accepting stakes, managing the total staked amount, creating/upgrading Super Tokens for rewards, managing the Superfluid reward pool, and handling the unstaking process.
    2. ClaimContract: An auxiliary contract deployed for each individual staker to manage the claiming and holding of their specific rewards from the pool.
  9. Overview of Superfluid Distribution Pools

    A Distribution Pool (or General Distributions Agreement/GDA) is a smart contract that facilitates the distribution of tokens to multiple members, managed by a pool admin. Members hold units within the pool that determine their proportional share of the distributions. The pool implements basic ERC20 functionality, allowing pool units to be treated as ERC20 tokens (e.g., transferred to other addresses if permitted by configuration).
  10. Overview of the Superfluid Macro Forwarder

    The MacroForwarder is a trusted forwarder contract that allows developers to define custom 'macros' (user-defined contracts) to batch transactions. This approach reduces gas consumption, simplifies front-end code, and ensures atomicity for batch calls to the Superfluid Host without requiring the custom macro contract to be explicitly trusted by the Host.