Skip to content

Commit

Permalink
Dd/pyth status (#127)
Browse files Browse the repository at this point in the history
* accept Unknown status for pyth oracle

* accept Unknown status for pyth oracle

* Pyth status check temporarily removed to let people use accounts with COPE

Co-authored-by: dd <[email protected]>
  • Loading branch information
dafyddd and dd authored Feb 5, 2022
1 parent d073f2b commit 87ce090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Mango Program Change Log

## v3.3.3
Deployed: Feb 4, 2022 at 01:47:33 UTC | Slot: 119,226,876
1. Pyth status check temporarily removed to let people use accounts with COPE

## v3.3.2
Deployed: Jan 28, 2022 at 20:38:57 UTC | Slot: 118,276,295
1. Fix the bug in cancel_all where some orders weren't canceled
Expand Down
8 changes: 2 additions & 6 deletions program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ use crate::ids::msrm_token;
use crate::ids::srm_token;
use crate::instruction::MangoInstruction;
use crate::matching::{Book, BookSide, OrderType, Side};
#[cfg(not(feature = "devnet"))]
use crate::oracle::PriceStatus;
use crate::oracle::{determine_oracle_type, OracleType, Price, StubOracle};
use crate::queue::{EventQueue, EventType, FillEvent, LiquidateEvent, OutEvent};
#[cfg(not(feature = "devnet"))]
Expand Down Expand Up @@ -6215,11 +6213,9 @@ fn read_oracle(
#[cfg(not(feature = "devnet"))]
let conf = I80F48::from_num(price_account.agg.conf).checked_div(value).unwrap();

// Pyth status check temporarily removed to let people use accounts with COPE
#[cfg(not(feature = "devnet"))]
if price_account.agg.status != PriceStatus::Trading {
msg!("Pyth status invalid: {}", price_account.agg.status as u8);
return Err(throw_err!(MangoErrorCode::InvalidOraclePrice));
} else if conf > PYTH_CONF_FILTER {
if conf > PYTH_CONF_FILTER {
msg!(
"Pyth conf interval too high; oracle index: {} value: {} conf: {}",
token_index,
Expand Down

0 comments on commit 87ce090

Please sign in to comment.