Skip to content

Commit

Permalink
program: log when oracle has insufficient data points
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Feb 16, 2024
1 parent 50039f0 commit 597fad3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions programs/drift/src/math/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ pub fn oracle_validity(
..
} = *oracle_price_data;

if !has_sufficient_number_of_data_points {
msg!("Invalid Oracle: Insufficient Data Points");
}

let is_oracle_price_nonpositive = oracle_price <= 0;
if is_oracle_price_nonpositive {
msg!("Invalid Oracle: Non-positive (oracle_price <=0)");
Expand Down

0 comments on commit 597fad3

Please sign in to comment.