-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@@ -135,6 +140,21 @@ impl TokenAccountInitializationConfigs { | |||
} | |||
} | |||
|
|||
#[serde_as] | |||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | |||
pub struct OtherQuote { |
There was a problem hiding this comment.
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>, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
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