Skip to content

Commit

Permalink
feat: add gas costs for the shapes in stream types section (#144)
Browse files Browse the repository at this point in the history
* feat: add gas costs for the shapes in stream types section

* chore: capitalize Mainnet
  • Loading branch information
andreivladbrg authored Apr 28, 2024
1 parent 469f8c1 commit 223e6b6
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions docs/concepts/protocol/02-stream-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import FunctionPlot from "@site/src/components/FunctionPlot";
"Lockup" is a higher-level category that refers to the requirement that the creator of a stream must lock up a certain
amount of assets in a smart contract. All streams currently supported by Sablier are Lockup streams.

:::note

The gas estimation for the shapes can be found at
[this branch](https://github.com/sablier-labs/examples/tree/shapes-benchmark).

:::

## Lockup Linear

Lockup Linear streams are the simplest type of stream in Sablier. The streamed amount over time follows a straight line
Expand All @@ -22,6 +29,12 @@ With this type of stream, the payment rate remains constant, meaning that the sa
streamed to the recipient every second. This provides greater predictability and is easy to understand because of how
intuitive it is. Imagine a diagonal line going up and to the right – that's how simple it is.

:::info

The gas cost for this shape is approximately _152,019_ on Mainnet. This may vary due to multiple factors.

:::

### Cliffs

It is possible to attach a "cliff" to a Lockup Linear stream, which sets a cut-off point for releasing assets. Prior to
Expand Down Expand Up @@ -51,6 +64,12 @@ then 3 additional years of linear streaming. If the stream is for an employee, y
the employee leaves your company during the stream, you can cancel it and recover the assets that have not yet been
streamed.

:::info

The gas cost for this shape is approximately _152,019_ on Mainnet. This may vary due to multiple factors.

:::

## Lockup Dynamic

Lockup Dynamic streams are what makes Sablier so unique, since they enable the creation of any type of streaming curve,
Expand Down Expand Up @@ -82,6 +101,12 @@ Exponentials are a great fit if you are looking to airdrop tokens, because your
majority of the tokens towards the end of the stream instead of receiving the tokens all at once (no streaming) or in a
linear fashion (Lockup Linear). This incentivizes long-term behavior and a constructive attitude.

:::info

The gas cost for this shape is approximately _213,610_ on Mainnet. This may vary due to multiple factors.

:::

### Exponential Cliff

Another use case for Lockup Dynamic is a variation of the previous design: an Exponential Cliff.
Expand Down Expand Up @@ -111,6 +136,12 @@ This is an excellent distribution if you are a company looking to set up a token
employees will have an incentive to remain with your company in the long run, as they will receive an increasingly
larger number of tokens.

:::info

The gas cost for this shape is approximately _264,854_ on Mainnet. This may vary due to multiple factors.

:::

### Unlock in Steps

Because Lockup Dynamic is so flexible, it can even be used to create a traditional vesting contract with periodic
Expand Down Expand Up @@ -146,6 +177,13 @@ The advantage of using Unlock in Steps instead of a normal vesting contract is t
process. No more worries about setting up vesting contracts or creating a user interface for your employees to claim
their tokens.

:::info

The gas cost for this shape is approximately _392,982_ on Mainnet for four unlocks. This may vary as there are multiple
factors to consider.

:::

### Monthly Unlocks

Monthly Unlocks is a special case of Unlock in Steps where assets are unlocked on the same day every month, e.g. the 1st
Expand Down Expand Up @@ -175,6 +213,13 @@ in Steps, unwithdrawn tokens will carry over to the next period, providing flexi
This shape is ideal for employers who wish to set up advanced payment schedules for their employees, offering them
access to funds on a predictable, monthly basis.

:::info

The gas cost for this shape is approximately _803,150_ on Mainnet for a period of exactly **one year**. This may vary as
there are multiple factors to consider.

:::

### Timelock

The Timelock shape locks all tokens for a specified period. Users cannot access the tokens until the set period elapses.
Expand All @@ -201,6 +246,12 @@ Once the set period elapses, the full amount becomes accessible to the recipient
advantageous for projects seeking to stabilize token pricing and minimize market volatility, encouraging investors to
maintain their stake over a more extended period.

:::info

The gas cost for this shape is approximately _239,232_ on Mainnet. This may vary due to multiple factors.

:::

### Unlock Linear

The Unlock Linear shape combines an initial immediate release of tokens with a steady, linear payout over time. This
Expand Down Expand Up @@ -231,6 +282,12 @@ contract term — this is your "salary".
Another use case is a token distribution to investors where a particular amount gets unlocked immediately followed by a
linear vesting plan.

:::info

The gas cost for this shape is approximately _239,232_ on Mainnet. This may vary due to multiple factors.

:::

### Unlock Cliff

This shape is useful for companies who want to distribute tokens to their investors using a cliff followed by linear
Expand Down Expand Up @@ -258,3 +315,9 @@ vesting but also want to unlock some liquidity at the beginning to be able to al

Initially, a set amount of tokens are made available to the recipient as an upfront payment. After this initial unlock,
the tokens are held during the cliff period until the moment of time set. The release resumes in a linearly post-cliff.

:::info

The gas cost for this shape is approximately _290,477_ on Mainnet. This may vary due to multiple factors.

:::

0 comments on commit 223e6b6

Please sign in to comment.