carbon-marginfi-v2-decoder 1.0.0

MarginfiV2 Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
use crate::types::SpotBalanceType;
/// Minimal representation of a spot position within a User account
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
pub struct SpotPosition {
    /// The scaled balance of the position.
    /// * Precision: SPOT_BALANCE_PRECISION
    pub scaled_balance: u64,
    /// How many spot bids the user has open
    /// * Precision: token mint precision
    pub open_bids: i64,
    /// How many spot asks the user has open
    /// * Precision: token mint precision
    pub open_asks: i64,
    /// The cumulative deposits/borrows a user has made
    /// * Precision: token mint precision
    pub cumulative_deposits: i64,
    /// The market index of the corresponding spot market
    pub market_index: u16,
    /// Whether the position is deposit or borrow
    pub balance_type: SpotBalanceType,
    /// Number of open orders
    pub open_orders: u8,
    /// Padding
    pub padding: [u8; 4],
}