PROTOCOL

How streams work

A generalized streaming smart-contract system on Vara. Token-agnostic, composable, and designed for per-second settlement.

S
alice.vara
USDC $0.00027/sec
R
bob.vara

Stream lifecycle

From deposit to withdrawal — every step is transparent and on-chain.

1. Deposit & Buffer

Sender deposits tokens into the TokenVault with a required buffer amount. Buffer guarantees the stream won't go negative.

2. Create Stream

Define receiver, token, and flowRate. StreamCore records the stream and starts accounting per-second immediately.

3. Real-time Accrual

Every second, the receiver's withdrawable balance increases by flowRate. No transactions needed — it's computed on-chain.

4. Withdraw Anytime

Receivers can claim their accrued balance at any time. No lockups, no approval needed, no delays.

5. Update or Stop

Senders can update the flowRate, pause, or stop a stream. Remaining buffer is returned on stop.

6. Liquidation Safety

If buffer depletes, the stream auto-stops. Liquidation bots can trigger cleanup to return remaining funds.

Contract architecture

Modular, auditable contracts. Each module has a single responsibility.

StreamCore

State + accounting for streams (flowRate, start, lastUpdate). The heart of the protocol.

TokenVault

Deposits, buffers, safe ERC-20 handling, emergency pause. Ensures solvency.

SplitsRouter

Weighted routing of incoming funds to N recipients. Revenue sharing made simple.

PermissionManager

Delegates and roles. Allow apps to act on behalf of users securely.

AppAdapters

Small contracts that translate app events into StreamCore calls (e.g., BountyAdapter).

Module Interaction Flow

App / SDK
AppAdapter
StreamCore
TokenVault
SplitsRouter
routes funds from
StreamCore

Security model

Streams never go negative. Explicit invariants guarantee solvency at every state change.

Buffer Model

Every stream requires a deposit buffer. Streams cannot go negative — ever. If buffer depletes, the stream auto-pauses.

Liquidation Rules

Clear, transparent liquidation rules. If a sender's buffer runs out, the stream stops gracefully with no loss to the receiver.

Emergency Pause

TokenVault includes an emergency pause mechanism. Admin can freeze all operations if a critical issue is detected.

Invariant Checks

Explicit on-chain invariants ensure solvency at every state transition. Mathematically verified.

Supported tokens

Start streaming with these tokens. More coming soon.

USDC
Live
VARA
Live
wETH
Coming Soon
DAI
Coming Soon

Events for indexers

Rich on-chain events power real-time UIs and subgraphs.

eventStreamCreated
eventStreamUpdated
eventStreamStopped
eventFundsWithdrawn
eventSplitsUpdated
eventBufferDeposited
eventLiquidationTriggered

Ready to build?

Check out the developer docs, grab the SDK, and deploy your first stream.