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(fortuna): Add a couple more config values #2251

Merged
merged 6 commits into from
Jan 14, 2025
Merged

feat(fortuna): Add a couple more config values #2251

merged 6 commits into from
Jan 14, 2025

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Jan 13, 2025

Two simple changes here

  • add a padding multiplier for the gas limit so that the keeper is willing to submit txs that slightly exceed the limit. I noticed a few failing txs in mainnet that are at ~510k gas, which could happen due to differences in the number of hashes. This defaults to 10% and that number should probably be fine without configuration.
  • support negative target profit percentages. It turns out that for abstract-testnet, you get a gas refund at the end of the tx which is like 50% of the tx cost. However, you need to set the priority fee without counting this refund. Given that, we're systematically overestimating the needed fee.

Copy link

vercel bot commented Jan 13, 2025

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

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 3:43am
insights ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 3:43am

/// The fee will be lowered if it is more profitable than specified here.
/// Must be larger than min_profit_pct.
pub max_profit_pct: u64,
/// The minimum value for this is -100. If set to < 0, it means the keeper may lose money on callbacks that use the full gas limit.
pub max_profit_pct: i64,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(In hindsight, I wish that i had specified these values as multipliers, so 0 would be the natural lower bound and you could just say "75" instead of "-25". That's how I did the other scalars and it would have been better here.

However, I'm choosing to support up to -100 now in order to maintain backward compatibility on the config format)

chain_eth_config.target_profit_pct,
chain_eth_config.max_profit_pct,
// NOTE: unwrap() here so we panic early if someone configures these values below -100.
u64::try_from(100 + chain_eth_config.min_profit_pct).unwrap(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe just switch to expect to give more context

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