Streaming Payments with Sablier
Earlier this year, launched their protocol for real-time finance on Ethereum, with an indexing layer built on .
Just as you would stream movies on Netflix or music on Spotify, Sablier allows anyone in the world with an internet connection and an Ethereum wallet to stream payments in the form of ERC-20 tokens. Currently supported tokens include DAI, USDC, SAI and compound finance’s cDAI and cUSDC.
Payments are transferred from Sender to Recipient over time in the form of “Streams”. A stream is composed of the following information:
- Sender - Sender’s Ethereum Address
- Recipient - Recipient’s Ethereum Address
- Lock-up value - How much money to stream in total
- Token - ERC-20 token address
- Start time - When the payment starts streaming
- Stop time - When the payment stops streaming
Payer’s Web Interface
Using the interface, Senders can create payments or track all outgoing streams. Senders sign into their Ethereum wallets via MetaMask, Coinbase Wallet or any wallet that supports the WalletConnect protocol. Once signed in, Senders can fill in the remaining information on the Recipient’s Ethereum address, the desired deposit amount (or value to be locked up in the smart contract) and the streaming duration.
The Recipient’s payment rate per second is determined by the lock up value divided by the difference between the start and end time (duration). Sablier uses this rate to transfer a little bit of money from the Sender to the Recipient once every second. After the transaction has been validated by the blockchain, Senders are given a link, which can be shared with the owner of the Ethereum address.
Recipient’s Web Interface
Using the , Recipients can access payments, withdraw and view all incoming streams. Recipients simply need to connect their Ethereum wallet and they’re good to go.
Potential use cases
The ability to stream payments opens up a whole new approach to many traditional payment flows. A few potential use cases are:
- Subscriptions - recurring payments for video, content, news or software subscriptions.
- Memberships - recurring payments for the gym, club or coworking space memberships.
- Payroll - recurring salary or income payments for employees and contractors.
- Grants & Venture Capital - recurring payments for grants, scholarships and venture capital.
- Savings Contributions - recurring contributions to pension funds, investments and other saving accounts.
- Lending - recurring loans or interest payments to borrowers and lenders.
- Bill Payments - recurring phone, internet and utility payments.
- Lodging & Travel - payments per night of accommodation, recurring until the stay is over.
- Insurance - recurring insurance payments or payouts.
Sablier Subgraph
The enables quick access to stream and transaction data. Query the Sablier subgraph to see:
- Streams - including rate per second, start and stop time, token information, withdrawals performed and transaction information.
- Transactions - including stream data, Sender and Recipient addresses.
- Withdrawals - including stream data, Sender and Recipient interest as well as token information.
- Cancelations - including Sender and Recipient balances and interest.
As payment activity increase on Sablier, the Sablier subgraph will ensure timely information is displayed in a responsive web and mobile interface. This allows users to see their incoming and out going payment streams without delay.
Use the Graph Today!
If your app needs to display lots of data in a UI, processing and accessing that data on Ethereum can be time consuming. The Graph allows you to simplify your app’s data indexing process and quickly access the information you need from the Ethereum network, without jeopardising the experience of your users.
Take a quick look at and try querying some of the live subgraphs yourself! You can also start creating your own subgraph by checking out our , and introduce yourself on our channel to share any thoughts or questions.