Frontend Examples
Getting Started with the Constant Flow Agreement
Last updated
Getting Started with the Constant Flow Agreement
Last updated
Let's walk through creating Superfluid streams using the Superfluid SDK Core. We'll get straight into the code with some examples, but you can scroll down to learn about how the SDK works in more detail.
We recommend using the Superfluid Console and the Superfluid Dashboard as you go through these interactive tutorials. They'll help you view your streams in action.
Also, these examples require Mumbai MATIC and test super tokens. You can get some from our faucet here.
Within each example, you'll see that we're importing the Superfluid SDK in each key component, then initializing the SDK using the following logic:
Here we're using a web3Provider
(i.e. a Metamask connection in the browser) instead of an RPC URL for our provider
.
Modify permissions of an account to manage streams on your behalf.
The flow rate is the # of tokens you'd like to send per second, denominated in wei. You can use the calculator below to get the flow rate for an amount of tokens you want to send per month. You can pass this calculated flow rate into the examples above to create & update your streams.