#[repr(C)]pub struct Glv {
pub store: Pubkey,
/* private fields */
}
Expand description
Glv.
Fields§
§store: Pubkey
Store.
Implementations§
Source§impl Glv
impl Glv
Sourcepub const GLV_TOKEN_SEED: &'static [u8] = b"glv_token"
pub const GLV_TOKEN_SEED: &'static [u8] = b"glv_token"
GLV token seed.
Sourcepub const MAX_ALLOWED_NUMBER_OF_MARKETS: usize = 96usize
pub const MAX_ALLOWED_NUMBER_OF_MARKETS: usize = 96usize
Max allowed number of markets.
Sourcepub fn find_glv_token_pda(
store: &Pubkey,
index: u16,
program_id: &Pubkey,
) -> (Pubkey, u8)
pub fn find_glv_token_pda( store: &Pubkey, index: u16, program_id: &Pubkey, ) -> (Pubkey, u8)
Find GLV token address.
Sourcepub fn find_glv_pda(glv_token: &Pubkey, program_id: &Pubkey) -> (Pubkey, u8)
pub fn find_glv_pda(glv_token: &Pubkey, program_id: &Pubkey) -> (Pubkey, u8)
Find GLV address.
Sourcepub fn long_token(&self) -> &Pubkey
pub fn long_token(&self) -> &Pubkey
Get the long token address.
Sourcepub fn short_token(&self) -> &Pubkey
pub fn short_token(&self) -> &Pubkey
Get the short token address.
Sourcepub fn market_tokens(&self) -> impl Iterator<Item = Pubkey>
pub fn market_tokens(&self) -> impl Iterator<Item = Pubkey>
Get all market tokens.
Sourcepub fn num_markets(&self) -> usize
pub fn num_markets(&self) -> usize
Get the total number of markets.
Sourcepub fn contains(&self, market_token: &Pubkey) -> bool
pub fn contains(&self, market_token: &Pubkey) -> bool
Return whether the given market token is contained in this GLV.
Sourcepub fn market_config(&self, market_token: &Pubkey) -> Option<&GlvMarketConfig>
pub fn market_config(&self, market_token: &Pubkey) -> Option<&GlvMarketConfig>
Get GlvMarketConfig
for the given market.
Sourcepub fn tokens_collector(
&self,
action: Option<&impl HasSwapParams>,
) -> TokensCollector
pub fn tokens_collector( &self, action: Option<&impl HasSwapParams>, ) -> TokensCollector
Create a new TokensCollector
.
Source§impl Glv
impl Glv
Sourcepub fn shift_last_executed_at(&self) -> i64
pub fn shift_last_executed_at(&self) -> i64
Get last shift executed ts.
Sourcepub fn shift_min_interval_secs(&self) -> u32
pub fn shift_min_interval_secs(&self) -> u32
Get min shift interval.
Sourcepub fn shift_max_price_impact_factor(&self) -> u128
pub fn shift_max_price_impact_factor(&self) -> u128
Get max shift price impact factor.
Sourcepub fn shift_min_value(&self) -> u128
pub fn shift_min_value(&self) -> u128
Get min shift vaule.
Sourcepub fn min_tokens_for_first_deposit(&self) -> u64
pub fn min_tokens_for_first_deposit(&self) -> u64
Get min tokens for first deposit.
Trait Implementations§
Source§impl AccountDeserialize for Glv
impl AccountDeserialize for Glv
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Glv, Error>
fn try_deserialize(buf: &mut &[u8]) -> Result<Glv, Error>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
.impl Copy for Glv
impl Pod for Glv
impl ZeroCopy for Glv
Auto Trait Implementations§
impl Freeze for Glv
impl RefUnwindSafe for Glv
impl Send for Glv
impl Sync for Glv
impl Unpin for Glv
impl UnwindSafe for Glv
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more