Skip to main content

Account

Struct Account 

Source
#[repr(C)]
pub struct Account {
Show 17 fields pub account_id: u64, pub capital: U128, pub kind: u8, pub pnl: i128, pub reserved_pnl: u128, pub warmup_started_at_slot: u64, pub warmup_slope_per_step: u128, pub position_basis_q: i128, pub adl_a_basis: u128, pub adl_k_snap: i128, pub adl_epoch_snap: u64, pub matcher_program: [u8; 32], pub matcher_context: [u8; 32], pub owner: [u8; 32], pub fee_credits: I128, pub last_fee_slot: u64, pub fees_earned_total: U128,
}
Expand description

Unified account (spec §2.1)

Fields§

§account_id: u64§capital: U128§kind: u8§pnl: i128

Realized PnL (i128, spec §2.1)

§reserved_pnl: u128

Reserved positive PnL (u128, spec §2.1)

§warmup_started_at_slot: u64

Warmup start slot

§warmup_slope_per_step: u128

Linear warmup slope (u128, spec §2.1)

§position_basis_q: i128

Signed fixed-point base quantity basis (i128, spec §2.1)

§adl_a_basis: u128

Side multiplier snapshot at last explicit position attachment (u128)

§adl_k_snap: i128

K coefficient snapshot (i128)

§adl_epoch_snap: u64

Side epoch snapshot

§matcher_program: [u8; 32]

LP matching engine program ID

§matcher_context: [u8; 32]§owner: [u8; 32]

Owner pubkey

§fee_credits: I128

Fee credits

§last_fee_slot: u64§fees_earned_total: U128

Cumulative LP trading fees

Implementations§

Source§

impl Account

Source

pub const KIND_USER: u8 = 0

Source

pub const KIND_LP: u8 = 1

Source

pub fn is_lp(&self) -> bool

Source

pub fn is_user(&self) -> bool

Trait Implementations§

Source§

impl Clone for Account

Source§

fn clone(&self) -> Account

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Account

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Account

Source§

fn eq(&self, other: &Account) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Account

Source§

impl Eq for Account

Source§

impl StructuralPartialEq for Account

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.