Rewards Management

This page covers checking, claiming, and transferring staking rewards on Starknet.

Prerequisites

  • Environment variables configured for the target network (see Staking Operations)
  • Access to the rewards and operator account keystores

Checking Rewards

Query the current unclaimed rewards for a validator:

starkli call ${STAKING_CONTRACT_ADDRESS} get_staker_info_v1 ${VALIDATOR_ADDRESS} | jq -r ".[5]"

The sixth field in the response contains the pending reward amount.

Updating the Global Index

This is no longer required. The staking rewards accounting has changed and the global index is now updated automatically. Kept here for reference only.

The global reward index was previously required to be periodically updated to ensure accurate reward calculations. This was performed using the operator account:

starkli invoke \
    --account=${OPERATOR_ACCOUNT} \
    --keystore=${OPERATOR_KEYSTORE} \
    ${STAKING_CONTRACT_ADDRESS} update_global_index_if_needed

Claiming Validator Rewards

Rewards can be claimed by the rewards account or the operator account:

starkli invoke --watch \
    --account=${REWARDS_ACCOUNT} \
    --keystore=${REWARDS_KEYSTORE} \
    ${STAKING_CONTRACT_ADDRESS} claim_rewards ${VALIDATOR_ADDRESS}
starkli invoke --watch \
    --account=${OPERATOR_ACCOUNT} \
    --keystore=${OPERATOR_KEYSTORE} \
    ${STAKING_CONTRACT_ADDRESS} claim_rewards ${VALIDATOR_ADDRESS}

The --watch flag waits for the transaction to be confirmed before returning.

Transferring Rewards

After claiming, transfer STRK to a spend wallet:

starkli invoke --watch \
    --account=${REWARDS_ACCOUNT} \
    --keystore=${REWARDS_KEYSTORE} \
    ${STRK_CONTRACT_ADDRESS} transfer ${SPEND_ADDRESS} u256:1000000000000000000

Replace ${SPEND_ADDRESS} with the destination wallet address and adjust the amount as needed. The value 1000000000000000000 equals 1 STRK (18 decimals).

Claiming Delegator Rewards

Delegator rewards are claimed through the delegation pool contract. This must be run by the staker (either from the rewards address or the staker address):

starkli invoke --watch \
    --account=${STAKER_ACCOUNT} \
    --keystore=${STAKER_KEYSTORE} \
    ${DELEGATION_POOL_CONTRACT_ADDRESS} claim_rewards ${STAKER_ADDRESS}

This moves the accumulated delegation rewards to the staker's address.