Skip to content

Commit 87f6ca2

Browse files
authored
allow oracle to be more stale (#57) (#58)
1 parent 9c072b6 commit 87f6ca2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: token-lending/program/src/processor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ fn get_price(
21152115
}
21162116

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

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

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

0 commit comments

Comments
 (0)