File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
examples/sol-anchor-contract/programs/example-sol-anchor-contract/src Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ pub struct QueryRequest<'info> {
35
35
pub mod example_sol_anchor_contract {
36
36
use super :: * ;
37
37
38
- const STALENESS_THRESHOLD : u64 = 60 ; // staleness threshold in seconds
39
-
40
38
pub fn init ( ctx : Context < InitRequest > , config : AdminConfig ) -> Result < ( ) > {
41
39
ctx. accounts . config . set_inner ( config) ;
42
40
Ok ( ( ) )
@@ -55,7 +53,7 @@ pub mod example_sol_anchor_contract {
55
53
// https://docs.pyth.network/consume-data/best-practices
56
54
let current_timestamp1 = Clock :: get ( ) ?. unix_timestamp ;
57
55
let loan_price = loan_feed
58
- . get_price_no_older_than ( current_timestamp1, STALENESS_THRESHOLD )
56
+ . get_price_no_older_than ( current_timestamp1, 60 )
59
57
. ok_or ( ErrorCode :: PythOffline ) ?;
60
58
let loan_max_price = loan_price
61
59
. price
You can’t perform that action at this time.
0 commit comments