Skip to content

Conversation

@moraesjeremias
Copy link
Member

Description

  • Adds retry logic
  • Adds usd estimate logic
  • Prevents submission above threshold

@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sp1-vector-hex Ready Ready Preview Comment Sep 24, 2025 1:33pm
sp1-vector-mainnet Ready Ready Preview Comment Sep 24, 2025 1:33pm
sp1-vector-turing Ready Ready Preview Comment Sep 24, 2025 1:33pm

N: Network,
{
let wei = Unit::ETHER.wei_const().to::<u64>() as f64;
let gas_estimate = provider.estimate_gas(tx_request.clone()).await.unwrap() as f64;
Copy link
Member

Choose a reason for hiding this comment

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

This will panic

Copy link
Member Author

Choose a reason for hiding this comment

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

Added error propagation


pub async fn fetch_eth_to_usd_rate() -> CoingekoApiResponse {
pub async fn fetch_usd_rate() -> CoingekoApiResponse {
let from_token: String = env::var("ASSET_TO_USD_CONVERSION").unwrap_or("ethereum".to_string());
Copy link
Member

Choose a reason for hiding this comment

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

This still fetches only the eth usd rate.
Can it be ignored for other chains?

message = "USD Gas fee too high!!",
usd_estimate = round_to_decimals(effective_gas_estimate, 2)
);
sleep_until(Instant::now() + Duration::from_secs(retry_sleep_interval)).await;
Copy link
Member

@0xSasaPrsic 0xSasaPrsic Sep 24, 2025

Choose a reason for hiding this comment

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

why not tokio::time::sleep(retry_sleep_interval).await;

Copy link
Member Author

Choose a reason for hiding this comment

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

Can be, no worries.

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.

3 participants