An Overview of Token Streaming Models

All streams are not created equal.

An Overview of Token Streaming Models

The token streaming space in web3 is growing rapidly, and while the different token streaming protocols out there may look similar on the surface, there are qualitative differences between them.

This blog post compares the various streaming models that are up and running on mainnet.

Note that we will assume that you have a little bit of familiarity with Ethereum. If you're a newcomer, check out this website.

But First, What is Token Streaming?

Let us first get familiar with the basic concept.

Token streaming means the ability to make continuous payments on a per-second basis. It is a new financial primitive that was pioneered in web3, which can solve real-world problems related to establishing trust on the Internet.

DAOs and web3 organizations use streaming for running their token vesting, airdrops, and payroll. Streaming automates the payment process for all of these use cases and provides a more fair and equitable compensation.

Closed-ended Streams

Closed-ended payment streams have a fixed deposit amount and a fixed duration. Once the sender creates the stream, a specific start and end time are recorded on the blockchain.

This type of stream was pioneered by Sablier back in 2019, but today there are multiple providers, such as StreamFlow, Sushi Furo, and LlamaPay. It is also possible to use Superfluid by setting up a Gelato task to schedule the closing of the stream.

Let's take an example. Imagine Alice wants to stream 3,000 DAI to Bob during the whole month of January.

  1. Alice deposits 3,000 DAI in a smart contract on Jan 1, setting the end time to Feb 1.
  2. Bob's allocation of the DAI deposit increases every second beginning Jan 1.
  3. On Jan 10, Bob will have earned approximately 1,000 DAI. He can send a transaction to withdraw the tokens to his wallet.
  4. If at any point during January Alice wishes to get back her tokens, she can cancel the stream and recover what has not been streamed yet.
Stream profile
An example of a closed-ended DAI stream on Sablier

Use Cases

Closed-ended streaming works particularly well for vesting, airdrops, and grants, since the payment amount and duration are known in advance in these cases.

However, it can also work for payroll, given that it alleviates the need to perform monthly payments (which can be costly, e.g., when using a Safe multisig). The only requirement is to have the cash upfront.

Pros and Cons

The pros of closed-ended streams are:

  • Autonomy: no off-chain components are required to keep the streams afloat.
  • Autopilot: the sender does not have to monitor and top up their streams.
  • Peace of mind: closed-ended streams can be non-cancelable, which gives recipients the peace of mind that the entire deposit will eventually be streamed in full.

Whereas the cons are:

  • Capital lockups: the sender needs to deposit a large amount of ERC-20 tokens upfront.
  • Discontinuation: multiple streams need to be created when a sender wishes to keep paying the same recipient.

Custom Curves

Closed-ended streaming is really what Sablier currently excels at, distinguishing itself from other platforms that only offer linear streaming options. With Sablier, users can create a wide range of streaming curves, including exponentials, logarithms, and step unlocks.

This feature constitutes what we term a "universal streaming engine", since it empowers developers to tailor the token distribution process with arbitrary mathematical precision.

Streaming curves available in the Sablier UI

Open-ended Streams

In contrast to closed-ended, open-ended streams don't have an end time and are not tethered to a specific deposit amount. They may also be called "indefinite streams".

The way it works is that the user sets a desired payment rate per second, at which point the protocol initiates a continuous transfer of tokens from the sender to the recipient. This transfer persists until either the sender (i) cancels the stream or (ii) depletes their funds. In principle, as long as the sender continues to top up the stream, it could remain running indefinitely.

Let's take an example. Alice wishes to send Bob a continuous stream of 100 DAI per day. This rate breaks down to approximately 4.16 DAI per hour and roughly 0.0011574074 DAI per second.

  • Alice tops up her streaming account with tokens, e.g. 500 DAI.
  • Alice submits a transaction to kickstart the 100 DAI/day stream.
  • After 1 hour, Bob will have earned ~4.16 DAI.
  • After 2 days, Alice tops up her account with 2,000 DAI.
  • After 10 days, Bob will have earned 1,000 DAI, leaving Alice with a remaining balance of 1,500 DAI (2,500 - 1,000).

Now, what happens on day 25, when Alice runs out of money? Different protocols handle this scenario in varying ways, making it a key implementation detail.

Wrapped Token Model

Superfluid introduced open-ended streaming in 2020. Their protocol relies on token contracts that wrap the underlying ERC-20 tokens on a 1:1 basis (e.g. USDCx)

These wrapper contracts have special functions for streaming. Most notable is the balanceOf function, which returns a continuously updating balance to reflect the incoming and outgoing streams.

When the sender's balance approaches zero, Superfluid is required to terminate the stream to maintain solvency in the wrapper contract. Otherwise, the 1:1 conversion invariant is broken.

To address this, Superfluid is running an off-chain network of liquidators who monitor the solvency of sender accounts. These liquidators are paid a small fee whenever they close the stream of a sender that is close to becoming insolvent. In addition to liquidators, the network also comprises participants known as "Patricians". These individuals stake tokens to serve as a liquidity backstop, ensuring that funds are available should a liquidator not intervene in a timely fashion.

Screenshot of the Superfluid app

Debt Tracking Model

LlamaPay is the other player in the open-ended streaming category. In their implementation, no liquidation occurs when the sender runs out of funds. They keep track of the debt incurred by the sender and display a negative balance.

When senders top up a LlamaPay stream with accumulated debt, the deposit offsets the negative balance. This repayment is immediately accessible for withdrawal by the recipient, thereby eliminating the need for a network of liquidators.

The crucial point is that this system cannot be implemented with wrapped tokens due to the 1:1 invariant. LlamaPay uses standard smart contracts that hold custody of the raw ERC-20 tokens.

Screenshot of the LlamaPay app

Use Cases

Open-ended streams are a natural fit for scenarios where there is neither a fixed amount to be paid nor a duration limit for when the payments can be made. Two simple examples are subscriptions and payroll.

When you subscribe to an Internet service, you don't expect to cancel the contract at any particular point in the future (you may be billed annually, but this is just another issue solved by streaming).

Similarly, when you enter into an employment agreement, there's generally no predetermined termination date. Having one would indeed be quite awkward, wouldn't it?

Pros and Cons

The pros of open-ended streams are:

  • Capital efficiency: there is no need to make a large deposit of ERC-20 tokens upfront.
  • Continuation: only one stream has to be created when a sender wishes to keep paying the same recipient.

Whereas the cons are:

  • Management overhead: the sender needs to keep tabs on their streams so that they are not liquidated, or they don't incur any debt.
  • Infrastructure risk: in the case of wrapped tokens, a complex off-chain infrastructure is relied upon for the system to function correctly.
  • Unpredictability: looking at an open-ended stream alone doesn't give any guarantee to the recipient regarding the long-term solvency of the sender; also, open-ended streams cannot be non-cancelable.

Conclusion

To sum up, this article has provided an introduction to token streaming, categorizing it into two distinct types:

  • Closed-ended
  • Open-ended

Each type comes with its own set of advantages and disadvantages, involving different trade-offs. Overall, having multiple implementations is good because it gives end users more flexibility.

While navigating the complex landscape of token streaming can be challenging, we hope this article has shed some light on the current state of the field.


If you have any questions, ideas, or issues, ping us on Discord or Twitter — we’d love to hear from you. Start streaming today on sablier.com!