Struct mango_v4::state::DynamicAccount
source · pub struct DynamicAccount<Header, Fixed, Dynamic> {
+DynamicAccount in mango_v4::state - Rust Struct mango_v4::state::DynamicAccount
source · pub struct DynamicAccount<Header, Fixed, Dynamic> {
pub header: Header,
pub fixed: Fixed,
pub dynamic: Dynamic,
@@ -45,7 +45,7 @@
&self
) -> impl Iterator<Item = &TokenConditionalSwap>
sourcepub fn active_token_conditional_swaps(
&self
-) -> impl Iterator<Item = &TokenConditionalSwap>
sourcepub fn token_conditional_swap_free_index(&self) -> Result<usize>
sourcepub fn borrow(&self) -> MangoAccountRef<'_>
source§impl<Header: DerefOrBorrowMut<MangoAccountDynamicHeader> + DerefOrBorrow<MangoAccountDynamicHeader>, Fixed: DerefOrBorrowMut<MangoAccountFixed> + DerefOrBorrow<MangoAccountFixed>, Dynamic: DerefOrBorrowMut<[u8]> + DerefOrBorrow<[u8]>> DynamicAccount<Header, Fixed, Dynamic>
sourcepub fn borrow_mut(&mut self) -> MangoAccountRefMut<'_>
sourcepub fn token_position_mut(
+) -> impl Iterator<Item = &TokenConditionalSwap>
sourcepub fn token_conditional_swap_free_index(&self) -> Result<usize>
sourcepub fn borrow(&self) -> MangoAccountRef<'_>
source§impl<Header: DerefOrBorrowMut<MangoAccountDynamicHeader> + DerefOrBorrow<MangoAccountDynamicHeader>, Fixed: DerefOrBorrowMut<MangoAccountFixed> + DerefOrBorrow<MangoAccountFixed>, Dynamic: DerefOrBorrowMut<[u8]> + DerefOrBorrow<[u8]>> DynamicAccount<Header, Fixed, Dynamic>
sourcepub fn borrow_mut(&mut self) -> MangoAccountRefMut<'_>
sourcepub fn token_position_mut(
&mut self,
token_index: TokenIndex
) -> Result<(&mut TokenPosition, usize)>
Returns
@@ -103,67 +103,67 @@ and closed.
&mut self,
perp_market_index: PerpMarketIndex,
settle_token_index: TokenIndex
-) -> Result<(&mut PerpPosition, usize)>sourcepub fn deactivate_perp_position(
+) -> Result<(&mut PerpPosition, usize)>
sourcepub fn deactivate_perp_position(
&mut self,
perp_market_index: PerpMarketIndex,
settle_token_index: TokenIndex
-) -> Result<()>
sourcepub fn deactivate_perp_position_and_log(
+) -> Result<()>
sourcepub fn deactivate_perp_position_and_log(
&mut self,
perp_market_index: PerpMarketIndex,
settle_token_index: TokenIndex,
mango_account_pubkey: Pubkey
-) -> Result<()>
sourcepub fn add_perp_order(
+) -> Result<()>
sourcepub fn find_first_active_unused_perp_position(&self) -> Option<&PerpPosition>
sourcepub fn add_perp_order(
&mut self,
perp_market_index: PerpMarketIndex,
side: Side,
order_tree: BookSideOrderTree,
order: &LeafNode
-) -> Result<()>
sourcepub fn remove_perp_order(&mut self, slot: usize, quantity: i64) -> Result<()>
Removes the perp order and updates the maker bids/asks tracking
+) -> Result<()>sourcepub fn remove_perp_order(&mut self, slot: usize, quantity: i64) -> Result<()>
Removes the perp order and updates the maker bids/asks tracking
The passed in quantity
may differ from the quantity stored on the
perp open order slot, because maybe we’re cancelling an order slot
for quantity 10 where 3 are in-flight in a FillEvent and 7 were left
on the book.
-sourcepub fn execute_perp_maker(
+
sourcepub fn execute_perp_maker(
&mut self,
perp_market_index: PerpMarketIndex,
perp_market: &mut PerpMarket,
fill: &FillEvent,
group: &Group
) -> Result<I80F48>
Returns amount of realized trade pnl for the maker
-sourcepub fn execute_perp_taker(
+
sourcepub fn execute_perp_taker(
&mut self,
perp_market_index: PerpMarketIndex,
perp_market: &mut PerpMarket,
fill: &FillEvent
) -> Result<I80F48>
Returns amount of realized trade pnl for the taker
-sourcepub fn execute_perp_out_event(
+
sourcepub fn execute_perp_out_event(
&mut self,
perp_market_index: PerpMarketIndex,
side: Side,
slot: usize,
quantity: i64,
order_id: u128
-) -> Result<()>
sourcepub fn token_conditional_swap_mut_by_index(
+) -> Result<()>
sourcepub fn token_conditional_swap_mut_by_index(
&mut self,
index: usize
-) -> Result<&mut TokenConditionalSwap>
sourcepub fn free_token_conditional_swap_mut(
+) -> Result<&mut TokenConditionalSwap>
sourcepub fn free_token_conditional_swap_mut(
&mut self
-) -> Result<&mut TokenConditionalSwap>
sourcepub fn check_health_pre(&mut self, health_cache: &HealthCache) -> Result<I80F48>
sourcepub fn check_health_pre_checks(
+) -> Result<&mut TokenConditionalSwap>
sourcepub fn check_health_pre(&mut self, health_cache: &HealthCache) -> Result<I80F48>
sourcepub fn check_health_pre_checks(
&mut self,
health_cache: &HealthCache,
pre_init_health: I80F48
-) -> Result<()>
sourcepub fn check_health_post(
+) -> Result<()>
sourcepub fn check_health_post(
&mut self,
health_cache: &HealthCache,
pre_init_health: I80F48
-) -> Result<I80F48>
sourcepub fn check_health_post_checks(
+) -> Result<I80F48>
sourcepub fn check_health_post_checks(
&mut self,
pre_init_health: I80F48,
post_init_health: I80F48
-) -> Result<()>
sourcepub fn check_liquidatable(
+) -> Result<()>
sourcepub fn check_liquidatable(
&mut self,
health_cache: &HealthCache
-) -> Result<CheckLiquidatable>
sourcepub fn resize_dynamic_content(
+) -> Result<CheckLiquidatable>
sourcepub fn resize_dynamic_content(
&mut self,
new_token_count: u8,
new_serum3_count: u8,
diff --git a/rs/doc/mango_v4/state/trait.MangoAccountLoader.html b/rs/doc/mango_v4/state/trait.MangoAccountLoader.html
index bae78c981..5146f8264 100644
--- a/rs/doc/mango_v4/state/trait.MangoAccountLoader.html
+++ b/rs/doc/mango_v4/state/trait.MangoAccountLoader.html
@@ -1,7 +1,7 @@
-MangoAccountLoader in mango_v4::state - Rust Trait mango_v4::state::MangoAccountLoader
source · pub trait MangoAccountLoader<'a> {
+MangoAccountLoader in mango_v4::state - Rust Trait mango_v4::state::MangoAccountLoader
source · pub trait MangoAccountLoader<'a> {
// Required methods
fn load_full(self) -> Result<MangoAccountLoadedRefCell<'a>>;
fn load_full_mut(self) -> Result<MangoAccountLoadedRefCellMut<'a>>;
fn load_full_init(self) -> Result<MangoAccountLoadedRefCellMut<'a>>;
}
Expand description
Trait to allow a AccountLoader to create an accessor for the full account.
-Required Methods§
sourcefn load_full(self) -> Result<MangoAccountLoadedRefCell<'a>>
sourcefn load_full_mut(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
sourcefn load_full_init(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
Implementations on Foreign Types§
source§impl<'a, 'info: 'a> MangoAccountLoader<'a> for &'a AccountLoader<'info, MangoAccountFixed>
source§fn load_full(self) -> Result<MangoAccountLoadedRefCell<'a>>
source§fn load_full_mut(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
source§fn load_full_init(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
Implementors§
\ No newline at end of file
+
Required Methods§
sourcefn load_full(self) -> Result<MangoAccountLoadedRefCell<'a>>
sourcefn load_full_mut(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
sourcefn load_full_init(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
Implementations on Foreign Types§
source§impl<'a, 'info: 'a> MangoAccountLoader<'a> for &'a AccountLoader<'info, MangoAccountFixed>
source§fn load_full(self) -> Result<MangoAccountLoadedRefCell<'a>>
source§fn load_full_mut(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
source§fn load_full_init(self) -> Result<MangoAccountLoadedRefCellMut<'a>>
Implementors§
- Preparing search index...
- The search index is not available
@blockworks-foundation/mango-v4Class BookSide
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
client: MangoClient
perpMarket: PerpMarket
type: BookSideType
rootFixed: OrderTreeRoot
rootOraclePegged: OrderTreeRoot
orderTreeNodes: OrderTreeNodes
Optional maxBookDelay: number
Returns BookSide
Properties
client
now
order Tree Nodes
perp Market
root Fixed
root Oracle Pegged
type
Static Private INNER_ NODE_ TAG
Static Private LEAF_ NODE_ TAG
Methods
best
Returns undefined | PerpOrder
fixed Items
Returns Generator<PerpOrder, any, unknown>
get Impact Price Ui
Parameters
baseLots: BN
Returns undefined | number
get L2
Parameters
depth: number
Returns [number, number, BN, BN][]
get L2 Ui
Parameters
depth: number
Returns [number, number][]
items
iterates over all orders
-Returns Generator<PerpOrder, any, unknown>
items Valid
Returns Generator<PerpOrder, any, unknown>
items Valid
iterates over all orders, skips oracle pegged orders which are invalid due to oracle price crossing the peg limit, skips tif orders which are invalid due to tif having elapsed,
-Returns Generator<PerpOrder, any, unknown>
oracle Pegged Items
Returns Generator<PerpOrder, any, unknown>
Static from
Parameters
client: MangoClient
perpMarket: PerpMarket
bookSideType: BookSideType
obj: { nodes: OrderTreeNodes; roots: OrderTreeRoot[] }
nodes: OrderTreeNodes
roots: OrderTreeRoot[]
Returns BookSide
Static get Price From Key
Parameters
key: BN
Returns BN
Static to Inner Node
Parameters
client: MangoClient
data: [number]
Returns InnerNode
Static to Leaf Node
Parameters
client: MangoClient
data: [number]
Returns LeafNode
Generated using TypeDoc