Skip to content

Commit 5e2db9e

Browse files
docs: enhance wording for Solana pages (#408)
* docs: enhance wording docs: fix streaming shape names mismatch docs: fix grammar docs: fix logical issues docs: reorganize the Architecture section docs: change fee representation from USD to SOL docs: add a paragraph documenting the Metaplex fee docs: add explanations, where relevant * refactor: pr review * chore: wording * chore: wording * chore: punctuation * chore: pr review * refactor: Architecture & Diagrams * refactor: ANCHOR_WALLET msg * refactor: Program Reference * refactor: metaplex fee * refactor: stream shapes * chore: polish points chore: rename folder name --------- Co-authored-by: Andrei Vlad Birgaoanu <andreivladbrg@gmail.com>
1 parent 02f253a commit 5e2db9e

File tree

10 files changed

+150
-139
lines changed

10 files changed

+150
-139
lines changed

docs/concepts/lockup/02-stream-shapes.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ title: "Stream Shapes"
66

77
:::note
88

9+
The stream shapes below are examples - and not an exhaustive list.
10+
11+
At the same time, the model for each shape is not a requirement, but a recommendation - for example, the Timelock shape
12+
can also be implemented via Linear or Dynamic models, but is most efficient with the Tranched model.
13+
14+
:::
15+
16+
:::note
17+
918
- The code used to generate the gas benchmarks for the different stream curves can be found
1019
[here](https://github.com/sablier-labs/examples/tree/shapes-benchmark).
1120

@@ -33,7 +42,7 @@ The gas cost to create this shape is approximately _168,923_ on Mainnet. This ma
3342

3443
:::
3544

36-
### Initial Unlock
45+
### Unlock Linear
3746

3847
The Unlock Linear shape combines an initial immediate release of tokens with a steady, linear payout over time. This
3948
shape is ideal for employment contracts that include a signing bonus along with a regular payout schedule.
@@ -69,7 +78,7 @@ The gas cost to create this shape is approximately _191,182_ on Mainnet. This ma
6978

7079
:::
7180

72-
### Cliff Unlock
81+
### Cliff
7382

7483
It is possible to attach a "cliff" to a Lockup Linear stream, which sets a cut-off point for releasing tokens. Prior to
7584
the cliff, the recipient cannot withdraw any tokens, but the stream continues to accrue them. After the cliff, the
@@ -104,7 +113,7 @@ The gas cost to create this shape is approximately _213,708_ on Mainnet. This ma
104113

105114
:::
106115

107-
### Initial Cliff Unlock
116+
### Unlock Cliff
108117

109118
This shape is useful for companies who want to distribute tokens to their investors using a cliff followed by linear
110119
vesting but also want to unlock some liquidity at the beginning to be able to allow investors to bootstrap AMM pools.
@@ -206,7 +215,7 @@ The gas cost to create this shape is approximately _274,420_ on Mainnet. This ma
206215
## Lockup Tranched
207216

208217
Lockup Tranched streams are, as the name says, streams that have token unlocks in tranches. Even though you can use
209-
Lockup Dynamic to create a traditional vesting structure with periodic unlocks, Lockup Tranched is specifically design
218+
Lockup Dynamic to create a traditional vesting structure with periodic unlocks, Lockup Tranched is specifically designed
210219
for that use case. As a result, a stream with tranches created using Lockup Tranched is more gas efficient than the same
211220
stream created using Lockup Dynamic.
212221

docs/solana/01-sablier-on-solana.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,40 @@ available features on Solana.
2929

3030
## SolSab
3131

32-
[SolSab](https://github.com/sablier-labs/solsab) is a collection of protocols featuring two main Solana programs:
33-
**Sablier Lockup** and **Sablier Merkle Instant**. While not all protocols available for Ethereum are currently
34-
available for Solana, we aim to bring the same protocols to Solana in future iterations.
32+
[SolSab](https://github.com/sablier-labs/solsab) is a collection of Solana protocols currently featuring two programs:
33+
**Sablier Lockup** and **Sablier Merkle Instant**. While not all of our Ethereum protocols are also available on Solana,
34+
we aim to bridge this gap in the future.
3535

3636
### Lockup
3737

3838
Sablier Lockup is a token distribution protocol that enables onchain vesting and payments. Our flagship model is the
3939
linear stream, which distributes tokens on a continuous, by-the-second basis.
4040

41-
The way it works is that the creator of a payment stream first deposits a specific amount of SPL or Token2022 tokens.
42-
The program then progressively allocates the funds to the recipient, who can access them as they become available over
43-
time. The payment rate is influenced by various factors, including the start and end times, as well as the total amount
44-
of tokens deposited.
41+
The way it works is that the stream creator first deposits a specific amount of SPL/Token2022 tokens. The program, then,
42+
progressively transfers the ownership of the funds to the recipient (who can withdraw them as they're streamed). The
43+
streaming rate is influenced by various factors, such as the start and end times, the total amount of tokens deposited,
44+
etc.
4545

4646
#### Key differences from the Ethereum [Lockup](../concepts/lockup/01-overview.md) protocol
4747

48-
- The Solana program includes only the Linear streaming model, not the Dynamic and Tranched models. See the available
49-
shapes for the Linear model [here](../concepts/lockup/02-stream-shapes.mdx#lockup-linear).
50-
- Due to the limitations of the [Token Metadata](https://developers.metaplex.com/token-metadata) NFT standard on Solana,
51-
we cannot have non-transferable NFTs.
52-
- Tokens transferred during stream creation are placed in a dedicated Stream ATA
53-
([Associated Token Account](https://www.alchemy.com/overviews/associated-token-account)), instead of all tokens being
54-
held in the Lockup contract as on Ethereum.
55-
- We do not have hooks for the `cancel` and `withdraw` functionalities due to limitations in how Solana works.
48+
- On Solana, we currently support all shapes from the
49+
[Lockup Linear](../concepts/lockup/02-stream-shapes.mdx#lockup-linear) category, as well as the
50+
[Timelock](../concepts/lockup/02-stream-shapes.mdx#timelock) shape (also implemented via the Linear program).
51+
- Due to the limitations of the [Token Metadata](https://developers.metaplex.com/token-metadata) NFT standard, we don't
52+
support non-transferable Streams on Solana.
53+
- Instead of the tokens from all of the streams being stored at a single address, on Solana, they're kept in dedicated
54+
stream ATAs ([Associated Token Account](https://www.alchemy.com/overviews/associated-token-account)).
55+
- Due to how Solana's VM works, we do not support hooks for the `cancel` and `withdraw` functionalities.
5656

5757
### Merkle Instant
5858

59-
Merkle Instant is a program that enables the creation of token airdrop campaigns using Merkle trees, allowing users to
60-
instantly claim and receive their allocation through a single transaction.
59+
The Merkle Instant program enables the creation of Merkle Tree-based token airdrop campaigns that allow users to claim
60+
their entire allocation at once after the campaign starts.
6161

6262
#### Key differences from the Ethereum [Airdrops](../concepts/05-merkle-airdrops.mdx) protocols
6363

64-
- The Solana program includes only the Instant airdrop model, not the Vesting airdrop models.
65-
- Due to the nature of Solana's account architecture, we have a single program that handles both the creation and the
66-
claiming. In contrast to Ethereum, where we have a factory contract that deploys a stand-alone contract for each
67-
airdrop campaign.
64+
- The Solana protocol only includes the Instant airdrop model, for now. The Vesting airdrop models are coming in the
65+
future.
66+
- Due to Solana’s account architecture, a single program handles both creation and claiming. In contrast to Ethereum,
67+
where a factory contract deploys a stand-alone contract for each airdrop campaign, and claiming is performed on that
68+
contract.

docs/solana/02-deployment-addresses.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ sidebar_position: 2
44
title: "Deployment Addresses"
55
---
66

7-
This page contains the deployment addresses for the first SolSab release.
7+
This page contains the deployment addresses for SolSab.
88

99
:::important
1010

11-
Unlike EVM, the programs here adhere to the best practices of Solana development which includes upgradeability.
11+
SolSab programs adhere to the best practices for Solana development, which includes being upgradeable.
1212

1313
:::
1414

1515
## Deployment Addresses
1616

17-
All programs are deployed using
18-
[Anchor's verifiable builds](https://www.anchor-lang.com/docs/references/verifiable-builds) for deterministic bytecode.
17+
All programs have been built and deployed [verifiably](https://www.anchor-lang.com/docs/references/verifiable-builds),
18+
generating deterministic bytecode.
19+
20+
### v0.1:
1921

2022
| Chain | Protocol | Program ID |
2123
| :------ | :------------ | :------------------------------------------------------------------------------------------------------------------------------------- |
@@ -24,8 +26,8 @@ All programs are deployed using
2426
| Devnet | Lockup | [4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC](https://solscan.io/account/4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC?cluster=devnet) |
2527
| Devnet | MerkleInstant | [7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV](https://solscan.io/account/7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV?cluster=devnet) |
2628

27-
The programs are verified using [Solana Verify CLI](https://github.com/Ellipsis-Labs/solana-verifiable-build/) and the
28-
verification status can be found on the Osec API:
29+
The programs have been verified using [Solana Verify CLI](https://github.com/Ellipsis-Labs/solana-verifiable-build/).
30+
Their verification status can be found on Osec:
2931

3032
- [Lockup](https://verify.osec.io/status/4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC)
3133
- [MerkleInstant](https://verify.osec.io/status/7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV)

docs/solana/03-fee.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ title: "Fees"
66

77
### Interface Fees
88

9-
The Sablier Interface charges a flat fee for certain operations. This fee is paid in the native gas token, i.e. in SOL.
9+
The Sablier Interface charges a flat USD fee for certain operations. This fee is paid in the native gas token of the
10+
network (i.e. SOL).
1011

1112
:::info
1213

13-
Fees are calculated based on market prices. For example, when SOL is \$200, a \$1 fee equals 0.005 SOL.
14+
Fees are calculated based on the SOL price at the moment of the tx. For example, if SOL is \$200, a \$1 fee equals 0.005
15+
SOL.
1416

1517
:::
1618

@@ -19,18 +21,34 @@ Fees are calculated based on market prices. For example, when SOL is \$200, a \$
1921
| Withdraw from a stream | **$1** |
2022
| Claim an airdrop | **$2** |
2123

22-
These are Interface Fees, not program-level fees. The Solana programs themselves don't charge these fees.
24+
These are Interface (and not program-level) fees. The SolSab programs themselves don't charge any fees.
25+
26+
### Metaplex Fees
27+
28+
Each of our Lockup streams has an NFT representation, in the form of a
29+
[Metaplex Token Metadata](https://developers.metaplex.com/token-metadata) NFT. Metaplex
30+
[charges](https://developers.metaplex.com/protocol-fees) a fixed fee, in SOL, for a number of operations with its
31+
protocol. Because of the latter, creating a Lockup stream also involves a **0.01 SOL** fee that goes directly to
32+
Metaplex.
2333

2434
### Transaction Fees
2535

26-
Each operation on the blockchain also has a gas fee, which is independent of the Sablier fee, this is for network and
27-
rent of the accounts created. For more information, refer to [Solana docs](https://solana.com/docs/core/fees).
36+
When transacting on the Solana blockchain, you're also required to pay one or more of the following
37+
[transaction fees](https://solana.com/learn/understanding-solana-transaction-fees#solanas-fee-structure) (depending on
38+
what exactly your tx does):
39+
40+
- Base Fee
41+
- Priority Fee
42+
- Storage Rent
43+
44+
These fees are independent of the Sablier fees - and are used by the Solana network, e.g., to compensate the validators
45+
for processing your tx.
2846

29-
These fees are an approximation, as each transaction might have a different cost.
47+
Here are the estimated transaction fees for some of our program instructions:
3048

31-
| Operation | Fee |
32-
| -------------------------- | ----------- |
33-
| Create a stream | **~$5** |
34-
| Withdraw from a stream | **~$0.004** |
35-
| Create an airdrop campaign | **~$0.1** |
36-
| Claim an airdrop | **~$0.2** |
49+
| Operation | Fee |
50+
| -------------------------- | ---------------- |
51+
| Create a stream | **~0.0137 SOL** |
52+
| Withdraw from a stream | **~0.00009 SOL** |
53+
| Create an airdrop campaign | **~0.0045 SOL** |
54+
| Claim an airdrop | **~0.00003 SOL** |

docs/solana/07-governance.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ sidebar_position: 7
44
title: "Governance"
55
---
66

7-
The Protocol Admin is an account with exclusive access to collecting the fee from the treasury account, and also has the
8-
"upgrade authority". More concretely, the Admin is a multisig wallet and currently in control of Sablier Labs.
7+
SolSab program governance comprises two key functions:
8+
9+
- Collecting accumulated protocol fees from the Treasury account
10+
- Upgrading the protocol (as the "upgrade authority")
11+
12+
Both functions are exclusively controlled by the Protocol Admin account, a multisig wallet managed by Sablier Labs.
13+
14+
The following table lists the Treasury and Protocol Admin account addresses:
915

1016
| Chain | Protocol | Role | Address |
1117
| :------ | :------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------- |

docs/solana/accounts-architecture/01-lockup.md renamed to docs/solana/architecture-and-diagrams/01-lockup.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ sidebar_position: 1
44
title: "Lockup"
55
---
66

7-
This section focuses on the architecture of accounts created or used in the most important instructions of the Lockup
8-
program.
7+
This section covers the program architecture, as well as the account structure and the token flow for the most important
8+
instructions of the Lockup program.
99

10-
## Account architecture
11-
12-
### Sablier Lockup program
10+
## Program Architecture
1311

1412
The `sablier_lockup` program implements these main functionalities:
1513

@@ -19,7 +17,9 @@ The `sablier_lockup` program implements these main functionalities:
1917
- `withdraw`
2018
- `renounce`
2119

22-
We will go into the details and specifics of each one later. For now, we will focus only on the accounts being created.
20+
The `create_stream` functionality is represented by the `create_with_timestamps_ll` and `create_with_durations_ll`
21+
instructions. The difference between the two is the kind of inputs required from the stream creator. However, both of
22+
them create the same accounts and store the same data on-chain.
2323

2424
```mermaid
2525
flowchart TD
@@ -32,8 +32,9 @@ flowchart TD
3232
C --> H[create_with_durations_ll]
3333
```
3434

35-
The difference between the create stream implementations is that one uses timestamps, while the other uses duration
36-
inputs. Though, both create the same accounts and save the same data on chain.
35+
## Ix Account Architecture
36+
37+
The following sections detail the accounts created by each instruction.
3738

3839
### `initialize` Instruction
3940

@@ -53,7 +54,7 @@ flowchart TD
5354
- **NFT collection mint PDA**: serves as the master mint authority for all stream NFTs
5455
- **NFT collection metadata PDA**: created via Metaplex CPI
5556
- **NFT collection master edition PDA**: created via Metaplex CPI
56-
- **NFT collection ATA**: associated token account owned by treasury to hold the collection NFT token
57+
- **NFT collection ATA**: the treasury-owned associated token account holding the collection NFT
5758

5859
The
5960
[Treasury PDA](https://github.com/sablier-labs/solsab/blob/e1085fe87ea3d02556156ee446e820d150af483e/programs/lockup/src/state/treasury.rs#L5-L10)
@@ -131,10 +132,17 @@ flowchart TD
131132
A --> A3([start])
132133
```
133134

134-
## The Flow of the Deposit Token
135+
## Deposit Token Flow
136+
137+
At stream creation, the deposit token is transferred from the sender to the stream's token account. Then, as it's being
138+
streamed, it can be withdrawn by the recipient. If the stream is canceled, the unstreamed token amount is refunded to
139+
the sender. The following diagrams illustrate how tokens move between accounts when each instruction is executed.
135140

136141
### `create_with_timestamps_ll` Instruction
137142

143+
At stream creation, the deposit tokens are transferred from the sender's ATA to the stream data's ATA, where they are
144+
stored until withdrawn or refunded.
145+
138146
```mermaid
139147
sequenceDiagram
140148
actor Sender
@@ -149,7 +157,8 @@ sequenceDiagram
149157

150158
### `cancel` Instruction
151159

152-
Only the sender can cancel a stream.
160+
Only the sender can cancel a stream. When canceled, any remaining/unstreamed tokens are refunded from the stream data's
161+
ATA to the sender's ATA.
153162

154163
```mermaid
155164
sequenceDiagram
@@ -165,6 +174,10 @@ sequenceDiagram
165174

166175
### `withdraw` Instruction
167176

177+
The recipient can withdraw their available/streamed tokens at any time. The tokens are transferred from the stream
178+
data's ATA to the specified withdrawal recipient's ATA (which may be the recipient themselves or another account,
179+
depending on the authority of the tx signer).
180+
168181
```mermaid
169182
sequenceDiagram
170183
actor Recipient

docs/solana/accounts-architecture/02-merkle-instant.md renamed to docs/solana/architecture-and-diagrams/02-merkle-instant.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ sidebar_position: 2
44
title: "Merkle Instant"
55
---
66

7-
This section focuses on the architecture of accounts created or used in the most important instructions of the Merkle
8-
Instant program.
7+
This section covers the program architecture, as well as the account structure and the token flow for the most important
8+
instructions of the Merkle Instant program.
99

10-
## Account architecture
11-
12-
### Sablier Merkle Instant program
10+
## Program Architecture
1311

1412
The `sablier_merkle_instant` program implements the following main functionalities:
1513

@@ -18,8 +16,6 @@ The `sablier_merkle_instant` program implements the following main functionaliti
1816
- `claim`
1917
- `clawback`
2018

21-
We will go into the details and specifics of each one later. For now, we will focus only on the accounts being created.
22-
2319
```mermaid
2420
flowchart TD
2521
A[Sablier Merkle Instant Program] --> B[initialize]
@@ -28,6 +24,10 @@ flowchart TD
2824
A --> E[clawback]
2925
```
3026

27+
## Ix Account Architecture
28+
29+
The following sections detail the accounts created by each instruction.
30+
3131
### `initialize` Instruction
3232

3333
```mermaid
@@ -90,15 +90,23 @@ The
9090
[Claim receipt](https://github.com/sablier-labs/solsab/blob/e1085fe87ea3d02556156ee446e820d150af483e/programs/merkle_instant/src/state/claim_receipt.rs#L6)
9191
account serves as proof of claim for the given recipient.
9292

93-
## The Flow of the Airdrop Token
93+
## Airdrop Token Flow
94+
95+
The airdrop token flow begins when the campaign creator funds the campaign's ATA. Once funded and the campaign has
96+
started, eligible recipients can claim their tokens. The campaign creator can clawback any remaining tokens after the
97+
campaign expires. The following diagrams illustrate how tokens move between accounts when each instruction is executed.
9498

9599
### `create_campaign` Instruction
96100

97-
This instruction does not perform the airdrop token transfer, but the transfer is expected to be made as a separate
98-
transaction. Therefore, the campaign ATA is assumed to be funded after the campaign creation.
101+
This instruction creates the campaign account and its ATA, but does not perform the airdrop token transfer. The campaign
102+
creator must fund the campaign ATA in a separate transaction after campaign creation. After that, the campaign ATA will
103+
hold all tokens available for distribution to eligible recipients.
99104

100105
### `claim` Instruction
101106

107+
Eligible recipients can claim their airdrop tokens by providing a valid Merkle proof. When claimed, tokens are
108+
transferred from the campaign ATA to the recipient's ATA.
109+
102110
```mermaid
103111
sequenceDiagram
104112
actor Claimer
@@ -113,6 +121,9 @@ sequenceDiagram
113121

114122
### `clawback` Instruction
115123

124+
After the campaign expiration time, the campaign creator can clawback any remaining/unclaimed tokens. These tokens are
125+
transferred from the campaign ATA back to the campaign creator's ATA.
126+
116127
```mermaid
117128
sequenceDiagram
118129
actor CampaignCreator
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"collapsed": false,
3-
"label": "Accounts Architecture",
3+
"label": "Architecture & Diagrams",
44
"position": 4
55
}

0 commit comments

Comments
 (0)