Skip to content
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

feat(cli): add close publisher caps #546

Merged
merged 4 commits into from
Dec 31, 2024
Merged

feat(cli): add close publisher caps #546

merged 4 commits into from
Dec 31, 2024

Conversation

keyvankhademi
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Dec 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
staking-legacy ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 6:14pm

RpcProgramAccountsConfig {
filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new(
0,
MemcmpEncodedBytes::Bytes(PublisherCaps::DISCRIMINATOR.to_vec()),
Copy link
Contributor

Choose a reason for hiding this comment

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

you should filter on data here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

N/A anymore

@@ -97,5 +99,14 @@ fn main() {
Action::SaveStakeAccountsSnapshot {} => {
save_stake_accounts_snapshot(&rpc_client);
}
Action::ClaimRewards {
min_staked,
min_reward,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like having two parameters here. I feel like we should be disciplined and:

  • either claim all rewards for accounts with min_staked
  • or claim all rewards s.t. reward > min_reward

ClaimRewards {
#[clap(long, help = "Minimum staked tokens")]
min_staked: u64,
#[clap(long, help = "Minimum reward tokens per publisher")]
Copy link
Contributor

Choose a reason for hiding this comment

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

add a comment saying this is with full decimals?

.filter_map(|positions| {
let acc = positions.to_dynamic_position_array();
let valid = acc
.get_target_exposure(&Target::IntegrityPool, current_epoch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about using get_target_exposure here. get_target_exposure ignores UNLOCKED positions but these can have unclaimed rewards

@keyvankhademi keyvankhademi changed the title feat(cli): add close publisher caps and claim rewards instruction feat(cli): add close publisher caps Dec 31, 2024
Copy link
Contributor

@guibescos guibescos left a comment

Choose a reason for hiding this comment

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

lgtm

@keyvankhademi keyvankhademi merged commit 8580645 into main Dec 31, 2024
10 of 11 checks passed
@keyvankhademi keyvankhademi deleted the claim branch December 31, 2024 18:10
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.

2 participants