Skip to content

Commit a5413ea

Browse files
committed
Pass through OracleGuardRails for margin calc
1 parent b51befc commit a5413ea

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/exports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub extern "C" fn math_calculate_margin_requirement_and_total_collateral_and_lia
8787
let mut oracle_map = OracleMap::load(
8888
&mut oracle_accounts.iter().peekable(),
8989
accounts.latest_slot,
90-
None,
90+
accounts.oracle_guard_rails,
9191
)
9292
.unwrap();
9393

src/types.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//! cross-boundary FFI types
22
use abi_stable::std_types::RResult;
33
use drift_program::{
4-
math::margin::MarginRequirementType, state::margin_calculation::MarginContext,
4+
math::margin::MarginRequirementType,
5+
state::{margin_calculation::MarginContext, state::OracleGuardRails},
56
};
67
use solana_sdk::{
78
account::Account,
@@ -44,11 +45,11 @@ impl<'a> IntoAccountInfo<'a> for &'a mut AccountWithKey {
4445

4546
/// FFI equivalent of an `AccountMap`
4647
#[repr(C)]
47-
#[derive(Debug)]
4848
pub struct AccountsList<'a> {
4949
pub perp_markets: &'a mut [AccountWithKey],
5050
pub spot_markets: &'a mut [AccountWithKey],
5151
pub oracles: &'a mut [AccountWithKey],
52+
pub oracle_guard_rails: Option<OracleGuardRails>,
5253
pub latest_slot: Slot,
5354
}
5455

0 commit comments

Comments
 (0)