-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rewards & Commissions #1245
Comments
To query the commission rate and schedule you can use the Something like (needs some adjustment, error handling, etc.): import (
"fmt"
consensus "github.com/oasisprotocol/oasis-core/go/consensus/api"
staking "github.com/oasisprotocol/oasis-core/go/staking/api"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/config"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/connection"
)
// ...
networkCfg := config.DefaultNetworks.All["mainnet"]
networkCfg.RPC = "unix:/path/to/internal.sock" // Use local node for RPC.
conn, err := connection.Connect(ctx, networkCfg)
account, err := conn.Consensus().Staking().Account(ctx, &staking.OwnerQuery{
Owner: validatorAddress,
Height: consensus.HeightLatest,
})
fmt.Printf("%+v\n", account.Escrow.CommissionSchedule) For rewards you mean the current rewards schedule? This is currently only available by looking at the genesis file but we can add a query method to fetch the current schedule if needed in a future release. |
Hey @kostko, thanks for the explanation regarding the Commission Schedule.
I need to find out when a specific validator receives rewards along with the amount of ROSE received. Based on your previous answer I might need to query the commission schedule... The way I understand Rewards and Commissions is as such: Rewards are the tokens received when delegating your nodes to a validator, whereas Commissions are the rewards that the validator receives, which is a percentage of the Rewards distributed to delegators. In that case, how can I find out the exact commission received at each epoch? Not sure if I am making any sense here... |
Sort of like the reward values that Oasis Monitor depicts: |
Oh I see, so you want to track the reward amounts. One way to track this is to query the following information for your own delegation for each epoch:
As you track this value over consecutive epochs the reward would be the difference between the two. |
Is it possible for one to query rewards + commissions for a validator? If so, how? If not, is there a sort of calculation I should follow?
The text was updated successfully, but these errors were encountered: