Skip to content

Commit

Permalink
program: pyth oracle skip num publishers check on devnet (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Feb 14, 2024
1 parent 0ea2d9e commit afdafae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion programs/drift/src/state/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,16 @@ pub fn get_pyth_price(
.cast::<i64>()?
.safe_sub(price_data.valid_slot.cast()?)?;

#[cfg(feature = "mainnet-beta")]
let has_sufficient_number_of_data_points = publisher_count >= min_publishers;
#[cfg(not(feature = "mainnet-beta"))]
let has_sufficient_number_of_data_points = true;

Ok(OraclePriceData {
price: oracle_price_scaled,
confidence: oracle_conf_scaled,
delay: oracle_delay,
has_sufficient_number_of_data_points: publisher_count >= min_publishers,
has_sufficient_number_of_data_points,
})
}

Expand Down

0 comments on commit afdafae

Please sign in to comment.