-
Notifications
You must be signed in to change notification settings - Fork 17
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
token 2022 support for router #44
base: main
Are you sure you want to change the base?
Conversation
@@ -145,13 +150,24 @@ impl<T: SwapStepInstructionBuilder> SwapInstructionsBuilder for SwapInstructions | |||
|
|||
for step in &swap_instructions { | |||
if auto_create_out || (step.out_mint == sol_mint && auto_wrap_sol) { | |||
Self::create_ata(&wallet_pk, &mut setup_instructions, &step.out_mint); | |||
let out_is_token_2022 = (step.out_mint != sol_mint) |
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.
could have a list of well-known hardcoded spl_token instead of "step.out_mint != sol_mint"
bin/autobahn-router/src/main.rs
Outdated
// collect all mints traded so their token program owner can be checked | ||
let mut mints = HashSet::new(); | ||
for d in dexs.iter() { | ||
for es in d.edges_per_pk.values() { |
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.
for es in d.edges_per_pk.values() { | |
for e in d.edges_per_pk.values().flatten() |
continue; | ||
} | ||
// TODO: disabled for eclipse launch, was causing issues with the program id | ||
// subscription for invariant |
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.
guess we cannot merge that without breaking autobahn on solana
@@ -86,6 +86,10 @@ impl BirdeyePriceFeed { | |||
mints: &HashSet<Pubkey>, | |||
sender: broadcast::Sender<PriceUpdate>, | |||
) -> anyhow::Result<()> { | |||
|
|||
// TODO: disabled for eclipse launch until traffic is live |
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 be a config param
@@ -16,6 +16,12 @@ impl PriceCache { | |||
mut receiver: tokio::sync::broadcast::Receiver<PriceUpdate>, | |||
) -> (PriceCache, JoinHandle<()>) { | |||
let latest_prices = Arc::new(DashMap::new()); | |||
// seed price cache with stable coin prices, as a point of reference | |||
latest_prices.insert( | |||
Pubkey::from_str("AKEWE7Bgh87GPp171b4cJPSSZfmZwQ3KaqYqXoKLNAEE").unwrap(), |
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.
could be moved into a hardcoded PriceFeed
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.
some minor changes
No description provided.