-
Notifications
You must be signed in to change notification settings - Fork 43
docs: autostaker plugin #3169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
docs: autostaker plugin #3169
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
sidebar_position: 8 | ||
--- | ||
|
||
# How to run autostaker plugin | ||
|
||
The autostaker plugin assists an operator by automatically selecting | ||
sponsorships to stake in and to unstake from, and by adjusting existing | ||
stakes to reflect the earnings available from sponsorships relative to | ||
other sponsorships. It also makes sure the operator swiftly discovers | ||
and joins new sponsorships as they emerge. This frees the operator from | ||
having to manually monitor and adjust stakes. | ||
|
||
To run the autostaker plugin, a user must first be running one or more | ||
operator nodes. See [How to become an Operator](./become-an-operator.md) | ||
for more information. | ||
|
||
The autostaker plugin should be enabled on all of your nodes. E.g., say you | ||
are running 4 nodes in total, each should be configured with autostaker | ||
enabled. | ||
|
||
The autostaker plugin is enabled by adding the following section to your node | ||
configuration (under the plugins section): | ||
```json | ||
{ | ||
"plugins": { | ||
"autostaker": { | ||
"operatorContractAddress": "<OPERATOR_ADDRESS>" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
In addition, you need to assign the staking agent role to each node's address | ||
so they can adjust stakes on behalf of the operator. See [Staking agents](../streamr-network/network-roles/operators.md#staking-agents) | ||
for how this is done. | ||
|
||
 | ||
|
||
:::info | ||
- When choosing to run the autostaker plugin, the user should not manually adjust | ||
their operator's stakes, e.g. via the Hub. The autostaker will most likely undo | ||
any manual changes by returning the stakes back to the state it considers optimal. | ||
- To withdraw earnings while the autostaker is enabled, you simply | ||
initiate a withdraw and wait for the undelegation queue to be processed by the | ||
autostaker. This will not be immediate, but will happen on the next activation | ||
of the autostaker (by default every 60 minutes). | ||
::: | ||
|
||
|
||
## Autostaker configuration options | ||
|
||
The following config options are all _optional_. If not provided, the autostaker | ||
will run with default values. | ||
|
||
- The integer `maxSponsorshipCount` controls how many sponsorships the autostaker | ||
will stake into at most. The larger the capacity of your operator fleet state is | ||
(in terms of node count / CPU / bandwidth) the higher this number can be. Conversely, | ||
if your operator fleet is small, this integer should be kept low. | ||
- The integer `minTransactionDataTokenAmount` controls the minimum value a transaction must be | ||
to be considered for execution. The value is expressed in $DATA tokens. Any transactions | ||
falling below this value will be skipped. This is to avoid executing transactions that are | ||
too small in value. To choose this value, balance the cost of gas vs. the value gained by | ||
staking the amount optimally. (The exception to this config is expired sponsorships, which | ||
will always be unstaked from regardless.) | ||
- The integer `maxAcceptableMinOperatorCount` is used to decide whether to stake into a | ||
sponsorship that has a minimum operator count requirement. Such sponsorships only start | ||
paying out once the minimum operator count is reached. E.g. if a sponsorship has a minimum | ||
operator count of 20, and this is set to 20, the autostaker will stake into it. If it is set to | ||
10, the autostaker will not stake into it. (The check is static and does not consider how many | ||
operators may currently already be staked into such a sponsorship.) | ||
- The integer `runIntervalInMs` controls how often the autostaker will run its logic. In | ||
addition to time-based runs, the autostaker will also run whenever a new sponsorship is | ||
created. | ||
|
||
Example of setting these values (default values): | ||
```json | ||
{ | ||
"plugins": { | ||
"autostaker": { | ||
"operatorContractAddress": "<OPERATOR_ADDRESS>", | ||
"maxSponsorshipCount": 25, | ||
"minTransactionDataTokenAmount": 1000, | ||
"maxAcceptableMinOperatorCount": 50, | ||
"runIntervalInMs": 3600000 | ||
} | ||
} | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a screenshot of the Staking Agents and Node Addresses section, showing a state where the same address has been added to both sections?