Skip to content

Feat: log other quoters #521

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Feat: log other quoters #521

wants to merge 7 commits into from

Conversation

anihamde
Copy link
Contributor

@anihamde anihamde commented Apr 22, 2025

This PR adds the basic logic to log the responses of other quoters whenever a quote request is created. The other quoters' info is stored in the opportunity metadata. This PR leverages a Rust crate derived from this fork of the Jupiter Swap API client, to source quotes from the Jupiter Ultra endpoint.

Currently the other quoters' info is added to the opportunity retroactively following the creation and broadcasting of the opportunity.

TODOs

  • getting the responses of other quoters should run in a separate thread rather than in the main thread, which will block creation of the opportunity and delay the auction
  • consider implications of rate limits

Copy link

vercel bot commented Apr 22, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
swap-staging ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 4:13am

@@ -135,6 +140,21 @@ impl TokenAccountInitializationConfigs {
}
}

#[serde_as]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct OtherQuote {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be exposed to searchers through the API?

@@ -89,6 +90,7 @@ pub struct OpportunityMetadataSvmProgramSwap {
#[serde(default = "default_cancellable")]
pub cancellable: bool,
pub minimum_lifetime: Option<u32>,
pub other_quotes: Vec<OtherQuote>,
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't feel great to have such a big struct here.
Could we alternatively just return the searcher token amount?

@@ -324,6 +391,8 @@ impl Service {
referral_fee_info.referral_fee_bps,
);

let other_quotes = self.get_other_quotes(quote_create.clone()).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could defer fetching this

Ok(config) => config,
Err(_) => return vec![],
};
let ultra_client = &config.jupiter_ultra_client;
Copy link
Contributor

Choose a reason for hiding this comment

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

also maybe we could make it optional, ie if its disabled in the config we don't try to make a call at all

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