Real-time money streaming protocol. Wraps ERC-20s into Super Tokens whose balances tick per-second based on Constant Flow Agreements (CFA) and General Distribution Agreements (GDA) for one-to-many payouts. Used for salaries, subscriptions, and grant streams.
- 01continuous payroll / salaries
- 02subscriptions
- 03grant streaming
- 04one-to-many distributions (GDA)
- 05vesting that must be cancellable
- pnpm add @superfluid-finance/sdk-core @superfluid-finance/ethereum-contracts
| Variable | Scope | Description |
|---|---|---|
| SUPERFLUID_NETWORK | Client | Network slug used by the SDK metadata (e.g. base, optimism, polygon, eth-mainnet). Determines host/CFA/GDA addresses. |
For new builds, prefer calling the `CFAv1Forwarder` and `GDAv1Forwarder` helper contracts directly with viem/wagmi — the team explicitly recommends them over `@superfluid-finance/sdk-core` for non-batched flows. Use `cfaForwarder.createFlow(token, sender, receiver, flowRate)` (flowRate is wei-per-second), `updateFlow`, and `deleteFlow`. For one-to-many payouts use the GDA: `gdaForwarder.createPool(token, admin, config)`, then `updateMemberUnits(pool, member, units)` and `distributeFlow(token, from, pool, requestedFlowRate)`. Wrap underlying ERC-20s into Super Tokens via `SuperToken.upgrade(amount)` before streaming. Query streams/pools via the Superfluid subgraph.
- ⚑The standalone `@superfluid-finance/sdk-core` package is deprioritized — the team recommends `CFAv1Forwarder` / `GDAv1Forwarder` for everything except batch calls.
- ⚑Stream solvency is a hard constraint: if the sender's Super Token balance falls below the buffer deposit, anyone can liquidate the stream and the sender loses the deposit as a penalty.
- ⚑Flow rate is wei per second (`int96`) — a 1000 USDC/month salary is roughly `385802469135802` wei/sec for USDCx; off-by-one decimals are the most common bug.
- ⚑Super Tokens are 18-decimal wrappers even when the underlying is USDC (6) — always upgrade/downgrade through the Super Token contract, never assume 1:1 decimal parity.
- ⚑GDA pool admins can update member units instantly, which retroactively re-weights the active flow distribution — UIs should subscribe to `MemberUnitsUpdated` and refresh.
- ⚑Some Super Tokens are non-listed ("pure" Super Tokens with no underlying); SDK calls assuming `underlyingToken` will fail for these.