Skip to content

lidofinance/csm-rewards

Repository files navigation

MAINNET HOODI HOLESKY


If you're a Node Operator in CSM, you get staking rewards as a part of Lido protocol fees. The allocation of rewards for CSM operators using a Merkle tree is provided by CSM Performance Oracle once in a frame, making a new portion of the rewards available for claim.

Here you can find the latest rewards tree. Most of the time you won't need it, because CSM UI will fetch the latest data under the hood, and you will be able to claim your rewards right in place. In the case of UI unavailability, you will be able to claim rewards manually using the pre-generated proofs.


Claim rewards using Etherscan:

  • Open proofs.json and locate your record, e.g., 'CSM Operator 42'

  • Open CSM contract on Etherscan and go to 'Contract' -> 'Write as Proxy' tab (direct link)

  • Connect your wallet to Etherscan

  • Select claim* method you want to use, e.g., claimRewardsStETH

  • Enter your Node Operator ID, e.g., 42

  • Enter the amount you wish to claim in the token of choice or use any large value, e.g., 115792089237316195423570985008687907853269984665640564039457584007913129639935 if you don't know the exact number

  • Copy and paste the cumulativeFeeShares from the proof record

  • Copy proof value from the proof record, remove:

    • square brackets
    • quotes
    • spaces
    • new lines

    , and paste it to the rewardsProof input field, e.g.:

    "proof": [
      "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
    ] =>
    0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  • Click the 'Write' button and sign a transaction


The primary intent of this repository is to act as a backup for the rewards trees stored in the IPFS network. By design, the latest tree is the only one required to claim rewards from CSM. That's why the repository tracks only the latest tree, even though the previous versions can be restored by traversing git history.

Here's a simple script used to retrieve the IPFS content identifier (CID) of the latest tree from the CSM distributor contract, fetch the tree itself from the IPFS network, and write down the artifacts: a tree and generated proofs. Currently, the script is executed automatically every hour via GitHub Actions, and the latest artifacts are committed back to the repository.


To run the script manually, follow the instructions below:

  1. Make sure you have installed python >= 3.12 and poetry >= 2.1.1

  2. Install Python dependencies:

    poetry install
  3. Generate stubs for interaction with contracts:

    poetry run wake up pytypes
  4. Copy .env.example to .env:

    cp .env.example .env
  5. Run the script:

    poetry run wake run main.py

About

CSM rewards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •