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

pyth lazer integration #1361

Merged
merged 18 commits into from
Dec 11, 2024
Merged

pyth lazer integration #1361

merged 18 commits into from
Dec 11, 2024

Conversation

NourAlharithi
Copy link
Member

No description provided.

@NourAlharithi NourAlharithi changed the title initialize new oracle account passes pyth lazer integration Dec 5, 2024
"instruction index must be greater than 0 to include the sig verify ix"
)?;

let verified = pyth_lazer_sdk::verify_message(
Copy link
Member

Choose a reason for hiding this comment

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

is this only think we use from pyth_lazer_sdk? can we just pull this into our own package so we dont needa take a dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

i'd like to leave it for now becuase they said it's still in beta and that their code/api can change. once it's finalized i agree

programs/drift/src/instructions/admin.rs Outdated Show resolved Hide resolved
};
pyth_lazer_oracle.price = price.0.get();
pyth_lazer_oracle.posted_slot = Clock::get()?.slot;
pyth_lazer_oracle.publish_time = next_timestamp;
Copy link
Member

Choose a reason for hiding this comment

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

is the ts from pythnet? we probably want the ts from solana and pythnet

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it's the ts from pythnet. you want to store the solana clock time on the account as well?

Copy link
Member

Choose a reason for hiding this comment

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

i guess we dont do it for the other oracles, if we think we'd ever use it, it might make sense

pyth_lazer_oracle.price = price.0.get();
pyth_lazer_oracle.posted_slot = Clock::get()?.slot;
pyth_lazer_oracle.publish_time = next_timestamp;
pyth_lazer_oracle.conf = 0;
Copy link
Member

Choose a reason for hiding this comment

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

should chat about this

Copy link
Member Author

Choose a reason for hiding this comment

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

can chat whenever

Copy link
Member

Choose a reason for hiding this comment

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

0 confidence will probably mess w things, you should ask z how to handle it

Copy link
Member Author

Choose a reason for hiding this comment

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

confidence being 0 and not having twap is mostly just because it's not available in pyth lazer yet in general. but pyth says they will be adding it in going forward in which case i'll change this

programs/drift/src/state/oracle.rs Outdated Show resolved Hide resolved
@NourAlharithi NourAlharithi merged commit 5bde3b6 into master Dec 11, 2024
6 of 8 checks passed
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