@@ -14,7 +14,7 @@ inflation rate, total number of SOL staked on the network, and an individual
14
14
validator’s uptime and commission (fee).
15
15
16
16
Stake pools are an alternative method of earning staking rewards. This on-chain
17
- program pools together SOL to be staked by a manager , allowing SOL holders to
17
+ program pools together SOL to be staked by a staker , allowing SOL holders to
18
18
stake and earn rewards without managing stakes.
19
19
20
20
Additional information regarding staking and stake programming is available at:
@@ -24,16 +24,18 @@ Additional information regarding staking and stake programming is available at:
24
24
25
25
## Motivation
26
26
27
- This document is intended for stake pool managers who want to create or manage
28
- stake pools, and users who want to provide staked SOL into an existing stake
29
- pool.
27
+ This document is intended for the main actors of the stake pool system:
28
+
29
+ * manager: creates and manages the stake pool, earns fees, can update the fee, staker, and manager
30
+ * staker: adds and removes validators to the pool, rebalances stake among valiators
31
+ * user: provides staked SOL into an existing stake pool
30
32
31
33
In its current iteration, the stake pool only processes totally active stakes.
32
34
Deposits must come from fully active stakes, and withdrawals return a fully
33
35
active stake account.
34
36
35
- This means that stake pool managers and users must be comfortable with creating
36
- and delegating stakes, which are more advanced operations than sending and
37
+ This means that stake pool managers, stakers, and users must be comfortable with
38
+ creating and delegating stakes, which are more advanced operations than sending and
37
39
receiving SPL tokens and SOL. Additional information on stake operations are
38
40
available at:
39
41
@@ -46,10 +48,10 @@ like [Token Swap](token-swap.md).
46
48
47
49
## Operation
48
50
49
- A stake pool manager creates a stake pool and includes validators that will
51
+ A stake pool manager creates a stake pool, and the staker includes validators that will
50
52
receive delegations from the pool by creating "validator stake accounts" and
51
53
activating a delegation on them. Once a validator stake account's delegation is
52
- active, the stake pool manager adds it to the stake pool.
54
+ active, the staker adds it to the stake pool.
53
55
54
56
At this point, users can participate with deposits. They must delegate a stake
55
57
account to the one of the validators in the stake pool. Once it's active, the
@@ -61,12 +63,12 @@ Over time, as the stake pool accrues staking rewards, the user's fractional
61
63
ownership will be worth more than their initial deposit. Whenever the user chooses,
62
64
they can withdraw their SPL staking derivatives in exchange for an activated stake.
63
65
64
- The stake pool manager can add and remove validators, or rebalance the pool by
66
+ The stake pool staker can add and remove validators, or rebalance the pool by
65
67
withdrawing stakes from the pool, deactivating them, reactivating them on another
66
68
validator, then depositing back into the pool.
67
69
68
70
These manager operations require SPL staking derivatives and staked SOL, so the
69
- stake pool manager will need liquidity on hand to properly manage the pool.
71
+ stake pool staker will need liquidity on hand to properly manage the pool.
70
72
71
73
## Background
72
74
@@ -130,12 +132,12 @@ Hardware Wallet URL (See [URL spec](https://docs.solana.com/wallet-guide/hardwar
130
132
solana config set --keypair usb://ledger/
131
133
```
132
134
133
- ### Stake Pool Administrator Examples
135
+ ### Stake Pool Manager Examples
134
136
135
137
#### Create a stake pool
136
138
137
- The pool administrator manages the stake accounts in a stake pool , and in exchange
138
- receives a fee in the form of SPL token staking derivatives. The administrator
139
+ The stake pool manager controls the stake pool from a high level , and in exchange
140
+ receives a fee in the form of SPL token staking derivatives. The manager
139
141
sets the fee on creation. Let's create a pool with a 3% fee:
140
142
141
143
``` sh
@@ -157,6 +159,46 @@ The pool creator's fee account identifier is
157
159
in the stake pool earn rewards, the program will mint SPL token staking derivatives
158
160
equal to 3% of the gains on that epoch into this account.
159
161
162
+ #### Set manager
163
+
164
+ The stake pool manager may pass their administrator privileges to another account.
165
+
166
+ ``` sh
167
+ $ spl-stake-pool set-manager 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC --new-manager 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn
168
+ Signature: 39N5gkaqXuWm6JPEUWfenKXeG4nSa71p7iHb9zurvdZcsWmbjdmSXwLVYfhAVHWucTY77sJ8SkUNpVpVAhe4eZ53
169
+ ```
170
+
171
+ #### Set fee
172
+
173
+ The stake pool manager may update the fee assessed every epoch.
174
+
175
+ ``` sh
176
+ $ spl-stake-pool set-fee 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC 10 100
177
+ Signature: 5yPXfVj5cbKBfZiEVi2UR5bXzVDuc2c3ruBwSjkAqpvxPHigwGHiS1mXQVE4qwok5moMWT5RNYAMvkE9bnfQ1i93
178
+ ```
179
+
180
+ #### Set staker
181
+
182
+ In order to manage the stake accounts, the stake pool manager or
183
+ staker can set the staker authority of the stake pool's managed accounts.
184
+
185
+ ``` sh
186
+ $ spl-stake-pool set-staker 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn
187
+ Signature: 39N5gkaqXuWm6JPEUWfenKXeG4nSa71p7iHb9zurvdZcsWmbjdmSXwLVYfhAVHWucTY77sJ8SkUNpVpVAhe4eZ53
188
+ ```
189
+
190
+ Now, the new staker can perform any normal stake pool operations, including
191
+ adding and removing validators and rebalancing stake.
192
+
193
+ Important security note: the stake pool program only gives staking authority to
194
+ the pool staker and always retains withdraw authority. Therefore, a malicious
195
+ stake pool staker cannot steal funds from the stake pool.
196
+
197
+ Note: to avoid "disturbing the manager", the staker can also reassign their stake
198
+ authority.
199
+
200
+ ### Stake Pool Staker Examples
201
+
160
202
#### Create a validator stake account
161
203
162
204
In order to accommodate large numbers of user deposits into the stake pool, the
@@ -260,7 +302,7 @@ Withdraw Authority: 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn
260
302
261
303
#### Remove validator stake account
262
304
263
- If the stake pool manager wants to stop delegating to a vote account, they can
305
+ If the stake pool staker wants to stop delegating to a vote account, they can
264
306
totally remove the validator stake account from the stake pool by providing
265
307
staking derivatives, just like ` withdraw ` .
266
308
@@ -301,9 +343,9 @@ Total: ◎15.849959206
301
343
#### Rebalance the stake pool
302
344
303
345
As time goes on, deposits and withdrawals will happen to all of the stake accounts
304
- managed by the pool, and the stake pool manager may want to rebalance the stakes.
346
+ managed by the pool, and the stake pool staker may want to rebalance the stakes.
305
347
306
- For example, let's say the manager wants the same delegation to every validator
348
+ For example, let's say the staker wants the same delegation to every validator
307
349
in the pool. When they look at the state of the pool, they see:
308
350
309
351
``` sh
@@ -315,7 +357,7 @@ Total: ◎15.849959206
315
357
```
316
358
317
359
This isn't great! The last stake account, ` E5KBATUd21Dnjnh5sGFw5ngp9kdVXCcAAYMRe2WsVXie `
318
- has too much allocated. For their strategy, the manager wants the ` 15.849959206 `
360
+ has too much allocated. For their strategy, the staker wants the ` 15.849959206 `
319
361
SOL to be distributed evenly, meaning around ` 5.283319735 ` in each account. They need
320
362
to move ` 4.281036854 ` to ` FhFft7ArhZZkh6q4ir1JZMYFgXdH6wkT5M5nmDDb1Q13 ` and
321
363
` 1.872447062 ` to ` FYQB64aEzSmECvnG8RVvdAXBxRnzrLvcA3R22aGH2hUN ` .
@@ -370,7 +412,7 @@ with `4.281036854` delegated to `8r1f8mwrUiYdg2Rx9sxTh4M3UAUcCBBrmRA3nxk3Z6Lm`
370
412
and stake account ` GCJnuFGCDzaToPwJtG5GiK4g3DJBfuhQy6388NyGcfwf ` with ` 1.872447062 `
371
413
delegated to ` 2HUKQz7W2nXZSwrdX5RkfS2rLU4j1QZLjdGCHcoUKFh3 ` .
372
414
373
- Once the new stakes are ready, the manager deposits them back into the stake pool:
415
+ Once the new stakes are ready, the staker deposits them back into the stake pool:
374
416
``` sh
375
417
$ spl-stake-pool deposit 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC GCJnuFGCDzaToPwJtG5GiK4g3DJBfuhQy6388NyGcfwf --token-receiver 34XMHa3JUPv46ftU4dGHvemZ9oKVjnciRePYMcX3rjEF
376
418
Depositing into stake account FYQB64aEzSmECvnG8RVvdAXBxRnzrLvcA3R22aGH2hUN
@@ -393,32 +435,6 @@ Total: ◎15.851269888
393
435
Due to staking rewards that accrued during the rebalancing process, the pool is
394
436
not prefectly balanced. This is completely normal.
395
437
396
- #### Set staking authority
397
-
398
- In order to manage the stake accounts more directly, the stake pool owner can
399
- set the stake authority of the stake pool's managed accounts.
400
-
401
- ``` sh
402
- $ spl-stake-pool set-staking-auth 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC --stake-account FYQB64aEzSmECvnG8RVvdAXBxRnzrLvcA3R22aGH2hUN --new-staker 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn
403
- Signature: 39N5gkaqXuWm6JPEUWfenKXeG4nSa71p7iHb9zurvdZcsWmbjdmSXwLVYfhAVHWucTY77sJ8SkUNpVpVAhe4eZ53
404
- ```
405
-
406
- Now, the new staking authority can perform any normal staking operations,
407
- including deactivating or re-staking.
408
-
409
- Important security note: the stake pool program only gives staking authority to
410
- the pool owner and always retains withdraw authority. Therefore, a malicious
411
- stake pool manager cannot steal funds from the stake pool.
412
-
413
- #### Set owner
414
-
415
- The stake pool owner may pass their administrator privileges to another account.
416
-
417
- ``` sh
418
- $ spl-stake-pool 3CLwo9CntMi4D1enHEFBe3pRJQzGJBCAYe66xFuEbmhC --new-owner 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn
419
- Signature: 39N5gkaqXuWm6JPEUWfenKXeG4nSa71p7iHb9zurvdZcsWmbjdmSXwLVYfhAVHWucTY77sJ8SkUNpVpVAhe4eZ53
420
- ```
421
-
422
438
### User Examples
423
439
424
440
#### List validator stake accounts
0 commit comments