pub struct SpotMarket {Show 18 fields
pub pubkey: Vec<u8>,
pub market_index: u16,
pub initial_asset_weight: u32,
pub initial_liability_weight: u32,
pub imf_factor: u32,
pub scale_initial_asset_weight_start: u64,
pub decimals: u32,
pub cumulative_deposit_interest: u128,
pub cumulative_borrow_interest: u128,
pub deposit_balance: u128,
pub borrow_balance: u128,
pub optimal_utilization: u32,
pub optimal_borrow_rate: u32,
pub max_borrow_rate: u32,
pub min_borrow_rate: u8,
pub insurance_fund: InsuranceFund,
pub historical_oracle_data: HistoricalOracleData,
pub oracle: Option<Pubkey>,
}Expand description
Subset of the Drift SpotMarket account fields needed by consumer services.
Includes fields for margin weight calculations, interest rate computation,
and oracle price lookups. Core fields (market_index, decimals, interest,
margin weights) are required; optional fields used only by specific
services use #[serde(default)] for flexibility.
Fields§
§pubkey: Vec<u8>Raw pubkey bytes of the market account (used by api-v2 for lookups).
market_index: u16§initial_asset_weight: u32§initial_liability_weight: u32§imf_factor: u32§scale_initial_asset_weight_start: u64§decimals: u32§cumulative_deposit_interest: u128§cumulative_borrow_interest: u128§deposit_balance: u128§borrow_balance: u128§optimal_utilization: u32§optimal_borrow_rate: u32§max_borrow_rate: u32§min_borrow_rate: u8§insurance_fund: InsuranceFund§historical_oracle_data: HistoricalOracleData§oracle: Option<Pubkey>Oracle account pubkey (used by settlement-service for price lookups).
Trait Implementations§
Source§impl Clone for SpotMarket
impl Clone for SpotMarket
Source§fn clone(&self) -> SpotMarket
fn clone(&self) -> SpotMarket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpotMarket
impl Debug for SpotMarket
Source§impl<'de> Deserialize<'de> for SpotMarket
impl<'de> Deserialize<'de> for SpotMarket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SpotMarket
impl RefUnwindSafe for SpotMarket
impl Send for SpotMarket
impl Sync for SpotMarket
impl Unpin for SpotMarket
impl UnsafeUnpin for SpotMarket
impl UnwindSafe for SpotMarket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more