Skip to content

Conversation

@serinko
Copy link
Contributor

@serinko serinko commented Aug 26, 2025

Stake Adjustment Program (stake_adjustment.py)

Overview

This simple argument based program is designed primarily for Delegation program management.

The main goal is to generate a csv of which first two columns without headers can be passed to nym-cli as input for a quick delegation adjustment, using this command:

./nym-cli mixnet delegators delegate-multi --mnemonic "<MNEMONIC>" --input <PATH>/<FILE>.csv

The default values are in sync with DP rules:

--wallet_address: Nym Team DP wallet address
--saturation: 250k NYM
--stake_cap: 90% as per DP rules
--adjustment_step: 25k NYM as per DP rules
--max_wallet_delegation: 125k NYM as per DP rules
--denom: NYM not uNYM to make it smoother and aligned with delegate-multi command of nym-cli

Additionaly the program scrapes api.nym.spectredao.net/api/v1/nodes and validator.nymtech.net/api/v1/nym-nodes/described endpoints and returns a sheet with 20 values per eacvh node passed in the csv input.

The outcome is a table with these values:
NODE ID, SUGGESTED WALLET DELEGATION, CURRENT WALLET DELEGATION, SUGGESTED TOTAL STAKE, CURRENT TOTAL STAKE, SUGGESTED SATURATION, CURRENT SATURATION, UPTIME, VERSION, T&C, BINARY, ROLE, WIREGUARD, IP ADDRESS, HOSTNAME, WSS PORT, MONIKER, IDENTITY KEY, BONDING WALLET, EXPLORER URL.

Install and Run

  1. Download from this branch and make executable
wget https://raw.githubusercontent.com/nymtech/nym/refs/heads/feature/operators/delegation-program-adjuster/scripts/delegation-program/stake_adjustment.py && chmod u+x stake_adjustment.py
  1. Make a simple column csv with node_ids (for DP, use all the DP nodes node_id column, and save it to the same dir, example can be input.csv:
# example
1398
1365
2464
1423
1269
1870
1824
1707
  1. Run the program with the input.csv positional arg (for DP use the default values without any optional args):
./stake_adjustment.py input.csv
  1. The output is a csv with bunch of useful data
  2. For DP extract the first two columns with NODE_ID and SUGGESTED_WALLET_DELEGATION without the headers and save them as a dp_update.csv
  3. Run this dp_update.csv as an input with nym-cli to adjust the DP delegations:
./nym-cli mixnet delegators delegate-multi --mnemonic "<MNEMONIC>" --input dp_update.csv

Help

To preview all commands and arguments, run it with --help flag:

./stake_adjustment.py --help

This change is Reviewable

@serinko serinko self-assigned this Aug 26, 2025
@vercel
Copy link

vercel bot commented Aug 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nym-explorer-v2 Ready Ready Preview Comment Sep 3, 2025 3:48pm
nym-node-status Ready Ready Preview Comment Sep 3, 2025 3:48pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs-nextra Ignored Ignored Preview Sep 3, 2025 3:48pm

Copy link
Contributor

@mfahampshire mfahampshire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 great stuff

@serinko serinko merged commit ccd8ff2 into develop Sep 3, 2025
8 checks passed
@serinko serinko deleted the feature/operators/delegation-program-adjuster branch September 3, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants