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

Pod is imported here, but it is only a trait, without a derive macro #120

Open
mubarizkyc opened this issue Jun 25, 2024 · 0 comments
Open

Comments

@mubarizkyc
Copy link

when i build this project

    msg!("Starting Pyth price check program");

    let account_info_iter = &mut accounts.iter();
    let pyth_account = next_account_info(account_info_iter)?;

    // Get the current time from the Clock sysvar
    let clock = Clock::get()?;
    let current_time = clock.unix_timestamp;

    const STALENESS_THRESHOLD: u64 = 60; // staleness threshold in seconds

    // Load the price feed from the account info
    // let price_feed = load_price_feed_from_account_info(pyth_account)?;
    let price_feed: PriceFeed = SolanaPriceAccount::account_info_to_feed(pyth_account)?;
    let current_price: Price = price_feed
        .get_price_no_older_than(current_time, STALENESS_THRESHOLD)
        .ok_or(ProgramError::InvalidArgument)?;

I got this error
Screenshot from 2024-06-25 18-14-50

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 a pull request may close this issue.

1 participant