Skip to content

Commit 31ba493

Browse files
committed
Don't change this file
1 parent 3fc3b71 commit 31ba493

File tree

1 file changed

+1
-3
lines changed
  • examples/sol-anchor-contract/programs/example-sol-anchor-contract/src

1 file changed

+1
-3
lines changed

examples/sol-anchor-contract/programs/example-sol-anchor-contract/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ pub struct QueryRequest<'info> {
3535
pub mod example_sol_anchor_contract {
3636
use super::*;
3737

38-
const STALENESS_THRESHOLD : u64 = 60; // staleness threshold in seconds
39-
4038
pub fn init(ctx: Context<InitRequest>, config: AdminConfig) -> Result<()> {
4139
ctx.accounts.config.set_inner(config);
4240
Ok(())
@@ -55,7 +53,7 @@ pub mod example_sol_anchor_contract {
5553
// https://docs.pyth.network/consume-data/best-practices
5654
let current_timestamp1 = Clock::get()?.unix_timestamp;
5755
let loan_price = loan_feed
58-
.get_price_no_older_than(current_timestamp1, STALENESS_THRESHOLD)
56+
.get_price_no_older_than(current_timestamp1, 60)
5957
.ok_or(ErrorCode::PythOffline)?;
6058
let loan_max_price = loan_price
6159
.price

0 commit comments

Comments
 (0)