Created
March 29, 2024 15:53
-
-
Save mgild/bee12d9ce76a384b11dcb6f9b98c96d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use switchboard_solana::AggregatorHistoryBuffer; | |
use std::convert::TryInto; | |
let history_buffer = AggregatorHistoryBuffer::new(history_account_info)?; | |
let current_timestamp = Clock::get()?.unix_timestamp; | |
let one_hour_ago: f64 = history_buffer.lower_bound(current_timestamp - 3600).unwrap().try_into()?; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment