carbon-marginfi-v2-decoder 1.0.0

MarginfiV2 Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
use {crate::types::WrappedI80F48, solana_pubkey::Pubkey};
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
pub struct Balance {
    /// Whether this balance slot is in use (nonzero = active)
    pub active: u8,
    /// The bank this balance corresponds to
    pub bank_pk: Pubkey,
    /// Inherited from the bank when the position is first created and CANNOT BE
    /// CHANGED after that. Note that all balances created before the
    /// addition of this feature use `ASSET_TAG_DEFAULT`
    pub bank_asset_tag: u8,
    /// Tag used by orders to reference this balance (0 means
    /// unused/unassigned). A tag may also have a non-zero value while
    /// having no orders.
    pub tag: u16,
    pub pad0: [u8; 4],
    /// The user's asset (deposit) shares in the bank. Multiply by
    /// `bank.asset_share_value` for the token amount.
    pub asset_shares: WrappedI80F48,
    /// The user's liability (borrow) shares in the bank. Multiply by
    /// `bank.liability_share_value` for the token amount.
    pub liability_shares: WrappedI80F48,
    /// Unclaimed emissions rewards for this position
    pub emissions_outstanding: WrappedI80F48,
    /// Unix timestamp (u64) of the last emissions calculation for this position
    pub last_update: u64,
    /// Reserved for future use
    pub padding: [u64; 1],
}