Skip to content
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

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

token 2022 support for router #44

wants to merge 12 commits into from

Conversation

mschneider
Copy link
Contributor

No description provided.

@@ -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)

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"

// 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() {

Choose a reason for hiding this comment

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

Suggested change
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

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

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(),

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

Copy link

@grooviegermanikus grooviegermanikus left a comment

Choose a reason for hiding this comment

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

some minor changes

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.

2 participants