Skip to content

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

Description

@mubarizkyc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions