Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asset: temp disable price time check #197

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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