Skip to main content

Diagrams

Abbreviations

AbbreviationFull nameDescription
balStream balanceBalance of the stream
cdCovered debtPortion of the total debt covered by the stream balance
eltElapsed timeTime elapsed in seconds since the last snapshot
odOngoing debtDebt accumulated since the last snapshot
nowCurrent timeSame as block.timestamp
rpsRate per secondRate at which tokens are streamed per second
sdSnapshot debtDebt accumulated until the last snapshot
stSnapshot timeTime of the last snapshot
tdTotal debtSum of sd and od, also same as sum of cd and ud
udUncovered debtPortion of the total debt not covered by the stream balance

Flow Storage Layout

Each Flow contract is a singleton that stores all streams created by that contract's users. The following diagrams provide insight into the storage layout. To see the list of all storage variables, click here.

Token Flows

The following three functions lead to tokens flow in and out of a stream:

Deposit

Anyone can deposit into a stream.

Refund

Only sender can refund from the stream that he created.

Withdraw

Anyone can call withdraw on a stream as long as to address matches the recipient. If recipient/operator is calling withdraw on a stream, they can choose to withdraw to any address.

Debts

Covered debt

Ongoing Debt

Uncovered Debt

Total Debt

Refundable Amount