-
Notifications
You must be signed in to change notification settings - Fork 5
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: add market (auction paradigm 2) to server #298
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
#[derive(Serialize, Deserialize, ToSchema, Clone, PartialEq, Debug)] | ||
pub enum QuoteTokenAmount { |
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.
Use serde to rename the internal fields here (for better api). Maybe take a look at docs to see how to api structure is looking like?
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.
We can talk on this part together
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.
We can also rename this to sth else :-? Maybe like QouteType?
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
#[serde(tag = "program", rename_all = "lowercase")] | ||
pub enum OpportunityMetadataSvmProgram { | ||
Limo(OpportunityMetadataSvmProgramLimo), | ||
Phantom(OpportunityMetadataSvmProgramWallet), | ||
Swap(OpportunityMetadataSvmProgramWallet), |
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.
We should make sure that there is no phantom opportunity inside the DB. Maybe add a task to backlog for it?
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.
do you mean that we don't currently have any opportunities of this sort saved in the db?
There are some errors when running cargo check which we can resolve |
@@ -135,7 +186,7 @@ impl Service<ChainTypeSvm> { | |||
// Add metrics | |||
let labels = [ | |||
("chain_id", input.quote_create.chain_id.to_string()), | |||
("wallet", "phantom".to_string()), | |||
("router", input.quote_create.router.to_string()), |
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.
we can also pass in the auth name from post_quote
if we prefer
This PR adapts the server code to welcome market orders/swaps that are in Auction Paradigm 2 (bidding in one of the tokens swapped, rather than in native token).
This PR does so in the minimal way--there are some outstanding changes that will improve the code quality later on in future PRs. Some of these are:
wallet_program_router_account
, use a different way to check the bid belongs to Auction Paradigm 2. i.e. use parsed instruction data, fact that AP2 will include swap ix.