Skip to content

Commit

Permalink
asset: temp disable price time check (#197)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuru Shao <shaoyuru@gmail.com>
  • Loading branch information
0x0ece and yurushao authored Aug 21, 2024
1 parent b4c3465 commit 7b6a977
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions anchor/programs/glam/src/state/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ impl<'a> AssetMeta<'a> {
let mut asset_price = price_feed.get_price_unchecked();
// On mainnet, enforce that the price is newer than 30s ago
// In tests, ignore this check
#[cfg(feature = "mainnet")]
if (asset_price.publish_time - _timestamp).abs() > 30 {
return Err(InvestorError::InvalidAssetPrice.into());
};
// #[cfg(feature = "mainnet")]
// if (asset_price.publish_time - _timestamp).abs() > 30 {
// return Err(InvestorError::InvalidAssetPrice.into());
// };

// Scale price to expected decimals
let asset_expo = -(self.decimals as i32);
Expand Down

0 comments on commit 7b6a977

Please sign in to comment.