We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3185977 commit 62801bdCopy full SHA for 62801bd
1 file changed
programs/whirlpool/src/state/oracle.rs
@@ -361,6 +361,18 @@ impl<'info> OracleAccessor<'info> {
361
})
362
}
363
364
+ pub fn new_from_whirlpool_key(
365
+ whirlpool: Pubkey,
366
+ oracle_account_info: AccountInfo<'info>,
367
+ ) -> Result<Self> {
368
+ let oracle_account_initialized =
369
+ Self::is_oracle_account_initialized(&oracle_account_info, whirlpool)?;
370
+ Ok(Self {
371
+ oracle_account_info,
372
+ oracle_account_initialized,
373
+ })
374
+ }
375
+
376
pub fn is_trade_enabled(&self, current_timestamp: u64) -> Result<bool> {
377
if !self.oracle_account_initialized {
378
return Ok(true);
0 commit comments