A user must have enough dTokens in his/her wallet to keep the money stream going, if his/her dTokens balance goes to 0 but the stream is not closed, there will be a deficit. DFlow leverages the buffer deposit and liquidation mechanism to solve this problem and maintain the solvency of money streams. Buffer deposit and liquidation incentivize the sender to close the stream before running out of money.

Buffer deposit

A user has to deposit a small amount of tokens into a money stream when opening it, this small deposit defaults to 1 hour’s token amount in that stream.

buffer_deposit = 3600 * flow_rate


There are generally 2 stages for every money flow:

  1. Solvent: during this period, the sender has enough balance to keep the stream going, and only the sender & receiver can choose to close this stream, if the stream is closed during this period, the buffer deposit goes back to the sender
  2. Critical: during this period, the sender’s balance is not enough, the stream should be liquidated, and the left buffer deposit goes to the liquidator

DFlow leverages the Internet Computer’s heartbeat mechanism to perform liquidation, the system checks all streams’ status every minute, if a stream is in critical state, it’ll be liquidated.