Reconcile Cosmos delegation shares with delegated tokens
A delegation records shares of a validator’s pool. Treating the share count as a bank coin amount can distort a staking statement.
Read one delegator and validator pair
Set ADDR to the delegator address and VAL to the validator operator address. GRPC is a TLS endpoint with reflection. Inspect both delegation.shares and balance inside the returned delegation response.
grpcurl -d "{\"delegatorAddr\":\"$ADDR\",\"validatorAddr\":\"$VAL\"}" "$GRPC" cosmos.staking.v1beta1.Query/Delegation
If a pool holds 900 tokens against 1,000 shares, a position of 100 shares represents 90 tokens before integer rounding. The response balance supplies the chain-calculated coin amount and denomination.
Keep staking and liquid funds apart
A slash can reduce the token value of shares. Save the observed height when comparing two statements. Delegation value also excludes liquid bank funds, separately accruing distribution rewards and tokens already in unbonding entries. github.com Cosmos SDK Query API