Skip to content

Commit

Permalink
allow oracle to be more stale (#57) (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
nope-finance authored Jan 22, 2022
1 parent 9c072b6 commit 87f6ca2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions token-lending/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ fn get_price(
}

fn get_pyth_price(pyth_price_info: &AccountInfo, clock: &Clock) -> Result<Decimal, ProgramError> {
const STALE_AFTER_SLOTS_ELAPSED: u64 = 20;
const STALE_AFTER_SLOTS_ELAPSED: u64 = 240;

if *pyth_price_info.key == spl_token_lending::NULL_PUBKEY {
return Err(LendingError::NullOracleConfig.into());
Expand Down Expand Up @@ -2196,7 +2196,7 @@ fn get_switchboard_price(
switchboard_feed_info: &AccountInfo,
clock: &Clock,
) -> Result<Decimal, ProgramError> {
const STALE_AFTER_SLOTS_ELAPSED: u64 = 100;
const STALE_AFTER_SLOTS_ELAPSED: u64 = 240;

if *switchboard_feed_info.key == spl_token_lending::NULL_PUBKEY {
return Err(LendingError::NullOracleConfig.into());
Expand Down

0 comments on commit 87f6ca2

Please sign in to comment.