Create
Programming the trading liquidity
After agreeing to the trade, buyer opens a set of payment streams as per the payment schedule of the agreement.
When creating a new payment stream, the buyer sets:
Total amount to be paid out in aggregate
Initial amount the buyer collateralises the stream with
Start date the stream is to start flowing
Maturity date of the stream, when the Total amount is to have been transferred
Upon creating the stream, the buyer must approve a transfer from their balance to the balance of the escrow contract. The approved amount must be the initial amount.
The following code shows the stream creation process which is executed after the approval above:
After the stream has been opened, the flowId in the code above (towards the end of the code block) is the stream identifier used to control it.
Last updated