Struct mango_v4::accounts_ix::GroupWithdrawInsuranceFund
source · pub struct GroupWithdrawInsuranceFund<'info> {
+GroupWithdrawInsuranceFund in mango_v4::accounts_ix - Rust Struct mango_v4::accounts_ix::GroupWithdrawInsuranceFund
source · pub struct GroupWithdrawInsuranceFund<'info> {
pub group: AccountLoader<'info, Group>,
pub admin: Signer<'info>,
pub insurance_vault: Account<'info, TokenAccount>,
pub destination: Account<'info, TokenAccount>,
pub token_program: Program<'info, Token>,
-}
Fields§
§group: AccountLoader<'info, Group>
§admin: Signer<'info>
§insurance_vault: Account<'info, TokenAccount>
§destination: Account<'info, TokenAccount>
§token_program: Program<'info, Token>
Implementations§
source§impl<'info> GroupWithdrawInsuranceFund<'info>
sourcepub fn transfer_ctx(&self) -> CpiContext<'_, '_, '_, 'info, Transfer<'info>>
Trait Implementations§
source§impl<'info> Accounts<'info> for GroupWithdrawInsuranceFund<'info>where
'info: 'info,
source§fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
Returns the validated accounts struct. What constitutes “valid” is
+}Fields§
§group: AccountLoader<'info, Group>
§admin: Signer<'info>
§insurance_vault: Account<'info, TokenAccount>
§destination: Account<'info, TokenAccount>
§token_program: Program<'info, Token>
Implementations§
source§impl<'info> GroupWithdrawInsuranceFund<'info>
sourcepub fn transfer_ctx(&self) -> CpiContext<'_, '_, '_, 'info, Transfer<'info>>
Trait Implementations§
source§impl<'info> Accounts<'info> for GroupWithdrawInsuranceFund<'info>where
'info: 'info,
source§fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
Returns the validated accounts struct. What constitutes “valid” is
program dependent. However, users of these types should never have to
worry about account substitution attacks. For example, if a program
expects a Mint
account from the SPL token program in a particular
diff --git a/rs/doc/src/mango_v4/accounts_ix/group_withdraw_insurance_fund.rs.html b/rs/doc/src/mango_v4/accounts_ix/group_withdraw_insurance_fund.rs.html
index 5e435c86f..0a8fed785 100644
--- a/rs/doc/src/mango_v4/accounts_ix/group_withdraw_insurance_fund.rs.html
+++ b/rs/doc/src/mango_v4/accounts_ix/group_withdraw_insurance_fund.rs.html
@@ -32,7 +32,6 @@
32
33
34
-35
use crate::{error::MangoError, state::*};
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
@@ -40,7 +39,6 @@
#[derive(Accounts)]
pub struct GroupWithdrawInsuranceFund<'info> {
#[account(
- mut,
has_one = insurance_vault,
has_one = admin,
constraint = group.load()?.is_ix_enabled(IxGate::GroupWithdrawInsuranceFund) @ MangoError::IxIsDisabled,
diff --git a/ts/client/classes/As.html b/ts/client/classes/As.html
index b775faae8..d9ee22aca 100644
--- a/ts/client/classes/As.html
+++ b/ts/client/classes/As.html
@@ -1 +1 @@
-As | @blockworks-foundation/mango-v4 Class As<Tag>
Type parameters
Tag: keyof never
Hierarchy
- As
Index
Constructors
Properties
Constructors
constructor
Type parameters
Tag: string | number | symbol
Returns As<Tag>
Properties
Private [$as$]
Static Private Readonly $as$
Generated using TypeDoc
\ No newline at end of file
+As | @blockworks-foundation/mango-v4 Class As<Tag>
Type parameters
Tag: keyof never
Hierarchy
- As
Index
Constructors
Properties
Constructors
constructor
Type parameters
Tag: string | number | symbol
Returns As<Tag>
Properties
Private [$as$]
Static Private Readonly $as$
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Bank.html b/ts/client/classes/Bank.html
index c92b8c014..de8776d34 100644
--- a/ts/client/classes/Bank.html
+++ b/ts/client/classes/Bank.html
@@ -1,5 +1,5 @@
-Bank | @blockworks-foundation/mango-v4 Class Bank
Hierarchy
- Bank
Implements
Index
Constructors
Properties
- _oracle
Last Updated Slot - _oracle
Provider - _price
- _ui
Price - adjustment
Factor - avg
Utilization - bank
Num - bank
Rate Last Updated - borrow
Index - borrow
Weight Scale Start Quote - collected
Fees Native - deposit
Index - deposit
Weight Scale Start Quote - dust
- force
Close - group
- index
Last Updated - indexed
Borrows - indexed
Deposits - init
Asset Weight - init
Liab Weight - last
Net Borrows Window Start Ts - liquidation
Fee - loan
Fee Rate - loan
Origination Fee Rate - maint
Asset Weight - maint
Liab Weight - max
Rate - min
Vault To Deposits Ratio - mint
- mint
Decimals - name
- net
Borrow Limit Per Window Quote - net
Borrow Limit Window Size Ts - net
Borrows In Window - oracle
- oracle
Config - public
Key - rate0
- rate1
- reduce
Only - stable
Price Model - token
Index - util0
- util1
- vault
Accessors
Methods
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
name: number[]
mint: PublicKey
vault: PublicKey
oracle: PublicKey
oracleConfig: OracleConfigDto
stablePriceModel: StablePriceModel
depositIndex: I80F48Dto
borrowIndex: I80F48Dto
indexedDeposits: I80F48Dto
indexedBorrows: I80F48Dto
indexLastUpdated: BN
bankRateLastUpdated: BN
avgUtilization: I80F48Dto
adjustmentFactor: I80F48Dto
util0: I80F48Dto
rate0: I80F48Dto
util1: I80F48Dto
rate1: I80F48Dto
maxRate: I80F48Dto
collectedFeesNative: I80F48Dto
loanOriginationFeeRate: I80F48Dto
loanFeeRate: I80F48Dto
maintAssetWeight: I80F48Dto
initAssetWeight: I80F48Dto
maintLiabWeight: I80F48Dto
initLiabWeight: I80F48Dto
liquidationFee: I80F48Dto
dust: I80F48Dto
flashLoanTokenAccountInitial: BN
flashLoanApprovedAmount: BN
tokenIndex: TokenIndex
mintDecimals: number
bankNum: number
minVaultToDepositsRatio: number
netBorrowLimitWindowSizeTs: BN
lastNetBorrowsWindowStartTs: BN
netBorrowLimitPerWindowQuote: BN
netBorrowsInWindow: BN
borrowWeightScaleStartQuote: number
depositWeightScaleStartQuote: number
reduceOnly: number
forceClose: boolean
Returns Bank
Properties
_oracle Last Updated Slot
_oracle Provider
_price
_ui Price
adjustment Factor
avg Utilization
bank Num
bank Rate Last Updated
borrow Index
borrow Weight Scale Start Quote
collected Fees Native
deposit Index
deposit Weight Scale Start Quote
dust
force Close
group
index Last Updated
indexed Borrows
indexed Deposits
init Asset Weight
init Liab Weight
last Net Borrows Window Start Ts
liquidation Fee
loan Fee Rate
loan Origination Fee Rate
maint Asset Weight
maint Liab Weight
max Rate
min Vault To Deposits Ratio
mint
mint Decimals
name
net Borrow Limit Per Window Quote
net Borrow Limit Window Size Ts
net Borrows In Window
oracle
oracle Config
public Key
rate0
rate1
reduce Only
stable Price Model
token Index
util0
util1
vault
Accessors
oracle Last Updated Slot
Returns number
oracle Provider
Returns OracleProvider
price
Returns I80F48
ui Price
Returns number
Methods
are Borrows Reduce Only
Returns boolean
are Deposits Reduce Only
Returns boolean
get Borrow Rate
Returns I80F48
borrow rate, 0 is 0% where 1 is 100%
-
get Borrow Rate Ui
Returns number
borrow rate percentage
-
get Deposit Rate
Returns I80F48
deposit rate, 0 is 0% where 1 is 100%
-
get Deposit Rate Ui
Returns number
deposit rate percentage
-
native Borrows
Returns I80F48
native Deposits
Returns I80F48
scaled Init Asset Weight
scaled Init Liab Weight
to String
Returns string
ui Borrows
Returns number
ui Deposits
Returns number
Static from
Parameters
publicKey: PublicKey
obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collectedFeesNative: I80F48Dto; depositIndex: I80F48Dto; depositWeightScaleStartQuote: number; dust: I80F48Dto; flashLoanApprovedAmount: BN; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey }
adjustment Factor: I80F48Dto
avg Utilization: I80F48Dto
bank Num: number
bank Rate Last Updated: BN
borrow Index: I80F48Dto
borrow Weight Scale Start Quote: number
collected Fees Native: I80F48Dto
deposit Index: I80F48Dto
deposit Weight Scale Start Quote: number
dust: I80F48Dto
flash Loan Approved Amount: BN
flash Loan Token Account Initial: BN
force Close: number
group: PublicKey
index Last Updated: BN
indexed Borrows: I80F48Dto
indexed Deposits: I80F48Dto
init Asset Weight: I80F48Dto
init Liab Weight: I80F48Dto
last Net Borrows Window Start Ts: BN
liquidation Fee: I80F48Dto
loan Fee Rate: I80F48Dto
loan Origination Fee Rate: I80F48Dto
maint Asset Weight: I80F48Dto
maint Liab Weight: I80F48Dto
max Rate: I80F48Dto
min Vault To Deposits Ratio: number
mint: PublicKey
mint Decimals: number
name: number[]
net Borrow Limit Per Window Quote: BN
net Borrow Limit Window Size Ts: BN
net Borrows In Window: BN
oracle: PublicKey
oracle Config: OracleConfigDto
rate0: I80F48Dto
rate1: I80F48Dto
reduce Only: number
stable Price Model: StablePriceModel
token Index: number
util0: I80F48Dto
util1: I80F48Dto
vault: PublicKey
Returns Bank
Generated using TypeDoc
\ No newline at end of file
+Bank | @blockworks-foundation/mango-v4 Class Bank
Hierarchy
- Bank
Implements
Index
Constructors
Properties
- _oracle
Last Updated Slot - _oracle
Provider - _price
- _ui
Price - adjustment
Factor - avg
Utilization - bank
Num - bank
Rate Last Updated - borrow
Index - borrow
Weight Scale Start Quote - collected
Fees Native - deposit
Index - deposit
Weight Scale Start Quote - dust
- force
Close - group
- index
Last Updated - indexed
Borrows - indexed
Deposits - init
Asset Weight - init
Liab Weight - last
Net Borrows Window Start Ts - liquidation
Fee - loan
Fee Rate - loan
Origination Fee Rate - maint
Asset Weight - maint
Liab Weight - max
Rate - min
Vault To Deposits Ratio - mint
- mint
Decimals - name
- net
Borrow Limit Per Window Quote - net
Borrow Limit Window Size Ts - net
Borrows In Window - oracle
- oracle
Config - public
Key - rate0
- rate1
- reduce
Only - stable
Price Model - token
Index - util0
- util1
- vault
Accessors
Methods
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
name: number[]
mint: PublicKey
vault: PublicKey
oracle: PublicKey
oracleConfig: OracleConfigDto
stablePriceModel: StablePriceModel
depositIndex: I80F48Dto
borrowIndex: I80F48Dto
indexedDeposits: I80F48Dto
indexedBorrows: I80F48Dto
indexLastUpdated: BN
bankRateLastUpdated: BN
avgUtilization: I80F48Dto
adjustmentFactor: I80F48Dto
util0: I80F48Dto
rate0: I80F48Dto
util1: I80F48Dto
rate1: I80F48Dto
maxRate: I80F48Dto
collectedFeesNative: I80F48Dto
loanOriginationFeeRate: I80F48Dto
loanFeeRate: I80F48Dto
maintAssetWeight: I80F48Dto
initAssetWeight: I80F48Dto
maintLiabWeight: I80F48Dto
initLiabWeight: I80F48Dto
liquidationFee: I80F48Dto
dust: I80F48Dto
flashLoanTokenAccountInitial: BN
flashLoanApprovedAmount: BN
tokenIndex: TokenIndex
mintDecimals: number
bankNum: number
minVaultToDepositsRatio: number
netBorrowLimitWindowSizeTs: BN
lastNetBorrowsWindowStartTs: BN
netBorrowLimitPerWindowQuote: BN
netBorrowsInWindow: BN
borrowWeightScaleStartQuote: number
depositWeightScaleStartQuote: number
reduceOnly: number
forceClose: boolean
Returns Bank
Properties
_oracle Last Updated Slot
_oracle Provider
_price
_ui Price
adjustment Factor
avg Utilization
bank Num
bank Rate Last Updated
borrow Index
borrow Weight Scale Start Quote
collected Fees Native
deposit Index
deposit Weight Scale Start Quote
dust
force Close
group
index Last Updated
indexed Borrows
indexed Deposits
init Asset Weight
init Liab Weight
last Net Borrows Window Start Ts
liquidation Fee
loan Fee Rate
loan Origination Fee Rate
maint Asset Weight
maint Liab Weight
max Rate
min Vault To Deposits Ratio
mint
mint Decimals
name
net Borrow Limit Per Window Quote
net Borrow Limit Window Size Ts
net Borrows In Window
oracle
oracle Config
public Key
rate0
rate1
reduce Only
stable Price Model
token Index
util0
util1
vault
Accessors
oracle Last Updated Slot
Returns number
oracle Provider
Returns OracleProvider
price
Returns I80F48
ui Price
Returns number
Methods
are Borrows Reduce Only
Returns boolean
are Deposits Reduce Only
Returns boolean
get Borrow Rate
Returns I80F48
borrow rate, 0 is 0% where 1 is 100%
+
get Borrow Rate Ui
Returns number
borrow rate percentage
+
get Deposit Rate
Returns I80F48
deposit rate, 0 is 0% where 1 is 100%
+
get Deposit Rate Ui
Returns number
deposit rate percentage
+
native Borrows
Returns I80F48
native Deposits
Returns I80F48
scaled Init Asset Weight
scaled Init Liab Weight
to String
Returns string
ui Borrows
Returns number
ui Deposits
Returns number
Static from
Parameters
publicKey: PublicKey
obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collectedFeesNative: I80F48Dto; depositIndex: I80F48Dto; depositWeightScaleStartQuote: number; dust: I80F48Dto; flashLoanApprovedAmount: BN; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey }
adjustment Factor: I80F48Dto
avg Utilization: I80F48Dto
bank Num: number
bank Rate Last Updated: BN
borrow Index: I80F48Dto
borrow Weight Scale Start Quote: number
collected Fees Native: I80F48Dto
deposit Index: I80F48Dto
deposit Weight Scale Start Quote: number
dust: I80F48Dto
flash Loan Approved Amount: BN
flash Loan Token Account Initial: BN
force Close: number
group: PublicKey
index Last Updated: BN
indexed Borrows: I80F48Dto
indexed Deposits: I80F48Dto
init Asset Weight: I80F48Dto
init Liab Weight: I80F48Dto
last Net Borrows Window Start Ts: BN
liquidation Fee: I80F48Dto
loan Fee Rate: I80F48Dto
loan Origination Fee Rate: I80F48Dto
maint Asset Weight: I80F48Dto
maint Liab Weight: I80F48Dto
max Rate: I80F48Dto
min Vault To Deposits Ratio: number
mint: PublicKey
mint Decimals: number
name: number[]
net Borrow Limit Per Window Quote: BN
net Borrow Limit Window Size Ts: BN
net Borrows In Window: BN
oracle: PublicKey
oracle Config: OracleConfigDto
rate0: I80F48Dto
rate1: I80F48Dto
reduce Only: number
stable Price Model: StablePriceModel
token Index: number
util0: I80F48Dto
util1: I80F48Dto
vault: PublicKey
Returns Bank
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/BookSide.html b/ts/client/classes/BookSide.html
index 7bcff0875..14589b659 100644
--- a/ts/client/classes/BookSide.html
+++ b/ts/client/classes/BookSide.html
@@ -1,7 +1,7 @@
-BookSide | @blockworks-foundation/mango-v4 Class BookSide
Hierarchy
- BookSide
Index
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
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
\ No newline at end of file
diff --git a/ts/client/classes/BookSideType.html b/ts/client/classes/BookSideType.html
index c26a880dd..acbd2e086 100644
--- a/ts/client/classes/BookSideType.html
+++ b/ts/client/classes/BookSideType.html
@@ -1 +1 @@
-BookSideType | @blockworks-foundation/mango-v4 Class BookSideType
Hierarchy
- BookSideType
Index
Constructors
Properties
Constructors
constructor
Returns BookSideType
Properties
Static asks
Type declaration
asks: {}
Static bids
Type declaration
bids: {}
Generated using TypeDoc
\ No newline at end of file
+BookSideType | @blockworks-foundation/mango-v4 Class BookSideType
Hierarchy
- BookSideType
Index
Constructors
Properties
Constructors
constructor
Returns BookSideType
Properties
Static asks
Type declaration
asks: {}
Static bids
Type declaration
bids: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/FlashLoanType.html b/ts/client/classes/FlashLoanType.html
index a3803a09b..f40d5c94c 100644
--- a/ts/client/classes/FlashLoanType.html
+++ b/ts/client/classes/FlashLoanType.html
@@ -1 +1 @@
-FlashLoanType | @blockworks-foundation/mango-v4 Class FlashLoanType
Hierarchy
- FlashLoanType
Index
Constructors
Properties
Constructors
constructor
Returns FlashLoanType
Properties
Static swap
Type declaration
swap: {}
Static unknown
Type declaration
unknown: {}
Generated using TypeDoc
\ No newline at end of file
+FlashLoanType | @blockworks-foundation/mango-v4 Class FlashLoanType
Hierarchy
- FlashLoanType
Index
Constructors
Properties
Constructors
constructor
Returns FlashLoanType
Properties
Static swap
Type declaration
swap: {}
Static unknown
Type declaration
unknown: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/FlashLoanWithdraw.html b/ts/client/classes/FlashLoanWithdraw.html
index caf64f3be..7f15db2c7 100644
--- a/ts/client/classes/FlashLoanWithdraw.html
+++ b/ts/client/classes/FlashLoanWithdraw.html
@@ -1 +1 @@
-FlashLoanWithdraw | @blockworks-foundation/mango-v4 Class FlashLoanWithdraw
Hierarchy
- FlashLoanWithdraw
Index
Constructors
Properties
Constructors
constructor
Returns FlashLoanWithdraw
Properties
Static amount
Static index
Generated using TypeDoc
\ No newline at end of file
+FlashLoanWithdraw | @blockworks-foundation/mango-v4 Class FlashLoanWithdraw
Hierarchy
- FlashLoanWithdraw
Index
Constructors
Properties
Constructors
constructor
Returns FlashLoanWithdraw
Properties
Static amount
Static index
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Group.html b/ts/client/classes/Group.html
index 5f8a329b2..6bdb0a100 100644
--- a/ts/client/classes/Group.html
+++ b/ts/client/classes/Group.html
@@ -1,2 +1,2 @@
-Group | @blockworks-foundation/mango-v4 Class Group
Hierarchy
- Group
Index
Constructors
Properties
- address
Lookup Tables - address
Lookup Tables List - admin
- banks
Map By Mint - banks
Map By Name - banks
Map By Token Index - buyback
Fees - buyback
Fees Expiry Interval - buyback
Fees Mngo Bonus Factor - buyback
Fees Swap Mango Account - creator
- deposit
Limit Quote - fast
Listing Admin - group
Num - insurance
Mint - insurance
Vault - ix
Gate - mint
Infos Map By Mint - mint
Infos Map By Token Index - mngo
Token Index - perp
Markets Map By Market Index - perp
Markets Map By Name - perp
Markets Map By Oracle - public
Key - security
Admin - serum3
External Markets Map - serum3
Markets Map By External - serum3
Markets Map By Market Index - testing
- vault
Amounts Map - version
Methods
- console
Log Banks - decode
Price From Oracle Ai - find
Perp Market - get
First Bank By Mint - get
First Bank By Token Index - get
First Bank For Mngo - get
First Bank For Perp Settlement - get
Insurance Mint Decimals - get
Mint Decimals - get
Mint Decimals By Token Index - get
Perp Market By Market Index - get
Perp Market By Name - get
Perp Market By Oracle - get
Serum3 External Market - get
Serum3 Market By External Market - get
Serum3 Market By Market Index - get
Serum3 Market By Name - get
Token Vault Balance By Mint Ui - load
Perp Asks For Market - load
Perp Bids For Market - load
Serum3 Asks For Market - load
Serum3 Bids For Market - reload
All - reload
Alts - reload
Bank Oracle Prices - reload
Banks - reload
Mint Infos - reload
Perp Market Oracle Prices - reload
Perp Markets - reload
Serum3 External Markets - reload
Serum3 Markets - reload
Vaults - to
Native Decimals - to
Native Price - to
String - to
Ui Price - from
Constructors
constructor
Parameters
publicKey: PublicKey
creator: PublicKey
groupNum: number
admin: PublicKey
fastListingAdmin: PublicKey
mngoTokenIndex: TokenIndex
insuranceMint: PublicKey
insuranceVault: PublicKey
testing: number
version: number
buybackFees: boolean
buybackFeesMngoBonusFactor: number
addressLookupTables: PublicKey[]
securityAdmin: PublicKey
depositLimitQuote: any
ixGate: BN
buybackFeesSwapMangoAccount: PublicKey
buybackFeesExpiryInterval: BN
addressLookupTablesList: AddressLookupTableAccount[]
banksMapByName: Map<string, Bank[]>
banksMapByMint: Map<string, Bank[]>
banksMapByTokenIndex: Map<TokenIndex, Bank[]>
serum3MarketsMapByExternal: Map<string, Serum3Market>
serum3MarketsMapByMarketIndex: Map<MarketIndex, Serum3Market>
serum3ExternalMarketsMap: Map<string, Market>
perpMarketsMapByOracle: Map<string, PerpMarket>
perpMarketsMapByMarketIndex: Map<PerpMarketIndex, PerpMarket>
perpMarketsMapByName: Map<string, PerpMarket>
mintInfosMapByTokenIndex: Map<TokenIndex, MintInfo>
mintInfosMapByMint: Map<string, MintInfo>
vaultAmountsMap: Map<string, BN>
Returns Group
Properties
address Lookup Tables
address Lookup Tables List
admin
banks Map By Mint
banks Map By Name
banks Map By Token Index
buyback Fees
buyback Fees Expiry Interval
buyback Fees Mngo Bonus Factor
buyback Fees Swap Mango Account
creator
deposit Limit Quote
fast Listing Admin
group Num
insurance Mint
insurance Vault
ix Gate
mint Infos Map By Mint
mint Infos Map By Token Index
mngo Token Index
perp Markets Map By Market Index
perp Markets Map By Name
perp Markets Map By Oracle
public Key
security Admin
serum3 External Markets Map
serum3 Markets Map By External
serum3 Markets Map By Market Index
testing
vault Amounts Map
version
Methods
console Log Banks
Returns void
decode Price From Oracle Ai
Parameters
coder: BorshAccountsCoder<string>
oracle: PublicKey
ai: AccountInfo<Buffer>
baseDecimals: number
client: MangoClient
Returns Promise<{ lastUpdatedSlot: number; price: I80F48; provider: OracleProvider; uiPrice: number }>
find Perp Market
Parameters
marketIndex: PerpMarketIndex
Returns PerpMarket
get First Bank By Mint
Parameters
mintPk: PublicKey
Returns Bank
get First Bank By Token Index
Parameters
tokenIndex: TokenIndex
Returns Bank
get First Bank For Mngo
Returns Bank
get First Bank For Perp Settlement
Returns Bank
get Insurance Mint Decimals
Returns number
get Mint Decimals
Parameters
mintPk: PublicKey
Returns number
get Mint Decimals By Token Index
Parameters
tokenIndex: TokenIndex
Returns number
get Perp Market By Market Index
Parameters
marketIndex: PerpMarketIndex
Returns PerpMarket
get Perp Market By Name
Parameters
perpMarketName: string
Returns PerpMarket
get Perp Market By Oracle
Parameters
oracle: PublicKey
Returns PerpMarket
get Serum3 External Market
Parameters
externalMarketPk: PublicKey
Returns Market
get Serum3 Market By External Market
Parameters
externalMarketPk: PublicKey
Returns Serum3Market
get Serum3 Market By Market Index
Parameters
marketIndex: MarketIndex
Returns Serum3Market
get Serum3 Market By Name
Parameters
name: string
Returns Serum3Market
get Token Vault Balance By Mint Ui
Parameters
mintPk: PublicKey
Returns number
sum of ui balances of vaults for all banks for a token
-
load Perp Asks For Market
Parameters
client: MangoClient
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<BookSide>
load Perp Bids For Market
Parameters
client: MangoClient
perpMarketIndex: PerpMarketIndex
Returns Promise<BookSide>
load Serum3 Asks For Market
Parameters
client: MangoClient
externalMarketPk: PublicKey
Returns Promise<Orderbook>
load Serum3 Bids For Market
Parameters
client: MangoClient
externalMarketPk: PublicKey
Returns Promise<Orderbook>
reload All
Parameters
client: MangoClient
Returns Promise<void>
reload Alts
Parameters
client: MangoClient
Returns Promise<void>
reload Bank Oracle Prices
Parameters
client: MangoClient
Returns Promise<void>
reload Banks
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Mint Infos
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Perp Market Oracle Prices
Parameters
client: MangoClient
Returns Promise<void>
reload Perp Markets
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Serum3 External Markets
Parameters
client: MangoClient
Returns Promise<void>
reload Serum3 Markets
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Vaults
Parameters
client: MangoClient
Returns Promise<void>
to Native Decimals
Parameters
uiAmount: number
mintPk: PublicKey
Returns BN
to Native Price
Parameters
uiPrice: number
baseDecimals: number
Returns I80F48
to String
Returns string
to Ui Price
Parameters
price: number | I80F48
baseDecimals: number
Returns number
Static from
Parameters
publicKey: PublicKey
obj: { addressLookupTables: PublicKey[]; admin: PublicKey; buybackFees: number; buybackFeesExpiryInterval: BN; buybackFeesMngoBonusFactor: number; buybackFeesSwapMangoAccount: PublicKey; creator: PublicKey; depositLimitQuote: BN; fastListingAdmin: PublicKey; groupNum: number; insuranceMint: PublicKey; insuranceVault: PublicKey; ixGate: BN; mngoTokenIndex: number; securityAdmin: PublicKey; testing: number; version: number }
address Lookup Tables: PublicKey[]
admin: PublicKey
buyback Fees: number
buyback Fees Expiry Interval: BN
buyback Fees Mngo Bonus Factor: number
buyback Fees Swap Mango Account: PublicKey
creator: PublicKey
deposit Limit Quote: BN
fast Listing Admin: PublicKey
group Num: number
insurance Mint: PublicKey
insurance Vault: PublicKey
ix Gate: BN
mngo Token Index: number
security Admin: PublicKey
testing: number
version: number
Returns Group
Generated using TypeDoc
\ No newline at end of file
+Group | @blockworks-foundation/mango-v4 Class Group
Hierarchy
- Group
Index
Constructors
Properties
- address
Lookup Tables - address
Lookup Tables List - admin
- banks
Map By Mint - banks
Map By Name - banks
Map By Token Index - buyback
Fees - buyback
Fees Expiry Interval - buyback
Fees Mngo Bonus Factor - buyback
Fees Swap Mango Account - creator
- deposit
Limit Quote - fast
Listing Admin - group
Num - insurance
Mint - insurance
Vault - ix
Gate - mint
Infos Map By Mint - mint
Infos Map By Token Index - mngo
Token Index - perp
Markets Map By Market Index - perp
Markets Map By Name - perp
Markets Map By Oracle - public
Key - security
Admin - serum3
External Markets Map - serum3
Markets Map By External - serum3
Markets Map By Market Index - testing
- vault
Amounts Map - version
Methods
- console
Log Banks - decode
Price From Oracle Ai - find
Perp Market - get
First Bank By Mint - get
First Bank By Token Index - get
First Bank For Mngo - get
First Bank For Perp Settlement - get
Insurance Mint Decimals - get
Mint Decimals - get
Mint Decimals By Token Index - get
Perp Market By Market Index - get
Perp Market By Name - get
Perp Market By Oracle - get
Serum3 External Market - get
Serum3 Market By External Market - get
Serum3 Market By Market Index - get
Serum3 Market By Name - get
Token Vault Balance By Mint Ui - load
Perp Asks For Market - load
Perp Bids For Market - load
Serum3 Asks For Market - load
Serum3 Bids For Market - reload
All - reload
Alts - reload
Bank Oracle Prices - reload
Banks - reload
Mint Infos - reload
Perp Market Oracle Prices - reload
Perp Markets - reload
Serum3 External Markets - reload
Serum3 Markets - reload
Vaults - to
Native Decimals - to
Native Price - to
String - to
Ui Price - from
Constructors
constructor
Parameters
publicKey: PublicKey
creator: PublicKey
groupNum: number
admin: PublicKey
fastListingAdmin: PublicKey
mngoTokenIndex: TokenIndex
insuranceMint: PublicKey
insuranceVault: PublicKey
testing: number
version: number
buybackFees: boolean
buybackFeesMngoBonusFactor: number
addressLookupTables: PublicKey[]
securityAdmin: PublicKey
depositLimitQuote: any
ixGate: BN
buybackFeesSwapMangoAccount: PublicKey
buybackFeesExpiryInterval: BN
addressLookupTablesList: AddressLookupTableAccount[]
banksMapByName: Map<string, Bank[]>
banksMapByMint: Map<string, Bank[]>
banksMapByTokenIndex: Map<TokenIndex, Bank[]>
serum3MarketsMapByExternal: Map<string, Serum3Market>
serum3MarketsMapByMarketIndex: Map<MarketIndex, Serum3Market>
serum3ExternalMarketsMap: Map<string, Market>
perpMarketsMapByOracle: Map<string, PerpMarket>
perpMarketsMapByMarketIndex: Map<PerpMarketIndex, PerpMarket>
perpMarketsMapByName: Map<string, PerpMarket>
mintInfosMapByTokenIndex: Map<TokenIndex, MintInfo>
mintInfosMapByMint: Map<string, MintInfo>
vaultAmountsMap: Map<string, BN>
Returns Group
Properties
address Lookup Tables
address Lookup Tables List
admin
banks Map By Mint
banks Map By Name
banks Map By Token Index
buyback Fees
buyback Fees Expiry Interval
buyback Fees Mngo Bonus Factor
buyback Fees Swap Mango Account
creator
deposit Limit Quote
fast Listing Admin
group Num
insurance Mint
insurance Vault
ix Gate
mint Infos Map By Mint
mint Infos Map By Token Index
mngo Token Index
perp Markets Map By Market Index
perp Markets Map By Name
perp Markets Map By Oracle
public Key
security Admin
serum3 External Markets Map
serum3 Markets Map By External
serum3 Markets Map By Market Index
testing
vault Amounts Map
version
Methods
console Log Banks
Returns void
decode Price From Oracle Ai
Parameters
coder: BorshAccountsCoder<string>
oracle: PublicKey
ai: AccountInfo<Buffer>
baseDecimals: number
client: MangoClient
Returns Promise<{ lastUpdatedSlot: number; price: I80F48; provider: OracleProvider; uiPrice: number }>
find Perp Market
Parameters
marketIndex: PerpMarketIndex
Returns PerpMarket
get First Bank By Mint
Parameters
mintPk: PublicKey
Returns Bank
get First Bank By Token Index
Parameters
tokenIndex: TokenIndex
Returns Bank
get First Bank For Mngo
Returns Bank
get First Bank For Perp Settlement
Returns Bank
get Insurance Mint Decimals
Returns number
get Mint Decimals
Parameters
mintPk: PublicKey
Returns number
get Mint Decimals By Token Index
Parameters
tokenIndex: TokenIndex
Returns number
get Perp Market By Market Index
Parameters
marketIndex: PerpMarketIndex
Returns PerpMarket
get Perp Market By Name
Parameters
perpMarketName: string
Returns PerpMarket
get Perp Market By Oracle
Parameters
oracle: PublicKey
Returns PerpMarket
get Serum3 External Market
Parameters
externalMarketPk: PublicKey
Returns Market
get Serum3 Market By External Market
Parameters
externalMarketPk: PublicKey
Returns Serum3Market
get Serum3 Market By Market Index
Parameters
marketIndex: MarketIndex
Returns Serum3Market
get Serum3 Market By Name
Parameters
name: string
Returns Serum3Market
get Token Vault Balance By Mint Ui
Parameters
mintPk: PublicKey
Returns number
sum of ui balances of vaults for all banks for a token
+
load Perp Asks For Market
Parameters
client: MangoClient
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<BookSide>
load Perp Bids For Market
Parameters
client: MangoClient
perpMarketIndex: PerpMarketIndex
Returns Promise<BookSide>
load Serum3 Asks For Market
Parameters
client: MangoClient
externalMarketPk: PublicKey
Returns Promise<Orderbook>
load Serum3 Bids For Market
Parameters
client: MangoClient
externalMarketPk: PublicKey
Returns Promise<Orderbook>
reload All
Parameters
client: MangoClient
Returns Promise<void>
reload Alts
Parameters
client: MangoClient
Returns Promise<void>
reload Bank Oracle Prices
Parameters
client: MangoClient
Returns Promise<void>
reload Banks
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Mint Infos
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Perp Market Oracle Prices
Parameters
client: MangoClient
Returns Promise<void>
reload Perp Markets
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Serum3 External Markets
Parameters
client: MangoClient
Returns Promise<void>
reload Serum3 Markets
Parameters
client: MangoClient
Optional ids: Id
Returns Promise<void>
reload Vaults
Parameters
client: MangoClient
Returns Promise<void>
to Native Decimals
Parameters
uiAmount: number
mintPk: PublicKey
Returns BN
to Native Price
Parameters
uiPrice: number
baseDecimals: number
Returns I80F48
to String
Returns string
to Ui Price
Parameters
price: number | I80F48
baseDecimals: number
Returns number
Static from
Parameters
publicKey: PublicKey
obj: { addressLookupTables: PublicKey[]; admin: PublicKey; buybackFees: number; buybackFeesExpiryInterval: BN; buybackFeesMngoBonusFactor: number; buybackFeesSwapMangoAccount: PublicKey; creator: PublicKey; depositLimitQuote: BN; fastListingAdmin: PublicKey; groupNum: number; insuranceMint: PublicKey; insuranceVault: PublicKey; ixGate: BN; mngoTokenIndex: number; securityAdmin: PublicKey; testing: number; version: number }
address Lookup Tables: PublicKey[]
admin: PublicKey
buyback Fees: number
buyback Fees Expiry Interval: BN
buyback Fees Mngo Bonus Factor: number
buyback Fees Swap Mango Account: PublicKey
creator: PublicKey
deposit Limit Quote: BN
fast Listing Admin: PublicKey
group Num: number
insurance Mint: PublicKey
insurance Vault: PublicKey
ix Gate: BN
mngo Token Index: number
security Admin: PublicKey
testing: number
version: number
Returns Group
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/HealthType.html b/ts/client/classes/HealthType.html
index 4b3b395bf..6c7df4dd9 100644
--- a/ts/client/classes/HealthType.html
+++ b/ts/client/classes/HealthType.html
@@ -1 +1 @@
-HealthType | @blockworks-foundation/mango-v4 Class HealthType
Hierarchy
- HealthType
Index
Constructors
Properties
Constructors
constructor
Returns HealthType
Properties
Static init
Type declaration
init: {}
Static liquidation End
Type declaration
liquidation End: {}
Static maint
Type declaration
maint: {}
Generated using TypeDoc
\ No newline at end of file
+HealthType | @blockworks-foundation/mango-v4 Class HealthType
Hierarchy
- HealthType
Index
Constructors
Properties
Constructors
constructor
Returns HealthType
Properties
Static init
Type declaration
init: {}
Static liquidation End
Type declaration
liquidation End: {}
Static maint
Type declaration
maint: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/I80F48.html b/ts/client/classes/I80F48.html
index 82188fea4..9b4a1ec1d 100644
--- a/ts/client/classes/I80F48.html
+++ b/ts/client/classes/I80F48.html
@@ -1,11 +1,11 @@
-I80F48 | @blockworks-foundation/mango-v4 Class I80F48
Hierarchy
- I80F48
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
data: BN
Returns I80F48
Properties
data
Static FRACTIONS
Static MAX_ BN
Static MAX_ SIZE
+I80F48 | @blockworks-foundation/mango-v4 Class I80F48
Hierarchy
- I80F48
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
data: BN
Returns I80F48
Properties
data
Static FRACTIONS
Static MAX_ BN
Static MAX_ SIZE
This is represented by a 128 bit signed integer underneath
The first 80 bits are treated as an integer and last 48 bits are treated as fractional part after binary point
It's possible to think of an I80F48 as an i128 divided by 2 ^ 40
Read up on how fixed point math works: https://inst.eecs.berkeley.edu/~cs61c/sp06/handout/fixedpt.html
Read up on how 2s complement works: https://en.wikipedia.org/wiki/Two%27s_complement
-Static MIN_ BN
Static MULTIPLIER_ BIG
Static MULTIPLIER_ BN
Static MULTIPLIER_ NUMBER
Methods
abs
Returns I80F48
add
ceil
Returns I80F48
cmp
Parameters
x: I80F48
Returns 0 | 1 | -1
div
eq
Parameters
x: I80F48
Returns boolean
floor
Returns I80F48
frac
Returns I80F48
get Binary Layout
Returns string
get Data
Returns BN
gt
Parameters
x: I80F48
Returns boolean
gte
Parameters
x: I80F48
Returns boolean
iadd
idiv
imul
is Neg
Returns boolean
is Pos
Returns boolean
is Zero
Returns boolean
isub
lt
Parameters
x: I80F48
Returns boolean
lte
Parameters
x: I80F48
Returns boolean
max
min
mul
-
+
Static MIN_ BN
Static MULTIPLIER_ BIG
Static MULTIPLIER_ BN
Static MULTIPLIER_ NUMBER
Methods
abs
Returns I80F48
add
ceil
Returns I80F48
cmp
Parameters
x: I80F48
Returns 0 | 1 | -1
div
eq
Parameters
x: I80F48
Returns boolean
floor
Returns I80F48
frac
Returns I80F48
get Binary Layout
Returns string
get Data
Returns BN
gt
Parameters
x: I80F48
Returns boolean
gte
Parameters
x: I80F48
Returns boolean
iadd
idiv
imul
is Neg
Returns boolean
is Pos
Returns boolean
is Zero
Returns boolean
isub
lt
Parameters
x: I80F48
Returns boolean
lte
Parameters
x: I80F48
Returns boolean
max
min
mul
neg
Returns I80F48
sub
to Array
Returns Uint8Array
to Array Like
Parameters
ArrayType: BufferConstructor
Optional endian: Endianness
Optional length: number
Returns Buffer
to Big
Returns Big
to Fixed
neg
Returns I80F48
sub
to Array
Returns Uint8Array
to Array Like
Parameters
ArrayType: BufferConstructor
Optional endian: Endianness
Optional length: number
Returns Buffer
to Big
Returns Big
to Fixed
-
The number will be rounded first for UI sensibilities, then toFixed
-Parameters
Optional decimals: number
Returns string
to Locale String
Parameters
Optional locales: string | string[]
Optional options: NumberFormatOptions
Returns string
to Number
Returns number
to String
Returns string
to Twos
Returns BN
Static from
Static from Array
Parameters
src: Uint8Array
Returns I80F48
Static from Big
Parameters
x: Big
Returns I80F48
Static from I64
Parameters
x: BN
Returns I80F48
Static from Number
Parameters
x: number
Returns I80F48
Static from Number Or Undef
Parameters
Optional x: number
Returns undefined | I80F48
Static from Optional String
Parameters
Optional x: string
Returns undefined | I80F48
Static from String
Parameters
x: string
Returns I80F48
Static from U64
Parameters
x: BN
Returns I80F48
Generated using TypeDoc
\ No newline at end of file
+Parameters
Optional decimals: number
Returns string
to Locale String
Parameters
Optional locales: string | string[]
Optional options: NumberFormatOptions
Returns string
to Number
Returns number
to String
Returns string
to Twos
Returns BN
Static from
Static from Array
Parameters
src: Uint8Array
Returns I80F48
Static from Big
Parameters
x: Big
Returns I80F48
Static from I64
Parameters
x: BN
Returns I80F48
Static from Number
Parameters
x: number
Returns I80F48
Static from Number Or Undef
Parameters
Optional x: number
Returns undefined | I80F48
Static from Optional String
Parameters
Optional x: string
Returns undefined | I80F48
Static from String
Parameters
x: string
Returns I80F48
Static from U64
Parameters
x: BN
Returns I80F48
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/I80F48Dto.html b/ts/client/classes/I80F48Dto.html
index 7d7c863c7..72a1939aa 100644
--- a/ts/client/classes/I80F48Dto.html
+++ b/ts/client/classes/I80F48Dto.html
@@ -1 +1 @@
-I80F48Dto | @blockworks-foundation/mango-v4 Class I80F48Dto
Hierarchy
- I80F48Dto
Index
Constructors
Properties
Constructors
constructor
Parameters
val: BN
Returns I80F48Dto
Properties
val
Generated using TypeDoc
\ No newline at end of file
+I80F48Dto | @blockworks-foundation/mango-v4 Class I80F48Dto
Hierarchy
- I80F48Dto
Index
Constructors
Properties
Constructors
constructor
Parameters
val: BN
Returns I80F48Dto
Properties
val
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/InnerNode.html b/ts/client/classes/InnerNode.html
index 0920f1036..74481db3d 100644
--- a/ts/client/classes/InnerNode.html
+++ b/ts/client/classes/InnerNode.html
@@ -1 +1 @@
-InnerNode | @blockworks-foundation/mango-v4 Class InnerNode
Generated using TypeDoc
\ No newline at end of file
+InnerNode | @blockworks-foundation/mango-v4 Class InnerNode
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/InterestRateParams.html b/ts/client/classes/InterestRateParams.html
index c9e283450..23dff2730 100644
--- a/ts/client/classes/InterestRateParams.html
+++ b/ts/client/classes/InterestRateParams.html
@@ -1 +1 @@
-InterestRateParams | @blockworks-foundation/mango-v4 Class InterestRateParams
Hierarchy
- InterestRateParams
Index
Constructors
Properties
Constructors
constructor
Returns InterestRateParams
Properties
adjustment Factor
max Rate
rate0
rate1
util0
util1
Generated using TypeDoc
\ No newline at end of file
+InterestRateParams | @blockworks-foundation/mango-v4 Class InterestRateParams
Hierarchy
- InterestRateParams
Index
Constructors
Properties
Constructors
constructor
Returns InterestRateParams
Properties
adjustment Factor
max Rate
rate0
rate1
util0
util1
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/LeafNode.html b/ts/client/classes/LeafNode.html
index cc71f9b81..6e65d59fd 100644
--- a/ts/client/classes/LeafNode.html
+++ b/ts/client/classes/LeafNode.html
@@ -1 +1 @@
-LeafNode | @blockworks-foundation/mango-v4 Class LeafNode
Hierarchy
- LeafNode
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
ownerSlot: number
orderType: PerpOrderType
timeInForce: number
key: BN
owner: PublicKey
quantity: BN
timestamp: BN
pegLimit: BN
Returns LeafNode
Properties
key
order Type
owner
owner Slot
peg Limit
quantity
time In Force
timestamp
Methods
Static from
Parameters
obj: { key: BN; orderType: PerpOrderType; owner: PublicKey; ownerSlot: number; pegLimit: BN; quantity: BN; timeInForce: number; timestamp: BN }
key: BN
order Type: PerpOrderType
owner: PublicKey
owner Slot: number
peg Limit: BN
quantity: BN
time In Force: number
timestamp: BN
Returns LeafNode
Generated using TypeDoc
\ No newline at end of file
+LeafNode | @blockworks-foundation/mango-v4 Class LeafNode
Hierarchy
- LeafNode
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
ownerSlot: number
orderType: PerpOrderType
timeInForce: number
key: BN
owner: PublicKey
quantity: BN
timestamp: BN
pegLimit: BN
Returns LeafNode
Properties
key
order Type
owner
owner Slot
peg Limit
quantity
time In Force
timestamp
Methods
Static from
Parameters
obj: { key: BN; orderType: PerpOrderType; owner: PublicKey; ownerSlot: number; pegLimit: BN; quantity: BN; timeInForce: number; timestamp: BN }
key: BN
order Type: PerpOrderType
owner: PublicKey
owner Slot: number
peg Limit: BN
quantity: BN
time In Force: number
timestamp: BN
Returns LeafNode
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/MangoAccount.html b/ts/client/classes/MangoAccount.html
index b84741178..482687eb3 100644
--- a/ts/client/classes/MangoAccount.html
+++ b/ts/client/classes/MangoAccount.html
@@ -1,68 +1,68 @@
-MangoAccount | @blockworks-foundation/mango-v4 Class MangoAccount
Hierarchy
- MangoAccount
Index
Constructors
Properties
Methods
- get
Assets Value - get
Buyback Fees Accrued - get
Buyback Fees Accrued Ui - get
Collateral Value - get
Cumulative Interest - get
Equity - get
Health - get
Health Ratio - get
Health Ratio Ui - get
Liabs Value - get
Max Base For Perp Ask Ui - get
Max Base For Serum3 Ask Ui - get
Max Fees Buyback - get
Max Fees Buyback Ui - get
Max Quote For Perp Bid Ui - get
Max Quote For Serum3 Bid Ui - get
Max Source Ui For Token Swap - get
Max Withdraw With Borrow For Token - get
Max Withdraw With Borrow For Token Ui - get
Perp Position - get
Perp Position Ui - get
Perp Settle Health - get
Pnl - get
Serum3 Account - get
Serum3 Oo Account - get
Token - get
Token Balance - get
Token Balance Ui - get
Token Borrows - get
Token Borrows Ui - get
Token Deposits - get
Token Deposits Ui - is
Delegate - is
Operational - load
Perp Open Orders For Market - load
Serum3 Open Orders Accounts - load
Serum3 Open Orders For Market - perp
Active - perp
Order Exists For Market - perp
Orders Active - perp
Position Exists For Market - reload
- reload
Serum3 Open Orders - reload
With Slot - serum3
Active - serum3
Cancel All Orders For All Markets - serum3
Settle Funds For All Markets - sim
Health Ratio With Perp Ask Ui Changes - sim
Health Ratio With Perp Bid Ui Changes - sim
Health Ratio With Serum3 Ask Ui Changes - sim
Health Ratio With Serum3 Bid Ui Changes - sim
Health Ratio With Token Position Ui Changes - to
String - tokens
Active - from
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
owner: PublicKey
name: number[]
delegate: PublicKey
accountNum: number
beingLiquidated: boolean
inHealthRegion: boolean
netDeposits: BN
perpSpotTransfers: BN
healthRegionBeginInitHealth: BN
frozenUntil: BN
buybackFeesAccruedCurrent: BN
buybackFeesAccruedPrevious: BN
buybackFeesExpiryTimestamp: BN
headerVersion: number
tokens: TokenPositionDto[]
serum3: Serum3PositionDto[]
perps: PerpPositionDto[]
perpOpenOrders: PerpOoDto[]
serum3OosMapByMarketIndex: Map<number, OpenOrders>
Returns MangoAccount
Properties
account Num
being Liquidated
buyback Fees Accrued Current
buyback Fees Accrued Previous
buyback Fees Expiry Timestamp
delegate
frozen Until
group
header Version
health Region Begin Init Health
in Health Region
name
net Deposits
owner
perp Open Orders
perp Spot Transfers
perps
public Key
serum3
serum3 Oos Map By Market Index
tokens
Methods
get Assets Value
-
+
MangoAccount | @blockworks-foundation/mango-v4 Class MangoAccount
Hierarchy
- MangoAccount
Index
Constructors
Properties
Methods
- get
Assets Value - get
Buyback Fees Accrued - get
Buyback Fees Accrued Ui - get
Collateral Value - get
Cumulative Interest - get
Equity - get
Health - get
Health Ratio - get
Health Ratio Ui - get
Liabs Value - get
Max Base For Perp Ask Ui - get
Max Base For Serum3 Ask Ui - get
Max Fees Buyback - get
Max Fees Buyback Ui - get
Max Quote For Perp Bid Ui - get
Max Quote For Serum3 Bid Ui - get
Max Source Ui For Token Swap - get
Max Withdraw With Borrow For Token - get
Max Withdraw With Borrow For Token Ui - get
Perp Position - get
Perp Position Ui - get
Perp Settle Health - get
Pnl - get
Serum3 Account - get
Serum3 Oo Account - get
Token - get
Token Balance - get
Token Balance Ui - get
Token Borrows - get
Token Borrows Ui - get
Token Deposits - get
Token Deposits Ui - is
Delegate - is
Operational - load
Perp Open Orders For Market - load
Serum3 Open Orders Accounts - load
Serum3 Open Orders For Market - perp
Active - perp
Order Exists For Market - perp
Orders Active - perp
Position Exists For Market - reload
- reload
Serum3 Open Orders - reload
With Slot - serum3
Active - serum3
Cancel All Orders For All Markets - serum3
Settle Funds For All Markets - sim
Health Ratio With Perp Ask Ui Changes - sim
Health Ratio With Perp Bid Ui Changes - sim
Health Ratio With Serum3 Ask Ui Changes - sim
Health Ratio With Serum3 Bid Ui Changes - sim
Health Ratio With Token Position Ui Changes - to
String - tokens
Active - from
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
owner: PublicKey
name: number[]
delegate: PublicKey
accountNum: number
beingLiquidated: boolean
inHealthRegion: boolean
netDeposits: BN
perpSpotTransfers: BN
healthRegionBeginInitHealth: BN
frozenUntil: BN
buybackFeesAccruedCurrent: BN
buybackFeesAccruedPrevious: BN
buybackFeesExpiryTimestamp: BN
headerVersion: number
tokens: TokenPositionDto[]
serum3: Serum3PositionDto[]
perps: PerpPositionDto[]
perpOpenOrders: PerpOoDto[]
serum3OosMapByMarketIndex: Map<number, OpenOrders>
Returns MangoAccount
Properties
account Num
being Liquidated
buyback Fees Accrued Current
buyback Fees Accrued Previous
buyback Fees Expiry Timestamp
delegate
frozen Until
group
header Version
health Region Begin Init Health
in Health Region
name
net Deposits
owner
perp Open Orders
perp Spot Transfers
perps
public Key
serum3
serum3 Oos Map By Market Index
tokens
Methods
get Assets Value
-
Sum of all positive assets.
Parameters
group: Group
Optional healthType: HealthType
Returns I80F48
assets, in native quote
-
get Buyback Fees Accrued
Returns BN
get Buyback Fees Accrued Ui
Returns number
get Collateral Value
-
+
get Buyback Fees Accrued
Returns BN
get Buyback Fees Accrued Ui
Returns number
get Collateral Value
get Cumulative Interest
Parameters
bank: Bank
Returns number
token cumulative interest, in native token units. Sum of deposit and borrow interest.
+
get Cumulative Interest
Parameters
bank: Bank
Returns number
token cumulative interest, in native token units. Sum of deposit and borrow interest.
Caveat: This will only return cumulative interest since the tokenPosition was last opened.
If the tokenPosition was closed and reopened multiple times it is necessary to add this result to
cumulative interest at each of the prior tokenPosition closings (from mango API) to get the all time
cumulative interest.
-
get Equity
-
+
get Equity
get Health
-
+
get Health
-
Health, see health.rs or https://docs.mango.markets/mango-markets/health-overview
Parameters
group: Group
healthType: HealthType
Returns I80F48
raw health number, in native quote
-
get Health Ratio
-
+
get Health Ratio
-
Health ratio, which is computed so 100 * (assets-liabs)/liabs
Note: health ratio is technically ∞ if liabs are 0
Parameters
group: Group
healthType: HealthType
Returns I80F48
health ratio, in percentage form
-
get Health Ratio Ui
-
+
get Health Ratio Ui
-
Health ratio
Parameters
group: Group
healthType: HealthType
Returns number
health ratio, in percentage form, capped to 100
-
get Liabs Value
-
+
get Liabs Value
-
Sum of all negative assets.
Parameters
group: Group
Optional healthType: HealthType
Returns I80F48
liabs, in native quote
-
get Max Base For Perp Ask Ui
-
+
get Max Base For Perp Ask Ui
-
TODO: also think about limit orders
The max ui base you can place a market/ioc ask on the market,
price is the ui price at which you think the order would materialiase.
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns number
max ui base ask
-
get Max Base For Serum3 Ask Ui
-
+
get Max Base For Serum3 Ask Ui
-
TODO REWORK, know to break in binary search, also make work for limit orders
Parameters
group: Group
externalMarketPk: PublicKey
Returns number
maximum ui base which can be traded at oracle price for quote token given current health
-
get Max Fees Buyback
Parameters
group: Group
Returns BN
get Max Fees Buyback Ui
Parameters
group: Group
Returns number
get Max Quote For Perp Bid Ui
-
+
get Max Fees Buyback
Parameters
group: Group
Returns BN
get Max Fees Buyback Ui
Parameters
group: Group
Returns number
get Max Quote For Perp Bid Ui
-
TODO: also think about limit orders
The max ui quote you can place a market/ioc bid on the market,
price is the ui price at which you think the order would materialiase.
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns number
maximum ui quote which can be traded at oracle price for quote token given current health
-
get Max Quote For Serum3 Bid Ui
-
+
get Max Quote For Serum3 Bid Ui
-
TODO REWORK, know to break in binary search, also make work for limit orders
Parameters
group: Group
externalMarketPk: PublicKey
Returns number
maximum ui quote which can be traded at oracle price for base token given current health
-
get Max Source Ui For Token Swap
-
+
get Max Source Ui For Token Swap
-
The max amount of given source ui token you can swap to a target token.
Parameters
group: Group
sourceMintPk: PublicKey
targetMintPk: PublicKey
slippageAndFeesFactor: number = 1
Returns number
max amount of given source ui token you can swap to a target token, in ui token
-
get Max Withdraw With Borrow For Token
-
+
get Max Withdraw With Borrow For Token
-
The amount of given native token you can withdraw including borrows, considering all existing assets as collateral.
Parameters
group: Group
mintPk: PublicKey
Returns I80F48
amount of given native token you can borrow, considering all existing assets as collateral, in native token
TODO: take into account net_borrow_limit and min_vault_to_deposits_ratio
-
get Max Withdraw With Borrow For Token Ui
Parameters
group: Group
mintPk: PublicKey
Returns number
get Perp Position
Parameters
perpMarketIndex: PerpMarketIndex
Returns undefined | PerpPosition
get Perp Position Ui
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Optional useEventQueue: boolean
Returns number
get Perp Settle Health
get Pnl
get Max Withdraw With Borrow For Token Ui
Parameters
group: Group
mintPk: PublicKey
Returns number
get Perp Position
Parameters
perpMarketIndex: PerpMarketIndex
Returns undefined | PerpPosition
get Perp Position Ui
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Optional useEventQueue: boolean
Returns number
get Perp Settle Health
get Pnl
Parameters
group: Group
Returns I80F48
Overall PNL, in native quote
PNL is defined here as spot value + serum3 open orders value + perp value - net deposits value (evaluated at native quote price at the time of the deposit/withdraw)
spot value + serum3 open orders value + perp value is returned by getEquity (open orders values are added to spot token values implicitly)
-
get Serum3 Account
Parameters
marketIndex: MarketIndex
Returns undefined | Serum3Orders
get Serum3 Oo Account
Parameters
marketIndex: MarketIndex
Returns OpenOrders
get Token
Parameters
tokenIndex: TokenIndex
Returns undefined | TokenPosition
get Token Balance
get Token Balance Ui
Parameters
bank: Bank
Returns number
UI balance for a token, is signed
-
get Token Borrows
get Token Borrows Ui
Parameters
bank: Bank
Returns number
UI borrows for a token, 0 or less
-
get Token Deposits
get Token Deposits Ui
Parameters
bank: Bank
Returns number
UI deposits for a token, 0 or more
-
is Delegate
Parameters
client: MangoClient
Returns boolean
is Operational
Returns boolean
load Perp Open Orders For Market
Parameters
client: MangoClient
group: Group
perpMarketIndex: PerpMarketIndex
Optional forceReload: boolean
Returns Promise<PerpOrder[]>
load Serum3 Open Orders Accounts
Parameters
client: MangoClient
Returns Promise<OpenOrders[]>
load Serum3 Open Orders For Market
Parameters
client: MangoClient
group: Group
externalMarketPk: PublicKey
Returns Promise<Order[]>
perp Active
Returns PerpPosition[]
perp Order Exists For Market
Parameters
perpMarket: PerpMarket
Returns boolean
perp Orders Active
Returns PerpOo[]
perp Position Exists For Market
Parameters
perpMarket: PerpMarket
Returns boolean
reload
Parameters
client: MangoClient
Returns Promise<MangoAccount>
reload Serum3 Open Orders
Parameters
client: MangoClient
Returns Promise<MangoAccount>
reload With Slot
Parameters
client: MangoClient
Returns Promise<{ slot: number; value: MangoAccount }>
serum3 Active
Returns Serum3Orders[]
serum3 Cancel All Orders For All Markets
Parameters
client: MangoClient
group: Group
Returns Promise<string[]>
serum3 Settle Funds For All Markets
Parameters
client: MangoClient
group: Group
Returns Promise<string[]>
sim Health Ratio With Perp Ask Ui Changes
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
size: number
Returns number
sim Health Ratio With Perp Bid Ui Changes
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
size: number
Returns number
sim Health Ratio With Serum3 Ask Ui Changes
Parameters
group: Group
uiBaseAmount: number
externalMarketPk: PublicKey
healthType: HealthType = HealthType.init
Returns number
health ratio after an ask with uiBaseAmount is placed
-
sim Health Ratio With Serum3 Bid Ui Changes
Parameters
group: Group
uiQuoteAmount: number
externalMarketPk: PublicKey
healthType: HealthType = HealthType.init
Returns number
health ratio after a bid with uiQuoteAmount is placed
-
sim Health Ratio With Token Position Ui Changes
-
+
get Serum3 Account
Parameters
marketIndex: MarketIndex
Returns undefined | Serum3Orders
get Serum3 Oo Account
Parameters
marketIndex: MarketIndex
Returns OpenOrders
get Token
Parameters
tokenIndex: TokenIndex
Returns undefined | TokenPosition
get Token Balance
get Token Balance Ui
Parameters
bank: Bank
Returns number
UI balance for a token, is signed
+
get Token Borrows
get Token Borrows Ui
Parameters
bank: Bank
Returns number
UI borrows for a token, 0 or less
+
get Token Deposits
get Token Deposits Ui
Parameters
bank: Bank
Returns number
UI deposits for a token, 0 or more
+
is Delegate
Parameters
client: MangoClient
Returns boolean
is Operational
Returns boolean
load Perp Open Orders For Market
Parameters
client: MangoClient
group: Group
perpMarketIndex: PerpMarketIndex
Optional forceReload: boolean
Returns Promise<PerpOrder[]>
load Serum3 Open Orders Accounts
Parameters
client: MangoClient
Returns Promise<OpenOrders[]>
load Serum3 Open Orders For Market
Parameters
client: MangoClient
group: Group
externalMarketPk: PublicKey
Returns Promise<Order[]>
perp Active
Returns PerpPosition[]
perp Order Exists For Market
Parameters
perpMarket: PerpMarket
Returns boolean
perp Orders Active
Returns PerpOo[]
perp Position Exists For Market
Parameters
perpMarket: PerpMarket
Returns boolean
reload
Parameters
client: MangoClient
Returns Promise<MangoAccount>
reload Serum3 Open Orders
Parameters
client: MangoClient
Returns Promise<MangoAccount>
reload With Slot
Parameters
client: MangoClient
Returns Promise<{ slot: number; value: MangoAccount }>
serum3 Active
Returns Serum3Orders[]
serum3 Cancel All Orders For All Markets
Parameters
client: MangoClient
group: Group
Returns Promise<string[]>
serum3 Settle Funds For All Markets
Parameters
client: MangoClient
group: Group
Returns Promise<string[]>
sim Health Ratio With Perp Ask Ui Changes
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
size: number
Returns number
sim Health Ratio With Perp Bid Ui Changes
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
size: number
Returns number
sim Health Ratio With Serum3 Ask Ui Changes
Parameters
group: Group
uiBaseAmount: number
externalMarketPk: PublicKey
healthType: HealthType = HealthType.init
Returns number
health ratio after an ask with uiBaseAmount is placed
+
sim Health Ratio With Serum3 Bid Ui Changes
Parameters
group: Group
uiQuoteAmount: number
externalMarketPk: PublicKey
healthType: HealthType = HealthType.init
Returns number
health ratio after a bid with uiQuoteAmount is placed
+
sim Health Ratio With Token Position Ui Changes
-
Simulates new health ratio after applying tokenChanges to the token positions.
Note: token changes are expected in ui amounts
e.g. useful to simulate health after a potential swap.
Note: health ratio is technically ∞ if liabs are 0
Parameters
group: Group
uiTokenChanges: { mintPk: PublicKey; uiTokenAmount: number }[]
healthType: HealthType = HealthType.init
Returns number
health ratio, in percentage form
-
to String
Parameters
Optional group: Group
onlyTokens: boolean = false
Returns string
tokens Active
Returns TokenPosition[]
Static from
Parameters
publicKey: PublicKey
obj: { accountNum: number; beingLiquidated: number; buybackFeesAccruedCurrent: BN; buybackFeesAccruedPrevious: BN; buybackFeesExpiryTimestamp: BN; delegate: PublicKey; frozenUntil: BN; group: PublicKey; headerVersion: number; healthRegionBeginInitHealth: BN; inHealthRegion: number; name: number[]; netDeposits: BN; owner: PublicKey; perpOpenOrders: unknown; perpSpotTransfers: BN; perps: unknown; serum3: unknown; tokens: unknown }
account Num: number
being Liquidated: number
buyback Fees Accrued Current: BN
buyback Fees Accrued Previous: BN
buyback Fees Expiry Timestamp: BN
delegate: PublicKey
frozen Until: BN
group: PublicKey
header Version: number
health Region Begin Init Health: BN
in Health Region: number
name: number[]
net Deposits: BN
owner: PublicKey
perp Open Orders: unknown
perp Spot Transfers: BN
perps: unknown
serum3: unknown
tokens: unknown
Returns MangoAccount
Generated using TypeDoc
\ No newline at end of file
+
to String
Parameters
Optional group: Group
onlyTokens: boolean = false
Returns string
tokens Active
Returns TokenPosition[]
Static from
Parameters
publicKey: PublicKey
obj: { accountNum: number; beingLiquidated: number; buybackFeesAccruedCurrent: BN; buybackFeesAccruedPrevious: BN; buybackFeesExpiryTimestamp: BN; delegate: PublicKey; frozenUntil: BN; group: PublicKey; headerVersion: number; healthRegionBeginInitHealth: BN; inHealthRegion: number; name: number[]; netDeposits: BN; owner: PublicKey; perpOpenOrders: unknown; perpSpotTransfers: BN; perps: unknown; serum3: unknown; tokens: unknown }
account Num: number
being Liquidated: number
buyback Fees Accrued Current: BN
buyback Fees Accrued Previous: BN
buyback Fees Expiry Timestamp: BN
delegate: PublicKey
frozen Until: BN
group: PublicKey
header Version: number
health Region Begin Init Health: BN
in Health Region: number
name: number[]
net Deposits: BN
owner: PublicKey
perp Open Orders: unknown
perp Spot Transfers: BN
perps: unknown
serum3: unknown
tokens: unknown
Returns MangoAccount
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/MangoClient.html b/ts/client/classes/MangoClient.html
index bc520e312..55297de30 100644
--- a/ts/client/classes/MangoClient.html
+++ b/ts/client/classes/MangoClient.html
@@ -1,4 +1,4 @@
-MangoClient | @blockworks-foundation/mango-v4 Class MangoClient
Hierarchy
- MangoClient
Index
Constructors
Properties
Accessors
Methods
- account
Buyback Fees With Mngo - account
Buyback Fees With Mngo Ix - alt
Extend - alt
Set - build
Health Remaining Accounts - close
Mango Account - compute
Account Data - create
And Fetch Mango Account - create
Mango Account - edit
Mango Account - empty
And Close Mango Account - expand
Mango Account - get
All Mango Accounts - get
Banks For Group - get
Group - get
Group For Creator - get
Groups For Creator - get
Ids - get
Mango Account - get
Mango Account For Owner - get
Mango Account With Slot - get
Mango Accounts For Delegate - get
Mango Accounts For Owner - get
Mint Info For Token Index - get
Mint Infos For Group - get
Or Create Mango Account - get
Stub Oracle - group
Close - group
Create - group
Edit - health
Region Begin Ix - health
Region End Ix - ix
Gate Set - liq
Token With Token - margin
Trade - modify
Perp Order - modify
Serum3 Order - perp
Cancel All Orders - perp
Cancel All Orders Ix - perp
Cancel Order - perp
Cancel Order Ix - perp
Close Market - perp
Consume All Events - perp
Consume Events - perp
Consume Events Ix - perp
Create Market - perp
Deactivate Position - perp
Deactivate Position Ix - perp
Edit Market - perp
Force Close Position - perp
Get Markets - perp
Place Order - perp
Place Order Ix - perp
Place Order Pegged - perp
Place Order Pegged Ix - perp
Settle Fees - perp
Settle Fees Ix - perp
Settle Pnl - perp
Settle Pnl And Fees - perp
Settle Pnl Ix - perp
Update Funding Ix - send
And Confirm Transaction - send
And Confirm Transaction For Group - serum3
Cancel All Orders - serum3
Cancel All Orders Ix - serum3
Cancel Order - serum3
Cancel Order Ix - serum3
Close Open Orders - serum3
Close Open Orders Ix - serum3
Create Open Orders - serum3
Create Open Orders Ix - serum3
Edit Market - serum3
Get Markets - serum3
Liq Force Cancel Orders - serum3
Place Order - serum3
Place Order Ix - serum3
Register Market - serum3
Settle Funds - serum3
Settle Funds Ix - serum3
Settle Funds V2 Ix - serum3deregister
Market - stub
Oracle Close - stub
Oracle Create - stub
Oracle Set - toggle
Mango Account Freeze - token
Deposit - token
Deposit Native - token
Deregister - token
Edit - token
Force Close Borrows With Token - token
Register - token
Register Trustless - token
Update Index And Rate - token
Update Index And Rate Ix - token
Withdraw - token
Withdraw Native - token
Withdraw Native Ix - connect
- connect
For Group Name
Constructors
constructor
Parameters
program: Program<MangoV4>
programId: PublicKey
cluster: Cluster
opts: MangoClientOptions = {}
Returns MangoClient
Properties
cluster
Private ids Source
Private openbook Fees To Dao
opts
Private Optional post Send Tx Callback
Type declaration
Parameters
__namedParameters: Object
Returns void
Private prioritization Fee
program
program Id
Private tx Confirmation Commitment
Accessors
connection
Returns Connection
wallet Pk
Returns PublicKey
Methods
account Buyback Fees With Mngo
Parameters
group: Group
mangoAccount: MangoAccount
Optional maxBuyback: number
Returns Promise<string>
account Buyback Fees With Mngo Ix
Parameters
group: Group
mangoAccount: MangoAccount
Optional maxBuybackUsd: number
Returns Promise<TransactionInstruction>
alt Extend
Parameters
group: Group
addressLookupTable: PublicKey
index: number
pks: PublicKey[]
Returns Promise<string>
alt Set
Parameters
group: Group
addressLookupTable: PublicKey
index: number
Returns Promise<string>
build Health Remaining Accounts
-
+
MangoClient | @blockworks-foundation/mango-v4 Class MangoClient
Hierarchy
- MangoClient
Index
Constructors
Properties
Accessors
Methods
- account
Buyback Fees With Mngo - account
Buyback Fees With Mngo Ix - alt
Extend - alt
Set - build
Health Remaining Accounts - close
Mango Account - compute
Account Data - create
And Fetch Mango Account - create
Mango Account - edit
Mango Account - empty
And Close Mango Account - expand
Mango Account - get
All Mango Accounts - get
Banks For Group - get
Group - get
Group For Creator - get
Groups For Creator - get
Ids - get
Mango Account - get
Mango Account For Owner - get
Mango Account With Slot - get
Mango Accounts For Delegate - get
Mango Accounts For Owner - get
Mint Info For Token Index - get
Mint Infos For Group - get
Or Create Mango Account - get
Stub Oracle - group
Close - group
Create - group
Edit - health
Region Begin Ix - health
Region End Ix - ix
Gate Set - liq
Token With Token - margin
Trade - modify
Perp Order - modify
Serum3 Order - perp
Cancel All Orders - perp
Cancel All Orders Ix - perp
Cancel Order - perp
Cancel Order Ix - perp
Close Market - perp
Consume All Events - perp
Consume Events - perp
Consume Events Ix - perp
Create Market - perp
Deactivate Position - perp
Deactivate Position Ix - perp
Edit Market - perp
Force Close Position - perp
Get Markets - perp
Place Order - perp
Place Order Ix - perp
Place Order Pegged - perp
Place Order Pegged Ix - perp
Settle Fees - perp
Settle Fees Ix - perp
Settle Pnl - perp
Settle Pnl And Fees - perp
Settle Pnl Ix - perp
Update Funding Ix - send
And Confirm Transaction - send
And Confirm Transaction For Group - serum3
Cancel All Orders - serum3
Cancel All Orders Ix - serum3
Cancel Order - serum3
Cancel Order Ix - serum3
Close Open Orders - serum3
Close Open Orders Ix - serum3
Create Open Orders - serum3
Create Open Orders Ix - serum3
Edit Market - serum3
Get Markets - serum3
Liq Force Cancel Orders - serum3
Place Order - serum3
Place Order Ix - serum3
Register Market - serum3
Settle Funds - serum3
Settle Funds Ix - serum3
Settle Funds V2 Ix - serum3deregister
Market - stub
Oracle Close - stub
Oracle Create - stub
Oracle Set - toggle
Mango Account Freeze - token
Deposit - token
Deposit Native - token
Deregister - token
Edit - token
Force Close Borrows With Token - token
Register - token
Register Trustless - token
Update Index And Rate - token
Update Index And Rate Ix - token
Withdraw - token
Withdraw Native - token
Withdraw Native Ix - connect
- connect
For Group Name
Constructors
constructor
Parameters
program: Program<MangoV4>
programId: PublicKey
cluster: Cluster
opts: MangoClientOptions = {}
Returns MangoClient
Properties
cluster
Private ids Source
Private openbook Fees To Dao
opts
Private Optional post Send Tx Callback
Type declaration
Parameters
__namedParameters: Object
Returns void
Private prioritization Fee
program
program Id
Private tx Confirmation Commitment
Accessors
connection
Returns Connection
wallet Pk
Returns PublicKey
Methods
account Buyback Fees With Mngo
Parameters
group: Group
mangoAccount: MangoAccount
Optional maxBuyback: number
Returns Promise<string>
account Buyback Fees With Mngo Ix
Parameters
group: Group
mangoAccount: MangoAccount
Optional maxBuybackUsd: number
Returns Promise<TransactionInstruction>
alt Extend
Parameters
group: Group
addressLookupTable: PublicKey
index: number
pks: PublicKey[]
Returns Promise<string>
alt Set
Parameters
group: Group
addressLookupTable: PublicKey
index: number
Returns Promise<string>
build Health Remaining Accounts
-
Builds health remaining accounts.
For single mango account it builds a list of PublicKeys
which is compatbile with Fixed account retriever.
@@ -11,8 +11,8 @@ should always be compatible with Scanning account retriever.
markets in which new positions might be opened
openOrdersForMarket: [Serum3Market, PublicKey][] = []
markets in which new positions might be opened
-
Returns PublicKey[]
close Mango Account
-
+
Returns PublicKey[]
close Mango Account
-
Note: this ix doesn't settle liabs, reduce open positions, or withdraw tokens to wallet,
it simply closes the account. To close successfully ensure all positions are closed, or
use forceClose flag
-Parameters
group: Group
mangoAccount: MangoAccount
forceClose: boolean = false
Returns Promise<string>
compute Account Data
Parameters
group: Group
mangoAccount: MangoAccount
Returns Promise<string>
create And Fetch Mango Account
Parameters
group: Group
Optional accountNumber: number
Optional name: string
Optional tokenCount: number
Optional serum3Count: number
Optional perpCount: number
Optional perpOoCount: number
loadSerum3Oo: boolean = false
Returns Promise<undefined | MangoAccount>
create Mango Account
Parameters
group: Group
Optional accountNumber: number
Optional name: string
Optional tokenCount: number
Optional serum3Count: number
Optional perpCount: number
Optional perpOoCount: number
Returns Promise<string>
edit Mango Account
Parameters
group: Group
mangoAccount: MangoAccount
Optional name: string
Optional delegate: PublicKey
Returns Promise<string>
empty And Close Mango Account
Parameters
group: Group
mangoAccount: MangoAccount
Returns Promise<string>
expand Mango Account
Parameters
group: Group
account: MangoAccount
tokenCount: number
serum3Count: number
perpCount: number
perpOoCount: number
Returns Promise<string>
get All Mango Accounts
Parameters
group: Group
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Banks For Group
get Group
Parameters
groupPk: PublicKey
Returns Promise<Group>
get Group For Creator
Parameters
creatorPk: PublicKey
groupNum: number
Returns Promise<Group>
get Groups For Creator
Parameters
creatorPk: PublicKey
Returns Promise<Group[]>
get Ids
Parameters
groupPk: PublicKey
Returns Promise<undefined | Id>
get Mango Account
Parameters
mangoAccount: PublicKey | MangoAccount
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount>
get Mango Account For Owner
Parameters
group: Group
ownerPk: PublicKey
accountNumber: number
loadSerum3Oo: boolean = false
Returns Promise<undefined | MangoAccount>
get Mango Account With Slot
Parameters
mangoAccountPk: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<undefined | { slot: number; value: MangoAccount }>
get Mango Accounts For Delegate
Parameters
group: Group
delegate: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Mango Accounts For Owner
Parameters
group: Group
ownerPk: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Mint Info For Token Index
Parameters
group: Group
tokenIndex: TokenIndex
Returns Promise<MintInfo[]>
get Mint Infos For Group
get Or Create Mango Account
Parameters
group: Group
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount>
get Stub Oracle
Parameters
group: Group
Optional mintPk: PublicKey
Returns Promise<StubOracle[]>
group Close
Parameters
group: Group
Returns Promise<string>
group Create
Parameters
groupNum: number
testing: boolean
version: number
insuranceMintPk: PublicKey
Returns Promise<string>
group Edit
Parameters
group: Group
Optional admin: PublicKey
Optional fastListingAdmin: PublicKey
Optional securityAdmin: PublicKey
Optional testing: number
Optional version: number
Optional depositLimitQuote: BN
Optional feesPayWithMngo: boolean
Optional feesMngoBonusRate: number
Optional feesSwapMangoAccount: PublicKey
Optional feesMngoTokenIndex: TokenIndex
Optional feesExpiryInterval: BN
Returns Promise<string>
health Region Begin Ix
Parameters
group: Group
account: MangoAccount
banks: Bank[] = []
perpMarkets: PerpMarket[] = []
Returns Promise<TransactionInstruction>
health Region End Ix
Parameters
group: Group
account: MangoAccount
banks: Bank[] = []
perpMarkets: PerpMarket[] = []
Returns Promise<TransactionInstruction>
ix Gate Set
Parameters
group: Group
ixGateParams: IxGateParams
Returns Promise<string>
liq Token With Token
Parameters
group: Group
liqor: MangoAccount
liqee: MangoAccount
assetMintPk: PublicKey
liabMintPk: PublicKey
maxLiabTransfer: number
Returns Promise<string>
margin Trade
Parameters
__namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }
amount In: number
flash Loan Type: FlashLoanType
group: Group
input Mint Pk: PublicKey
mango Account: MangoAccount
output Mint Pk: PublicKey
user Defined Alts: AddressLookupTableAccount[]
user Defined Instructions: TransactionInstruction[]
Returns Promise<string>
modify Perp Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
modify Serum3 Order
Parameters
group: Group
orderId: BN
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<string>
perp Cancel All Orders
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
limit: number
Returns Promise<string>
perp Cancel All Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
limit: number
Returns Promise<TransactionInstruction>
perp Cancel Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
Returns Promise<string>
perp Cancel Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
Returns Promise<TransactionInstruction>
perp Close Market
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Consume All Events
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<void>
perp Consume Events
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accounts: PublicKey[]
limit: number
Returns Promise<string>
perp Consume Events Ix
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accounts: PublicKey[]
limit: number
Returns Promise<TransactionInstruction>
perp Create Market
Parameters
group: Group
oraclePk: PublicKey
perpMarketIndex: number
name: string
oracleConfig: OracleConfigParams
baseDecimals: number
quoteLotSize: number
baseLotSize: number
maintBaseAssetWeight: number
initBaseAssetWeight: number
maintBaseLiabWeight: number
initBaseLiabWeight: number
maintOverallAssetWeight: number
initOverallAssetWeight: number
baseLiquidationFee: number
makerFee: number
takerFee: number
feePenalty: number
minFunding: number
maxFunding: number
impactQuantity: number
groupInsuranceFund: boolean
settleFeeFlat: number
settleFeeAmountThreshold: number
settleFeeFractionLowHealth: number
settleTokenIndex: number
settlePnlLimitFactor: number
settlePnlLimitWindowSize: number
positivePnlLiquidationFee: number
Returns Promise<string>
perp Deactivate Position
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Deactivate Position Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<TransactionInstruction>
perp Edit Market
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
params: PerpEditParams
Returns Promise<string>
perp Force Close Position
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accountA: MangoAccount
accountB: MangoAccount
Returns Promise<string>
perp Get Markets
Parameters
group: Group
Returns Promise<PerpMarket[]>
perp Place Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
perp Place Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<TransactionInstruction>
perp Place Order Pegged
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
priceOffset: number
quantity: number
Optional pegLimit: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
perp Place Order Pegged Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
priceOffset: number
quantity: number
Optional pegLimit: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<TransactionInstruction>
perp Settle Fees
Parameters
group: Group
account: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<string>
perp Settle Fees Ix
Parameters
group: Group
account: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<TransactionInstruction>
perp Settle Pnl
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Settle Pnl And Fees
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
accountToSettleFeesFor: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<string>
perp Settle Pnl Ix
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<TransactionInstruction>
perp Update Funding Ix
Parameters
group: Group
perpMarket: PerpMarket
Returns Promise<TransactionInstruction>
send And Confirm Transaction
Parameters
ixs: TransactionInstruction[]
opts: any = {}
Returns Promise<string>
Private send And Confirm Transaction For Group
Parameters
group: Group
ixs: TransactionInstruction[]
opts: any = {}
Returns Promise<string>
serum3 Cancel All Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<string>
serum3 Cancel All Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<TransactionInstruction>
serum3 Cancel Order
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
orderId: BN
Returns Promise<string>
serum3 Cancel Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
orderId: BN
Returns Promise<TransactionInstruction>
serum3 Close Open Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Close Open Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Create Open Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Create Open Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Edit Market
Parameters
group: Group
serum3MarketIndex: MarketIndex
reduceOnly: null | boolean
forceClose: null | boolean
Returns Promise<string>
serum3 Get Markets
Parameters
group: Group
Optional baseTokenIndex: number
Optional quoteTokenIndex: number
Returns Promise<Serum3Market[]>
serum3 Liq Force Cancel Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<string>
serum3 Place Order
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<string>
serum3 Place Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<TransactionInstruction[]>
serum3 Register Market
serum3 Settle Funds
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Settle Funds Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Settle Funds V2 Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3deregister Market
Parameters
group: Group
externalMarketPk: PublicKey
Returns Promise<string>
stub Oracle Close
Parameters
group: Group
oracle: PublicKey
Returns Promise<string>
stub Oracle Create
Parameters
group: Group
mintPk: PublicKey
price: number
Returns Promise<string>
stub Oracle Set
Parameters
group: Group
oraclePk: PublicKey
price: number
Returns Promise<string>
toggle Mango Account Freeze
Parameters
group: Group
mangoAccount: MangoAccount
freeze: boolean
Returns Promise<string>
token Deposit
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
amount: number
reduceOnly: boolean = false
Returns Promise<string>
token Deposit Native
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
reduceOnly: boolean = false
Returns Promise<string>
token Deregister
Parameters
group: Group
mintPk: PublicKey
Returns Promise<string>
token Edit
Parameters
group: Group
mintPk: PublicKey
params: TokenEditParams
Returns Promise<string>
token Force Close Borrows With Token
Parameters
group: Group
liqor: MangoAccount
liqee: MangoAccount
assetTokenIndex: TokenIndex
liabTokenIndex: TokenIndex
Optional maxLiabTransfer: number
Returns Promise<string>
token Register
Parameters
group: Group
mintPk: PublicKey
oraclePk: PublicKey
oracleConfig: OracleConfigParams
tokenIndex: number
name: string
interestRateParams: InterestRateParams
loanFeeRate: number
loanOriginationFeeRate: number
maintAssetWeight: number
initAssetWeight: number
maintLiabWeight: number
initLiabWeight: number
liquidationFee: number
minVaultToDepositsRatio: number
netBorrowLimitWindowSizeTs: number
netBorrowLimitPerWindowQuote: number
Returns Promise<string>
token Register Trustless
Parameters
group: Group
mintPk: PublicKey
oraclePk: PublicKey
tokenIndex: number
name: string
Returns Promise<string>
token Update Index And Rate
Parameters
group: Group
mintPk: PublicKey
Returns Promise<string>
token Update Index And Rate Ix
Parameters
group: Group
mintPk: PublicKey
Returns Promise<TransactionInstruction>
token Withdraw
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
amount: number
allowBorrow: boolean
Returns Promise<string>
token Withdraw Native
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
allowBorrow: boolean
Returns Promise<string>
token Withdraw Native Ix
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
allowBorrow: boolean
Returns Promise<TransactionInstruction[]>
Static connect
Parameters
provider: default
cluster: Cluster
programId: PublicKey
Optional opts: MangoClientOptions
Returns MangoClient
Static connect For Group Name
Parameters
provider: default
groupName: string
Returns MangoClient
Generated using TypeDoc
\ No newline at end of file
+Parameters
group: Group
mangoAccount: MangoAccount
forceClose: boolean = false
Returns Promise<string>
compute Account Data
Parameters
group: Group
mangoAccount: MangoAccount
Returns Promise<string>
create And Fetch Mango Account
Parameters
group: Group
Optional accountNumber: number
Optional name: string
Optional tokenCount: number
Optional serum3Count: number
Optional perpCount: number
Optional perpOoCount: number
loadSerum3Oo: boolean = false
Returns Promise<undefined | MangoAccount>
create Mango Account
Parameters
group: Group
Optional accountNumber: number
Optional name: string
Optional tokenCount: number
Optional serum3Count: number
Optional perpCount: number
Optional perpOoCount: number
Returns Promise<string>
edit Mango Account
Parameters
group: Group
mangoAccount: MangoAccount
Optional name: string
Optional delegate: PublicKey
Returns Promise<string>
empty And Close Mango Account
Parameters
group: Group
mangoAccount: MangoAccount
Returns Promise<string>
expand Mango Account
Parameters
group: Group
account: MangoAccount
tokenCount: number
serum3Count: number
perpCount: number
perpOoCount: number
Returns Promise<string>
get All Mango Accounts
Parameters
group: Group
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Banks For Group
get Group
Parameters
groupPk: PublicKey
Returns Promise<Group>
get Group For Creator
Parameters
creatorPk: PublicKey
groupNum: number
Returns Promise<Group>
get Groups For Creator
Parameters
creatorPk: PublicKey
Returns Promise<Group[]>
get Ids
Parameters
groupPk: PublicKey
Returns Promise<undefined | Id>
get Mango Account
Parameters
mangoAccount: PublicKey | MangoAccount
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount>
get Mango Account For Owner
Parameters
group: Group
ownerPk: PublicKey
accountNumber: number
loadSerum3Oo: boolean = false
Returns Promise<undefined | MangoAccount>
get Mango Account With Slot
Parameters
mangoAccountPk: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<undefined | { slot: number; value: MangoAccount }>
get Mango Accounts For Delegate
Parameters
group: Group
delegate: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Mango Accounts For Owner
Parameters
group: Group
ownerPk: PublicKey
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount[]>
get Mint Info For Token Index
Parameters
group: Group
tokenIndex: TokenIndex
Returns Promise<MintInfo[]>
get Mint Infos For Group
get Or Create Mango Account
Parameters
group: Group
loadSerum3Oo: boolean = false
Returns Promise<MangoAccount>
get Stub Oracle
Parameters
group: Group
Optional mintPk: PublicKey
Returns Promise<StubOracle[]>
group Close
Parameters
group: Group
Returns Promise<string>
group Create
Parameters
groupNum: number
testing: boolean
version: number
insuranceMintPk: PublicKey
Returns Promise<string>
group Edit
Parameters
group: Group
Optional admin: PublicKey
Optional fastListingAdmin: PublicKey
Optional securityAdmin: PublicKey
Optional testing: number
Optional version: number
Optional depositLimitQuote: BN
Optional feesPayWithMngo: boolean
Optional feesMngoBonusRate: number
Optional feesSwapMangoAccount: PublicKey
Optional feesMngoTokenIndex: TokenIndex
Optional feesExpiryInterval: BN
Returns Promise<string>
health Region Begin Ix
Parameters
group: Group
account: MangoAccount
banks: Bank[] = []
perpMarkets: PerpMarket[] = []
Returns Promise<TransactionInstruction>
health Region End Ix
Parameters
group: Group
account: MangoAccount
banks: Bank[] = []
perpMarkets: PerpMarket[] = []
Returns Promise<TransactionInstruction>
ix Gate Set
Parameters
group: Group
ixGateParams: IxGateParams
Returns Promise<string>
liq Token With Token
Parameters
group: Group
liqor: MangoAccount
liqee: MangoAccount
assetMintPk: PublicKey
liabMintPk: PublicKey
maxLiabTransfer: number
Returns Promise<string>
margin Trade
Parameters
__namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }
amount In: number
flash Loan Type: FlashLoanType
group: Group
input Mint Pk: PublicKey
mango Account: MangoAccount
output Mint Pk: PublicKey
user Defined Alts: AddressLookupTableAccount[]
user Defined Instructions: TransactionInstruction[]
Returns Promise<string>
modify Perp Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
modify Serum3 Order
Parameters
group: Group
orderId: BN
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<string>
perp Cancel All Orders
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
limit: number
Returns Promise<string>
perp Cancel All Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
limit: number
Returns Promise<TransactionInstruction>
perp Cancel Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
Returns Promise<string>
perp Cancel Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
orderId: BN
Returns Promise<TransactionInstruction>
perp Close Market
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Consume All Events
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
Returns Promise<void>
perp Consume Events
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accounts: PublicKey[]
limit: number
Returns Promise<string>
perp Consume Events Ix
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accounts: PublicKey[]
limit: number
Returns Promise<TransactionInstruction>
perp Create Market
Parameters
group: Group
oraclePk: PublicKey
perpMarketIndex: number
name: string
oracleConfig: OracleConfigParams
baseDecimals: number
quoteLotSize: number
baseLotSize: number
maintBaseAssetWeight: number
initBaseAssetWeight: number
maintBaseLiabWeight: number
initBaseLiabWeight: number
maintOverallAssetWeight: number
initOverallAssetWeight: number
baseLiquidationFee: number
makerFee: number
takerFee: number
feePenalty: number
minFunding: number
maxFunding: number
impactQuantity: number
groupInsuranceFund: boolean
settleFeeFlat: number
settleFeeAmountThreshold: number
settleFeeFractionLowHealth: number
settleTokenIndex: number
settlePnlLimitFactor: number
settlePnlLimitWindowSize: number
positivePnlLiquidationFee: number
Returns Promise<string>
perp Deactivate Position
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Deactivate Position Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<TransactionInstruction>
perp Edit Market
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
params: PerpEditParams
Returns Promise<string>
perp Force Close Position
Parameters
group: Group
perpMarketIndex: PerpMarketIndex
accountA: MangoAccount
accountB: MangoAccount
Returns Promise<string>
perp Get Markets
Parameters
group: Group
Returns Promise<PerpMarket[]>
perp Place Order
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
perp Place Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
price: number
quantity: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<TransactionInstruction>
perp Place Order Pegged
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
priceOffset: number
quantity: number
Optional pegLimit: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<string>
perp Place Order Pegged Ix
Parameters
group: Group
mangoAccount: MangoAccount
perpMarketIndex: PerpMarketIndex
side: PerpOrderSide
priceOffset: number
quantity: number
Optional pegLimit: number
Optional maxQuoteQuantity: number
Optional clientOrderId: number
Optional orderType: PerpOrderType
Optional reduceOnly: boolean
Optional expiryTimestamp: number
Optional limit: number
Returns Promise<TransactionInstruction>
perp Settle Fees
Parameters
group: Group
account: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<string>
perp Settle Fees Ix
Parameters
group: Group
account: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<TransactionInstruction>
perp Settle Pnl
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<string>
perp Settle Pnl And Fees
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
accountToSettleFeesFor: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Optional maxSettleAmount: number
Returns Promise<string>
perp Settle Pnl Ix
Parameters
group: Group
profitableAccount: MangoAccount
unprofitableAccount: MangoAccount
settler: MangoAccount
perpMarketIndex: PerpMarketIndex
Returns Promise<TransactionInstruction>
perp Update Funding Ix
Parameters
group: Group
perpMarket: PerpMarket
Returns Promise<TransactionInstruction>
send And Confirm Transaction
Parameters
ixs: TransactionInstruction[]
opts: any = {}
Returns Promise<string>
Private send And Confirm Transaction For Group
Parameters
group: Group
ixs: TransactionInstruction[]
opts: any = {}
Returns Promise<string>
serum3 Cancel All Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<string>
serum3 Cancel All Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<TransactionInstruction>
serum3 Cancel Order
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
orderId: BN
Returns Promise<string>
serum3 Cancel Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
orderId: BN
Returns Promise<TransactionInstruction>
serum3 Close Open Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Close Open Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Create Open Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Create Open Orders Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Edit Market
Parameters
group: Group
serum3MarketIndex: MarketIndex
reduceOnly: null | boolean
forceClose: null | boolean
Returns Promise<string>
serum3 Get Markets
Parameters
group: Group
Optional baseTokenIndex: number
Optional quoteTokenIndex: number
Returns Promise<Serum3Market[]>
serum3 Liq Force Cancel Orders
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Optional limit: number
Returns Promise<string>
serum3 Place Order
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<string>
serum3 Place Order Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
side: Serum3Side
price: number
size: number
selfTradeBehavior: Serum3SelfTradeBehavior
orderType: Serum3OrderType
clientOrderId: number
limit: number
Returns Promise<TransactionInstruction[]>
serum3 Register Market
serum3 Settle Funds
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<string>
serum3 Settle Funds Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3 Settle Funds V2 Ix
Parameters
group: Group
mangoAccount: MangoAccount
externalMarketPk: PublicKey
Returns Promise<TransactionInstruction>
serum3deregister Market
Parameters
group: Group
externalMarketPk: PublicKey
Returns Promise<string>
stub Oracle Close
Parameters
group: Group
oracle: PublicKey
Returns Promise<string>
stub Oracle Create
Parameters
group: Group
mintPk: PublicKey
price: number
Returns Promise<string>
stub Oracle Set
Parameters
group: Group
oraclePk: PublicKey
price: number
Returns Promise<string>
toggle Mango Account Freeze
Parameters
group: Group
mangoAccount: MangoAccount
freeze: boolean
Returns Promise<string>
token Deposit
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
amount: number
reduceOnly: boolean = false
Returns Promise<string>
token Deposit Native
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
reduceOnly: boolean = false
Returns Promise<string>
token Deregister
Parameters
group: Group
mintPk: PublicKey
Returns Promise<string>
token Edit
Parameters
group: Group
mintPk: PublicKey
params: TokenEditParams
Returns Promise<string>
token Force Close Borrows With Token
Parameters
group: Group
liqor: MangoAccount
liqee: MangoAccount
assetTokenIndex: TokenIndex
liabTokenIndex: TokenIndex
Optional maxLiabTransfer: number
Returns Promise<string>
token Register
Parameters
group: Group
mintPk: PublicKey
oraclePk: PublicKey
oracleConfig: OracleConfigParams
tokenIndex: number
name: string
interestRateParams: InterestRateParams
loanFeeRate: number
loanOriginationFeeRate: number
maintAssetWeight: number
initAssetWeight: number
maintLiabWeight: number
initLiabWeight: number
liquidationFee: number
minVaultToDepositsRatio: number
netBorrowLimitWindowSizeTs: number
netBorrowLimitPerWindowQuote: number
Returns Promise<string>
token Register Trustless
Parameters
group: Group
mintPk: PublicKey
oraclePk: PublicKey
tokenIndex: number
name: string
Returns Promise<string>
token Update Index And Rate
Parameters
group: Group
mintPk: PublicKey
Returns Promise<string>
token Update Index And Rate Ix
Parameters
group: Group
mintPk: PublicKey
Returns Promise<TransactionInstruction>
token Withdraw
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
amount: number
allowBorrow: boolean
Returns Promise<string>
token Withdraw Native
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
allowBorrow: boolean
Returns Promise<string>
token Withdraw Native Ix
Parameters
group: Group
mangoAccount: MangoAccount
mintPk: PublicKey
nativeAmount: BN
allowBorrow: boolean
Returns Promise<TransactionInstruction[]>
Static connect
Parameters
provider: default
cluster: Cluster
programId: PublicKey
Optional opts: MangoClientOptions
Returns MangoClient
Static connect For Group Name
Parameters
provider: default
groupName: string
Returns MangoClient
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/MintInfo.html b/ts/client/classes/MintInfo.html
index 2f5e453b5..b463c91bb 100644
--- a/ts/client/classes/MintInfo.html
+++ b/ts/client/classes/MintInfo.html
@@ -1 +1 @@
-MintInfo | @blockworks-foundation/mango-v4 Class MintInfo
Hierarchy
- MintInfo
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
tokenIndex: TokenIndex
mint: PublicKey
banks: PublicKey[]
vaults: PublicKey[]
oracle: PublicKey
registrationTime: BN
groupInsuranceFund: boolean
Returns MintInfo
Properties
banks
group
group Insurance Fund
mint
oracle
public Key
registration Time
token Index
vaults
Methods
first Bank
Returns PublicKey
first Vault
Returns PublicKey
to String
Returns string
Static from
Parameters
publicKey: PublicKey
obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }
banks: PublicKey[]
group: PublicKey
group Insurance Fund: number
mint: PublicKey
oracle: PublicKey
registration Time: BN
token Index: number
vaults: PublicKey[]
Returns MintInfo
Generated using TypeDoc
\ No newline at end of file
+MintInfo | @blockworks-foundation/mango-v4 Class MintInfo
Hierarchy
- MintInfo
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
tokenIndex: TokenIndex
mint: PublicKey
banks: PublicKey[]
vaults: PublicKey[]
oracle: PublicKey
registrationTime: BN
groupInsuranceFund: boolean
Returns MintInfo
Properties
banks
group
group Insurance Fund
mint
oracle
public Key
registration Time
token Index
vaults
Methods
first Bank
Returns PublicKey
first Vault
Returns PublicKey
to String
Returns string
Static from
Parameters
publicKey: PublicKey
obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }
banks: PublicKey[]
group: PublicKey
group Insurance Fund: number
mint: PublicKey
oracle: PublicKey
registration Time: BN
token Index: number
vaults: PublicKey[]
Returns MintInfo
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/OracleConfigParams.html b/ts/client/classes/OracleConfigParams.html
index 9b6e09504..009ae3fcb 100644
--- a/ts/client/classes/OracleConfigParams.html
+++ b/ts/client/classes/OracleConfigParams.html
@@ -1 +1 @@
-OracleConfigParams | @blockworks-foundation/mango-v4 Class OracleConfigParams
Hierarchy
- OracleConfigParams
Index
Constructors
Properties
Constructors
constructor
Returns OracleConfigParams
Properties
conf Filter
max Staleness Slots
Generated using TypeDoc
\ No newline at end of file
+OracleConfigParams | @blockworks-foundation/mango-v4 Class OracleConfigParams
Hierarchy
- OracleConfigParams
Index
Constructors
Properties
Constructors
constructor
Returns OracleConfigParams
Properties
conf Filter
max Staleness Slots
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpEventQueue.html b/ts/client/classes/PerpEventQueue.html
index 20faf68c6..b62e8d847 100644
--- a/ts/client/classes/PerpEventQueue.html
+++ b/ts/client/classes/PerpEventQueue.html
@@ -1 +1 @@
-PerpEventQueue | @blockworks-foundation/mango-v4 Class PerpEventQueue
Hierarchy
- PerpEventQueue
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
client: MangoClient
header: { count: number; head: number; seqNum: BN }
count: number
head: number
seq Num: BN
buf: any
Returns PerpEventQueue
Properties
count
head
raw Events
seq Num
Static FILL_ EVENT_ TYPE
Static LIQUIDATE_ EVENT_ TYPE
Static OUT_ EVENT_ TYPE
Methods
events Since
Parameters
Optional lastSeqNum: BN
Returns (FillEvent | OutEvent | LiquidateEvent)[]
get Unconsumed Events
Returns (FillEvent | OutEvent | LiquidateEvent)[]
Generated using TypeDoc
\ No newline at end of file
+PerpEventQueue | @blockworks-foundation/mango-v4 Class PerpEventQueue
Hierarchy
- PerpEventQueue
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
client: MangoClient
header: { count: number; head: number; seqNum: BN }
count: number
head: number
seq Num: BN
buf: any
Returns PerpEventQueue
Properties
count
head
raw Events
seq Num
Static FILL_ EVENT_ TYPE
Static LIQUIDATE_ EVENT_ TYPE
Static OUT_ EVENT_ TYPE
Methods
events Since
Parameters
Optional lastSeqNum: BN
Returns (FillEvent | OutEvent | LiquidateEvent)[]
get Unconsumed Events
Returns (FillEvent | OutEvent | LiquidateEvent)[]
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpMarket.html b/ts/client/classes/PerpMarket.html
index 9d67463a8..c0dd1540d 100644
--- a/ts/client/classes/PerpMarket.html
+++ b/ts/client/classes/PerpMarket.html
@@ -1,12 +1,12 @@
-PerpMarket | @blockworks-foundation/mango-v4 Class PerpMarket
Hierarchy
- PerpMarket
Index
Constructors
Properties
- _asks
- _bids
- _oracle
Last Updated Slot - _oracle
Provider - _price
- _ui
Price - asks
- base
Decimals - base
Liquidation Fee - base
Lot Size - base
Lots To Ui Converter - bids
- event
Queue - fee
Penalty - fees
Accrued - fees
Settled - force
Close - funding
Last Updated - group
- group
Insurance Fund - impact
Quantity - init
Base Asset Weight - init
Base Liab Weight - init
Overall Asset Weight - long
Funding - maint
Base Asset Weight - maint
Base Liab Weight - maint
Overall Asset Weight - maker
Fee - max
Funding - min
Funding - name
- open
Interest - oracle
- oracle
Config - perp
Market Index - positive
Pnl Liquidation Fee - price
Lots To Ui Converter - public
Key - quote
Lot Size - quote
Lots To Ui Converter - reduce
Only - registration
Time - seq
Num - settle
Fee Amount Threshold - settle
Fee Flat - settle
Fee Fraction Low Health - settle
Pnl Limit Factor - settle
Pnl Limit Window Size Ts - settle
Token Index - short
Funding - stable
Price Model - taker
Fee
Accessors
Methods
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
settleTokenIndex: TokenIndex
perpMarketIndex: PerpMarketIndex
groupInsuranceFund: boolean
baseDecimals: number
name: number[]
bids: PublicKey
asks: PublicKey
eventQueue: PublicKey
oracle: PublicKey
oracleConfig: OracleConfigDto
stablePriceModel: StablePriceModel
quoteLotSize: BN
baseLotSize: BN
maintBaseAssetWeight: I80F48Dto
initBaseAssetWeight: I80F48Dto
maintBaseLiabWeight: I80F48Dto
initBaseLiabWeight: I80F48Dto
openInterest: BN
seqNum: BN
registrationTime: BN
minFunding: I80F48Dto
maxFunding: I80F48Dto
impactQuantity: BN
longFunding: I80F48Dto
shortFunding: I80F48Dto
fundingLastUpdated: BN
baseLiquidationFee: I80F48Dto
makerFee: I80F48Dto
takerFee: I80F48Dto
feesAccrued: I80F48Dto
feesSettled: I80F48Dto
feePenalty: number
settleFeeFlat: number
settleFeeAmountThreshold: number
settleFeeFractionLowHealth: number
settlePnlLimitFactor: number
settlePnlLimitWindowSizeTs: BN
reduceOnly: boolean
forceClose: boolean
maintOverallAssetWeight: I80F48Dto
initOverallAssetWeight: I80F48Dto
positivePnlLiquidationFee: I80F48Dto
Returns PerpMarket
Properties
_asks
_bids
_oracle Last Updated Slot
_oracle Provider
_price
_ui Price
asks
base Decimals
base Liquidation Fee
base Lot Size
Private base Lots To Ui Converter
bids
event Queue
fee Penalty
fees Accrued
fees Settled
force Close
funding Last Updated
group
group Insurance Fund
impact Quantity
init Base Asset Weight
init Base Liab Weight
init Overall Asset Weight
long Funding
maint Base Asset Weight
maint Base Liab Weight
maint Overall Asset Weight
maker Fee
max Funding
min Funding
name
open Interest
oracle
oracle Config
perp Market Index
positive Pnl Liquidation Fee
Private price Lots To Ui Converter
public Key
quote Lot Size
Private quote Lots To Ui Converter
reduce Only
registration Time
seq Num
settle Fee Amount Threshold
settle Fee Flat
settle Fee Fraction Low Health
settle Pnl Limit Factor
settle Pnl Limit Window Size Ts
settle Token Index
short Funding
stable Price Model
taker Fee
Accessors
min Order Size
Returns number
oracle Last Updated Slot
Returns number
oracle Provider
Returns OracleProvider
price
Returns I80F48
tick Size
Returns number
ui Price
Returns number
Methods
base Lots To Ui
Parameters
quantity: BN
Returns number
get Instantaneous Funding Rate
get Instantaneous Funding Rate Ui
-
+
PerpMarket | @blockworks-foundation/mango-v4 Class PerpMarket
Hierarchy
- PerpMarket
Index
Constructors
Properties
- _asks
- _bids
- _oracle
Last Updated Slot - _oracle
Provider - _price
- _ui
Price - asks
- base
Decimals - base
Liquidation Fee - base
Lot Size - base
Lots To Ui Converter - bids
- event
Queue - fee
Penalty - fees
Accrued - fees
Settled - force
Close - funding
Last Updated - group
- group
Insurance Fund - impact
Quantity - init
Base Asset Weight - init
Base Liab Weight - init
Overall Asset Weight - long
Funding - maint
Base Asset Weight - maint
Base Liab Weight - maint
Overall Asset Weight - maker
Fee - max
Funding - min
Funding - name
- open
Interest - oracle
- oracle
Config - perp
Market Index - positive
Pnl Liquidation Fee - price
Lots To Ui Converter - public
Key - quote
Lot Size - quote
Lots To Ui Converter - reduce
Only - registration
Time - seq
Num - settle
Fee Amount Threshold - settle
Fee Flat - settle
Fee Fraction Low Health - settle
Pnl Limit Factor - settle
Pnl Limit Window Size Ts - settle
Token Index - short
Funding - stable
Price Model - taker
Fee
Accessors
Methods
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
settleTokenIndex: TokenIndex
perpMarketIndex: PerpMarketIndex
groupInsuranceFund: boolean
baseDecimals: number
name: number[]
bids: PublicKey
asks: PublicKey
eventQueue: PublicKey
oracle: PublicKey
oracleConfig: OracleConfigDto
stablePriceModel: StablePriceModel
quoteLotSize: BN
baseLotSize: BN
maintBaseAssetWeight: I80F48Dto
initBaseAssetWeight: I80F48Dto
maintBaseLiabWeight: I80F48Dto
initBaseLiabWeight: I80F48Dto
openInterest: BN
seqNum: BN
registrationTime: BN
minFunding: I80F48Dto
maxFunding: I80F48Dto
impactQuantity: BN
longFunding: I80F48Dto
shortFunding: I80F48Dto
fundingLastUpdated: BN
baseLiquidationFee: I80F48Dto
makerFee: I80F48Dto
takerFee: I80F48Dto
feesAccrued: I80F48Dto
feesSettled: I80F48Dto
feePenalty: number
settleFeeFlat: number
settleFeeAmountThreshold: number
settleFeeFractionLowHealth: number
settlePnlLimitFactor: number
settlePnlLimitWindowSizeTs: BN
reduceOnly: boolean
forceClose: boolean
maintOverallAssetWeight: I80F48Dto
initOverallAssetWeight: I80F48Dto
positivePnlLiquidationFee: I80F48Dto
Returns PerpMarket
Properties
_asks
_bids
_oracle Last Updated Slot
_oracle Provider
_price
_ui Price
asks
base Decimals
base Liquidation Fee
base Lot Size
Private base Lots To Ui Converter
bids
event Queue
fee Penalty
fees Accrued
fees Settled
force Close
funding Last Updated
group
group Insurance Fund
impact Quantity
init Base Asset Weight
init Base Liab Weight
init Overall Asset Weight
long Funding
maint Base Asset Weight
maint Base Liab Weight
maint Overall Asset Weight
maker Fee
max Funding
min Funding
name
open Interest
oracle
oracle Config
perp Market Index
positive Pnl Liquidation Fee
Private price Lots To Ui Converter
public Key
quote Lot Size
Private quote Lots To Ui Converter
reduce Only
registration Time
seq Num
settle Fee Amount Threshold
settle Fee Flat
settle Fee Fraction Low Health
settle Pnl Limit Factor
settle Pnl Limit Window Size Ts
settle Token Index
short Funding
stable Price Model
taker Fee
Accessors
min Order Size
Returns number
oracle Last Updated Slot
Returns number
oracle Provider
Returns OracleProvider
price
Returns I80F48
tick Size
Returns number
ui Price
Returns number
Methods
base Lots To Ui
Parameters
quantity: BN
Returns number
get Instantaneous Funding Rate
get Instantaneous Funding Rate Ui
-
Returns instantaneous funding rate for the day. How is it actually applied - funding is
continously applied on every interaction to a perp position. The rate is further multiplied
by the time elapsed since it was last applied (capped to max. 1hr).
Parameters
Returns number
returns instantaneous funding rate in % form
-
get Settle Pnl Candidates
-
+
get Settle Pnl Candidates
-
Returns a list of (upto count) accounts, and the pnl that is settle'able on this perp market,
the list is sorted ascending for 'negative' direction and descending for 'positive' direction.
NOTE: keep in sync with perp_pnl.rs:fetch_top
TODO: replace with a more performant offchain service call
-Parameters
client: MangoClient
group: Group
direction: "negative" | "positive"
count: number = 2
Returns Promise<{ account: MangoAccount; settleablePnl: I80F48 }[]>
inside Price Limit
Parameters
side: PerpOrderSide
orderPrice: number
Returns boolean
load Asks
Parameters
client: MangoClient
forceReload: boolean = false
Returns Promise<BookSide>
load Bids
Parameters
client: MangoClient
forceReload: boolean = false
Returns Promise<BookSide>
load Event Queue
Parameters
client: MangoClient
Returns Promise<PerpEventQueue>
load Fills
Parameters
client: MangoClient
lastSeqNum: BN = ...
Returns Promise<FillEvent[]>
log Ob
Parameters
client: MangoClient
Returns Promise<string>
parse Fill Event
Parameters
event: any
Returns ParsedFillEvent
price Lots To Ui
Parameters
price: BN
Returns number
price Native To Ui
Parameters
price: number
Returns number
quote Lots To Ui
Parameters
quantity: BN
Returns number
to String
Returns string
ui Base To Lots
Parameters
quantity: number
Returns BN
ui Price To Lots
Parameters
price: number
Returns BN
ui Quote To Lots
Parameters
uiQuote: number
Returns BN
Static from
Parameters
publicKey: PublicKey
obj: { asks: PublicKey; baseDecimals: number; baseLiquidationFee: I80F48Dto; baseLotSize: BN; bids: PublicKey; eventQueue: PublicKey; feePenalty: number; feesAccrued: I80F48Dto; feesSettled: I80F48Dto; forceClose: number; fundingLastUpdated: BN; group: PublicKey; groupInsuranceFund: number; impactQuantity: BN; initBaseAssetWeight: I80F48Dto; initBaseLiabWeight: I80F48Dto; initOverallAssetWeight: I80F48Dto; longFunding: I80F48Dto; maintBaseAssetWeight: I80F48Dto; maintBaseLiabWeight: I80F48Dto; maintOverallAssetWeight: I80F48Dto; makerFee: I80F48Dto; maxFunding: I80F48Dto; minFunding: I80F48Dto; name: number[]; openInterest: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; perpMarketIndex: number; positivePnlLiquidationFee: I80F48Dto; quoteLotSize: BN; reduceOnly: number; registrationTime: BN; seqNum: BN; settleFeeAmountThreshold: number; settleFeeFlat: number; settleFeeFractionLowHealth: number; settlePnlLimitFactor: number; settlePnlLimitWindowSizeTs: BN; settleTokenIndex: number; shortFunding: I80F48Dto; stablePriceModel: StablePriceModel; takerFee: I80F48Dto }
asks: PublicKey
base Decimals: number
base Liquidation Fee: I80F48Dto
base Lot Size: BN
bids: PublicKey
event Queue: PublicKey
fee Penalty: number
fees Accrued: I80F48Dto
fees Settled: I80F48Dto
force Close: number
funding Last Updated: BN
group: PublicKey
group Insurance Fund: number
impact Quantity: BN
init Base Asset Weight: I80F48Dto
init Base Liab Weight: I80F48Dto
init Overall Asset Weight: I80F48Dto
long Funding: I80F48Dto
maint Base Asset Weight: I80F48Dto
maint Base Liab Weight: I80F48Dto
maint Overall Asset Weight: I80F48Dto
maker Fee: I80F48Dto
max Funding: I80F48Dto
min Funding: I80F48Dto
name: number[]
open Interest: BN
oracle: PublicKey
oracle Config: OracleConfigDto
perp Market Index: number
positive Pnl Liquidation Fee: I80F48Dto
quote Lot Size: BN
reduce Only: number
registration Time: BN
seq Num: BN
settle Fee Amount Threshold: number
settle Fee Flat: number
settle Fee Fraction Low Health: number
settle Pnl Limit Factor: number
settle Pnl Limit Window Size Ts: BN
settle Token Index: number
short Funding: I80F48Dto
stable Price Model: StablePriceModel
taker Fee: I80F48Dto
Returns PerpMarket
Generated using TypeDoc
\ No newline at end of file
+Parameters
client: MangoClient
group: Group
direction: "negative" | "positive"
count: number = 2
Returns Promise<{ account: MangoAccount; settleablePnl: I80F48 }[]>
inside Price Limit
Parameters
side: PerpOrderSide
orderPrice: number
Returns boolean
load Asks
Parameters
client: MangoClient
forceReload: boolean = false
Returns Promise<BookSide>
load Bids
Parameters
client: MangoClient
forceReload: boolean = false
Returns Promise<BookSide>
load Event Queue
Parameters
client: MangoClient
Returns Promise<PerpEventQueue>
load Fills
Parameters
client: MangoClient
lastSeqNum: BN = ...
Returns Promise<FillEvent[]>
log Ob
Parameters
client: MangoClient
Returns Promise<string>
parse Fill Event
Parameters
event: any
Returns ParsedFillEvent
price Lots To Ui
Parameters
price: BN
Returns number
price Native To Ui
Parameters
price: number
Returns number
quote Lots To Ui
Parameters
quantity: BN
Returns number
to String
Returns string
ui Base To Lots
Parameters
quantity: number
Returns BN
ui Price To Lots
Parameters
price: number
Returns BN
ui Quote To Lots
Parameters
uiQuote: number
Returns BN
Static from
Parameters
publicKey: PublicKey
obj: { asks: PublicKey; baseDecimals: number; baseLiquidationFee: I80F48Dto; baseLotSize: BN; bids: PublicKey; eventQueue: PublicKey; feePenalty: number; feesAccrued: I80F48Dto; feesSettled: I80F48Dto; forceClose: number; fundingLastUpdated: BN; group: PublicKey; groupInsuranceFund: number; impactQuantity: BN; initBaseAssetWeight: I80F48Dto; initBaseLiabWeight: I80F48Dto; initOverallAssetWeight: I80F48Dto; longFunding: I80F48Dto; maintBaseAssetWeight: I80F48Dto; maintBaseLiabWeight: I80F48Dto; maintOverallAssetWeight: I80F48Dto; makerFee: I80F48Dto; maxFunding: I80F48Dto; minFunding: I80F48Dto; name: number[]; openInterest: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; perpMarketIndex: number; positivePnlLiquidationFee: I80F48Dto; quoteLotSize: BN; reduceOnly: number; registrationTime: BN; seqNum: BN; settleFeeAmountThreshold: number; settleFeeFlat: number; settleFeeFractionLowHealth: number; settlePnlLimitFactor: number; settlePnlLimitWindowSizeTs: BN; settleTokenIndex: number; shortFunding: I80F48Dto; stablePriceModel: StablePriceModel; takerFee: I80F48Dto }
asks: PublicKey
base Decimals: number
base Liquidation Fee: I80F48Dto
base Lot Size: BN
bids: PublicKey
event Queue: PublicKey
fee Penalty: number
fees Accrued: I80F48Dto
fees Settled: I80F48Dto
force Close: number
funding Last Updated: BN
group: PublicKey
group Insurance Fund: number
impact Quantity: BN
init Base Asset Weight: I80F48Dto
init Base Liab Weight: I80F48Dto
init Overall Asset Weight: I80F48Dto
long Funding: I80F48Dto
maint Base Asset Weight: I80F48Dto
maint Base Liab Weight: I80F48Dto
maint Overall Asset Weight: I80F48Dto
maker Fee: I80F48Dto
max Funding: I80F48Dto
min Funding: I80F48Dto
name: number[]
open Interest: BN
oracle: PublicKey
oracle Config: OracleConfigDto
perp Market Index: number
positive Pnl Liquidation Fee: I80F48Dto
quote Lot Size: BN
reduce Only: number
registration Time: BN
seq Num: BN
settle Fee Amount Threshold: number
settle Fee Flat: number
settle Fee Fraction Low Health: number
settle Pnl Limit Factor: number
settle Pnl Limit Window Size Ts: BN
settle Token Index: number
short Funding: I80F48Dto
stable Price Model: StablePriceModel
taker Fee: I80F48Dto
Returns PerpMarket
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpOo.html b/ts/client/classes/PerpOo.html
index 9415aa1b4..c9a639112 100644
--- a/ts/client/classes/PerpOo.html
+++ b/ts/client/classes/PerpOo.html
@@ -1 +1 @@
-PerpOo | @blockworks-foundation/mango-v4 Class PerpOo
Hierarchy
- PerpOo
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
sideAndTree: any
orderMarket: number
clientId: BN
id: BN
Returns PerpOo
Properties
client Id
id
order Market
side And Tree
Static Order Market Unset
Methods
is Active
Returns boolean
Static from
Generated using TypeDoc
\ No newline at end of file
+PerpOo | @blockworks-foundation/mango-v4 Class PerpOo
Hierarchy
- PerpOo
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
sideAndTree: any
orderMarket: number
clientId: BN
id: BN
Returns PerpOo
Properties
client Id
id
order Market
side And Tree
Static Order Market Unset
Methods
is Active
Returns boolean
Static from
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpOoDto.html b/ts/client/classes/PerpOoDto.html
index ad7df5f6e..93918f370 100644
--- a/ts/client/classes/PerpOoDto.html
+++ b/ts/client/classes/PerpOoDto.html
@@ -1 +1 @@
-PerpOoDto | @blockworks-foundation/mango-v4 Class PerpOoDto
Hierarchy
- PerpOoDto
Index
Constructors
Properties
Constructors
constructor
Parameters
sideAndTree: any
market: number
clientId: BN
id: BN
Returns PerpOoDto
Properties
client Id
id
market
side And Tree
Generated using TypeDoc
\ No newline at end of file
+PerpOoDto | @blockworks-foundation/mango-v4 Class PerpOoDto
Hierarchy
- PerpOoDto
Index
Constructors
Properties
Constructors
constructor
Parameters
sideAndTree: any
market: number
clientId: BN
id: BN
Returns PerpOoDto
Properties
client Id
id
market
side And Tree
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpOrder.html b/ts/client/classes/PerpOrder.html
index a1e1057e9..aa63f9e64 100644
--- a/ts/client/classes/PerpOrder.html
+++ b/ts/client/classes/PerpOrder.html
@@ -1 +1 @@
-PerpOrder | @blockworks-foundation/mango-v4 Class PerpOrder
Hierarchy
- PerpOrder
Index
Constructors
constructor
Parameters
seqNum: BN
orderId: BN
owner: PublicKey
openOrdersSlot: number
feeTier: 0
uiPrice: number
priceLots: BN
uiSize: number
sizeLots: BN
side: PerpOrderSide
timestamp: BN
expiryTimestamp: BN
perpMarketIndex: number
isExpired: boolean = false
isOraclePegged: boolean = false
orderType: PerpOrderType
Optional oraclePeggedProperties: OraclePeggedProperties
Returns PerpOrder
Properties
expiry Timestamp
fee Tier
is Expired
is Oracle Pegged
open Orders Slot
Optional oracle Pegged Properties
order Id
order Type
owner
perp Market Index
price Lots
seq Num
side
size Lots
timestamp
ui Price
ui Size
Accessors
price
Returns number
size
Returns number
Methods
Static from
Parameters
perpMarket: PerpMarket
leafNode: LeafNode
type: BookSideType
isExpired: boolean = false
isOraclePegged: boolean = false
Returns PerpOrder
Generated using TypeDoc
\ No newline at end of file
+PerpOrder | @blockworks-foundation/mango-v4 Class PerpOrder
Hierarchy
- PerpOrder
Index
Constructors
constructor
Parameters
seqNum: BN
orderId: BN
owner: PublicKey
openOrdersSlot: number
feeTier: 0
uiPrice: number
priceLots: BN
uiSize: number
sizeLots: BN
side: PerpOrderSide
timestamp: BN
expiryTimestamp: BN
perpMarketIndex: number
isExpired: boolean = false
isOraclePegged: boolean = false
orderType: PerpOrderType
Optional oraclePeggedProperties: OraclePeggedProperties
Returns PerpOrder
Properties
expiry Timestamp
fee Tier
is Expired
is Oracle Pegged
open Orders Slot
Optional oracle Pegged Properties
order Id
order Type
owner
perp Market Index
price Lots
seq Num
side
size Lots
timestamp
ui Price
ui Size
Accessors
price
Returns number
size
Returns number
Methods
Static from
Parameters
perpMarket: PerpMarket
leafNode: LeafNode
type: BookSideType
isExpired: boolean = false
isOraclePegged: boolean = false
Returns PerpOrder
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpOrderSide.html b/ts/client/classes/PerpOrderSide.html
index 3e7b114e3..ec836ce2e 100644
--- a/ts/client/classes/PerpOrderSide.html
+++ b/ts/client/classes/PerpOrderSide.html
@@ -1 +1 @@
-PerpOrderSide | @blockworks-foundation/mango-v4 Class PerpOrderSide
Hierarchy
- PerpOrderSide
Index
Constructors
Properties
Constructors
constructor
Returns PerpOrderSide
Properties
Static ask
Type declaration
ask: {}
Static bid
Type declaration
bid: {}
Generated using TypeDoc
\ No newline at end of file
+PerpOrderSide | @blockworks-foundation/mango-v4 Class PerpOrderSide
Hierarchy
- PerpOrderSide
Index
Constructors
Properties
Constructors
constructor
Returns PerpOrderSide
Properties
Static ask
Type declaration
ask: {}
Static bid
Type declaration
bid: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpOrderType.html b/ts/client/classes/PerpOrderType.html
index 6ccbd82a5..9601b5d66 100644
--- a/ts/client/classes/PerpOrderType.html
+++ b/ts/client/classes/PerpOrderType.html
@@ -1 +1 @@
-PerpOrderType | @blockworks-foundation/mango-v4 Class PerpOrderType
Hierarchy
- PerpOrderType
Index
Constructors
Properties
Constructors
constructor
Returns PerpOrderType
Properties
Static immediate Or Cancel
Type declaration
immediate Or Cancel: {}
Static limit
Type declaration
limit: {}
Static market
Type declaration
market: {}
Static post Only
Type declaration
post Only: {}
Static post Only Slide
Type declaration
post Only Slide: {}
Generated using TypeDoc
\ No newline at end of file
+PerpOrderType | @blockworks-foundation/mango-v4 Class PerpOrderType
Hierarchy
- PerpOrderType
Index
Constructors
Properties
Constructors
constructor
Returns PerpOrderType
Properties
Static immediate Or Cancel
Type declaration
immediate Or Cancel: {}
Static limit
Type declaration
limit: {}
Static market
Type declaration
market: {}
Static post Only
Type declaration
post Only: {}
Static post Only Slide
Type declaration
post Only Slide: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpPosition.html b/ts/client/classes/PerpPosition.html
index 88620343b..71b5fe0a2 100644
--- a/ts/client/classes/PerpPosition.html
+++ b/ts/client/classes/PerpPosition.html
@@ -1 +1 @@
-PerpPosition | @blockworks-foundation/mango-v4 Class PerpPosition
Hierarchy
- PerpPosition
Index
Constructors
Properties
- asks
Base Lots - avg
Entry Price Per Base Lot - base
Position Lots - bids
Base Lots - cumulative
Long Funding - cumulative
Short Funding - long
Settled Funding - maker
Volume - market
Index - perp
Spot Transfers - quote
Position Native - quote
Running Native - realized
Other Pnl Native - realized
Pnl For Position Native - realized
Trade Pnl Native - settle
Pnl Limit Realized Trade - settle
Pnl Limit Settled In Current Window Native - settle
Pnl Limit Window - short
Settled Funding - taker
Base Lots - taker
Quote Lots - taker
Volume - Perp
Market Index Unset
Methods
- apply
Pnl Settle Limit - available
Settle Limit - can
Settle Pnl - cumulative
Pnl Over Position Lifetime Ui - get
Average Entry Price - get
Average Entry Price Ui - get
Base Position Native - get
Base Position Ui - get
Break Even Price Ui - get
Equity - get
Equity Ui - get
Notional Value Ui - get
Quote Position Ui - get
Settleable Pnl - get
Settleable Pnl Ui - get
Unsettled Funding - get
Unsettled Funding Ui - get
Unsettled Pnl - get
Unsettled Pnl Ui - has
Open Orders - is
Active - to
String - update
Settle Limit - empty
From Perp Market Index - from
Constructors
constructor
Parameters
marketIndex: PerpMarketIndex
settlePnlLimitWindow: number
settlePnlLimitSettledInCurrentWindowNative: BN
basePositionLots: BN
quotePositionNative: I80F48
quoteRunningNative: BN
longSettledFunding: I80F48
shortSettledFunding: I80F48
bidsBaseLots: BN
asksBaseLots: BN
takerBaseLots: BN
takerQuoteLots: BN
cumulativeLongFunding: number
cumulativeShortFunding: number
makerVolume: BN
takerVolume: BN
perpSpotTransfers: BN
avgEntryPricePerBaseLot: number
realizedTradePnlNative: I80F48
realizedOtherPnlNative: I80F48
settlePnlLimitRealizedTrade: BN
realizedPnlForPositionNative: I80F48
Returns PerpPosition
Properties
asks Base Lots
avg Entry Price Per Base Lot
base Position Lots
bids Base Lots
cumulative Long Funding
cumulative Short Funding
long Settled Funding
maker Volume
market Index
perp Spot Transfers
quote Position Native
quote Running Native
realized Other Pnl Native
realized Pnl For Position Native
realized Trade Pnl Native
settle Pnl Limit Realized Trade
settle Pnl Limit Settled In Current Window Native
settle Pnl Limit Window
short Settled Funding
taker Base Lots
taker Quote Lots
taker Volume
Static Perp Market Index Unset
Methods
apply Pnl Settle Limit
Parameters
pnl: I80F48
perpMarket: PerpMarket
Returns I80F48
available Settle Limit
Parameters
perpMarket: PerpMarket
Returns [BN, BN]
can Settle Pnl
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns boolean
cumulative Pnl Over Position Lifetime Ui
Parameters
perpMarket: PerpMarket
Returns number
get Average Entry Price
Parameters
perpMarket: PerpMarket
Returns I80F48
get Average Entry Price Ui
Parameters
perpMarket: PerpMarket
Returns number
get Base Position Native
Parameters
perpMarket: PerpMarket
Returns I80F48
get Base Position Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Break Even Price Ui
Parameters
perpMarket: PerpMarket
Returns number
get Equity
Parameters
perpMarket: PerpMarket
Returns I80F48
get Equity Ui
Parameters
perpMarket: PerpMarket
Returns number
get Notional Value Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Quote Position Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Settleable Pnl
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns I80F48
get Settleable Pnl Ui
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns number
get Unsettled Funding
Parameters
perpMarket: PerpMarket
Returns I80F48
get Unsettled Funding Ui
Parameters
perpMarket: PerpMarket
Returns number
get Unsettled Pnl
Parameters
perpMarket: PerpMarket
Returns I80F48
get Unsettled Pnl Ui
Parameters
perpMarket: PerpMarket
Returns number
has Open Orders
Returns boolean
is Active
Returns boolean
to String
Parameters
Optional perpMarket: PerpMarket
Returns string
update Settle Limit
Parameters
perpMarket: PerpMarket
Returns void
Static empty From Perp Market Index
Parameters
perpMarketIndex: PerpMarketIndex
Returns PerpPosition
Static from
Parameters
dto: PerpPositionDto
Returns PerpPosition
Generated using TypeDoc
\ No newline at end of file
+PerpPosition | @blockworks-foundation/mango-v4 Class PerpPosition
Hierarchy
- PerpPosition
Index
Constructors
Properties
- asks
Base Lots - avg
Entry Price Per Base Lot - base
Position Lots - bids
Base Lots - cumulative
Long Funding - cumulative
Short Funding - long
Settled Funding - maker
Volume - market
Index - perp
Spot Transfers - quote
Position Native - quote
Running Native - realized
Other Pnl Native - realized
Pnl For Position Native - realized
Trade Pnl Native - settle
Pnl Limit Realized Trade - settle
Pnl Limit Settled In Current Window Native - settle
Pnl Limit Window - short
Settled Funding - taker
Base Lots - taker
Quote Lots - taker
Volume - Perp
Market Index Unset
Methods
- apply
Pnl Settle Limit - available
Settle Limit - can
Settle Pnl - cumulative
Pnl Over Position Lifetime Ui - get
Average Entry Price - get
Average Entry Price Ui - get
Base Position Native - get
Base Position Ui - get
Break Even Price Ui - get
Equity - get
Equity Ui - get
Notional Value Ui - get
Quote Position Ui - get
Settleable Pnl - get
Settleable Pnl Ui - get
Unsettled Funding - get
Unsettled Funding Ui - get
Unsettled Pnl - get
Unsettled Pnl Ui - has
Open Orders - is
Active - to
String - update
Settle Limit - empty
From Perp Market Index - from
Constructors
constructor
Parameters
marketIndex: PerpMarketIndex
settlePnlLimitWindow: number
settlePnlLimitSettledInCurrentWindowNative: BN
basePositionLots: BN
quotePositionNative: I80F48
quoteRunningNative: BN
longSettledFunding: I80F48
shortSettledFunding: I80F48
bidsBaseLots: BN
asksBaseLots: BN
takerBaseLots: BN
takerQuoteLots: BN
cumulativeLongFunding: number
cumulativeShortFunding: number
makerVolume: BN
takerVolume: BN
perpSpotTransfers: BN
avgEntryPricePerBaseLot: number
realizedTradePnlNative: I80F48
realizedOtherPnlNative: I80F48
settlePnlLimitRealizedTrade: BN
realizedPnlForPositionNative: I80F48
Returns PerpPosition
Properties
asks Base Lots
avg Entry Price Per Base Lot
base Position Lots
bids Base Lots
cumulative Long Funding
cumulative Short Funding
long Settled Funding
maker Volume
market Index
perp Spot Transfers
quote Position Native
quote Running Native
realized Other Pnl Native
realized Pnl For Position Native
realized Trade Pnl Native
settle Pnl Limit Realized Trade
settle Pnl Limit Settled In Current Window Native
settle Pnl Limit Window
short Settled Funding
taker Base Lots
taker Quote Lots
taker Volume
Static Perp Market Index Unset
Methods
apply Pnl Settle Limit
Parameters
pnl: I80F48
perpMarket: PerpMarket
Returns I80F48
available Settle Limit
Parameters
perpMarket: PerpMarket
Returns [BN, BN]
can Settle Pnl
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns boolean
cumulative Pnl Over Position Lifetime Ui
Parameters
perpMarket: PerpMarket
Returns number
get Average Entry Price
Parameters
perpMarket: PerpMarket
Returns I80F48
get Average Entry Price Ui
Parameters
perpMarket: PerpMarket
Returns number
get Base Position Native
Parameters
perpMarket: PerpMarket
Returns I80F48
get Base Position Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Break Even Price Ui
Parameters
perpMarket: PerpMarket
Returns number
get Equity
Parameters
perpMarket: PerpMarket
Returns I80F48
get Equity Ui
Parameters
perpMarket: PerpMarket
Returns number
get Notional Value Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Quote Position Ui
Parameters
perpMarket: PerpMarket
Optional useEventQueue: boolean
Returns number
get Settleable Pnl
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns I80F48
get Settleable Pnl Ui
Parameters
group: Group
perpMarket: PerpMarket
account: MangoAccount
Returns number
get Unsettled Funding
Parameters
perpMarket: PerpMarket
Returns I80F48
get Unsettled Funding Ui
Parameters
perpMarket: PerpMarket
Returns number
get Unsettled Pnl
Parameters
perpMarket: PerpMarket
Returns I80F48
get Unsettled Pnl Ui
Parameters
perpMarket: PerpMarket
Returns number
has Open Orders
Returns boolean
is Active
Returns boolean
to String
Parameters
Optional perpMarket: PerpMarket
Returns string
update Settle Limit
Parameters
perpMarket: PerpMarket
Returns void
Static empty From Perp Market Index
Parameters
perpMarketIndex: PerpMarketIndex
Returns PerpPosition
Static from
Parameters
dto: PerpPositionDto
Returns PerpPosition
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/PerpPositionDto.html b/ts/client/classes/PerpPositionDto.html
index 8a6d12829..cef9c74e8 100644
--- a/ts/client/classes/PerpPositionDto.html
+++ b/ts/client/classes/PerpPositionDto.html
@@ -1 +1 @@
-PerpPositionDto | @blockworks-foundation/mango-v4 Class PerpPositionDto
Hierarchy
- PerpPositionDto
Index
Constructors
Properties
- asks
Base Lots - avg
Entry Price Per Base Lot - base
Position Lots - bids
Base Lots - cumulative
Long Funding - cumulative
Short Funding - long
Settled Funding - maker
Volume - market
Index - perp
Spot Transfers - quote
Position Native - quote
Running Native - realized
Other Pnl Native - realized
Pnl For Position Native - realized
Trade Pnl Native - settle
Pnl Limit Realized Trade - settle
Pnl Limit Settled In Current Window Native - settle
Pnl Limit Window - short
Settled Funding - taker
Base Lots - taker
Quote Lots - taker
Volume
Constructors
constructor
Parameters
marketIndex: number
settlePnlLimitWindow: number
settlePnlLimitSettledInCurrentWindowNative: BN
basePositionLots: BN
quotePositionNative: { val: BN }
val: BN
quoteRunningNative: BN
longSettledFunding: I80F48Dto
shortSettledFunding: I80F48Dto
bidsBaseLots: BN
asksBaseLots: BN
takerBaseLots: BN
takerQuoteLots: BN
cumulativeLongFunding: number
cumulativeShortFunding: number
makerVolume: BN
takerVolume: BN
perpSpotTransfers: BN
avgEntryPricePerBaseLot: number
realizedTradePnlNative: I80F48Dto
realizedOtherPnlNative: I80F48Dto
settlePnlLimitRealizedTrade: BN
realizedPnlForPositionNative: I80F48Dto
Returns PerpPositionDto
Properties
asks Base Lots
avg Entry Price Per Base Lot
base Position Lots
bids Base Lots
cumulative Long Funding
cumulative Short Funding
long Settled Funding
maker Volume
market Index
perp Spot Transfers
quote Position Native
Type declaration
val: BN
quote Running Native
realized Other Pnl Native
realized Pnl For Position Native
realized Trade Pnl Native
settle Pnl Limit Realized Trade
settle Pnl Limit Settled In Current Window Native
settle Pnl Limit Window
short Settled Funding
taker Base Lots
taker Quote Lots
taker Volume
Generated using TypeDoc
\ No newline at end of file
+PerpPositionDto | @blockworks-foundation/mango-v4 Class PerpPositionDto
Hierarchy
- PerpPositionDto
Index
Constructors
Properties
- asks
Base Lots - avg
Entry Price Per Base Lot - base
Position Lots - bids
Base Lots - cumulative
Long Funding - cumulative
Short Funding - long
Settled Funding - maker
Volume - market
Index - perp
Spot Transfers - quote
Position Native - quote
Running Native - realized
Other Pnl Native - realized
Pnl For Position Native - realized
Trade Pnl Native - settle
Pnl Limit Realized Trade - settle
Pnl Limit Settled In Current Window Native - settle
Pnl Limit Window - short
Settled Funding - taker
Base Lots - taker
Quote Lots - taker
Volume
Constructors
constructor
Parameters
marketIndex: number
settlePnlLimitWindow: number
settlePnlLimitSettledInCurrentWindowNative: BN
basePositionLots: BN
quotePositionNative: { val: BN }
val: BN
quoteRunningNative: BN
longSettledFunding: I80F48Dto
shortSettledFunding: I80F48Dto
bidsBaseLots: BN
asksBaseLots: BN
takerBaseLots: BN
takerQuoteLots: BN
cumulativeLongFunding: number
cumulativeShortFunding: number
makerVolume: BN
takerVolume: BN
perpSpotTransfers: BN
avgEntryPricePerBaseLot: number
realizedTradePnlNative: I80F48Dto
realizedOtherPnlNative: I80F48Dto
settlePnlLimitRealizedTrade: BN
realizedPnlForPositionNative: I80F48Dto
Returns PerpPositionDto
Properties
asks Base Lots
avg Entry Price Per Base Lot
base Position Lots
bids Base Lots
cumulative Long Funding
cumulative Short Funding
long Settled Funding
maker Volume
market Index
perp Spot Transfers
quote Position Native
Type declaration
val: BN
quote Running Native
realized Other Pnl Native
realized Pnl For Position Native
realized Trade Pnl Native
settle Pnl Limit Realized Trade
settle Pnl Limit Settled In Current Window Native
settle Pnl Limit Window
short Settled Funding
taker Base Lots
taker Quote Lots
taker Volume
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3Market.html b/ts/client/classes/Serum3Market.html
index 421268536..d83d07a23 100644
--- a/ts/client/classes/Serum3Market.html
+++ b/ts/client/classes/Serum3Market.html
@@ -1,5 +1,5 @@
-Serum3Market | @blockworks-foundation/mango-v4 Class Serum3Market
Hierarchy
- Serum3Market
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
baseTokenIndex: TokenIndex
quoteTokenIndex: TokenIndex
name: number[]
serumProgram: PublicKey
serumMarketExternal: PublicKey
marketIndex: MarketIndex
registrationTime: BN
reduceOnly: boolean
forceClose: boolean
Returns Serum3Market
Properties
base Token Index
force Close
group
market Index
name
public Key
quote Token Index
reduce Only
registration Time
serum Market External
serum Program
Methods
compute Price For Market Order Of Size
Parameters
client: MangoClient
group: Group
size: number
side: "buy" | "sell"
Returns Promise<number>
find Oo Pda
Parameters
programId: PublicKey
mangoAccount: PublicKey
Returns Promise<PublicKey>
get Fee Rates
Parameters
taker: boolean = true
Returns number
load Asks
Parameters
client: MangoClient
group: Group
Returns Promise<Orderbook>
load Bids
Parameters
client: MangoClient
group: Group
Returns Promise<Orderbook>
log Ob
Parameters
client: MangoClient
group: Group
Returns Promise<string>
max Ask Leverage
Parameters
group: Group
Returns number
maximum leverage one can ask on this market, this is only for display purposes,
+
Serum3Market | @blockworks-foundation/mango-v4 Class Serum3Market
Hierarchy
- Serum3Market
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
baseTokenIndex: TokenIndex
quoteTokenIndex: TokenIndex
name: number[]
serumProgram: PublicKey
serumMarketExternal: PublicKey
marketIndex: MarketIndex
registrationTime: BN
reduceOnly: boolean
forceClose: boolean
Returns Serum3Market
Properties
base Token Index
force Close
group
market Index
name
public Key
quote Token Index
reduce Only
registration Time
serum Market External
serum Program
Methods
compute Price For Market Order Of Size
Parameters
client: MangoClient
group: Group
size: number
side: "buy" | "sell"
Returns Promise<number>
find Oo Pda
Parameters
programId: PublicKey
mangoAccount: PublicKey
Returns Promise<PublicKey>
get Fee Rates
Parameters
taker: boolean = true
Returns number
load Asks
Parameters
client: MangoClient
group: Group
Returns Promise<Orderbook>
load Bids
Parameters
client: MangoClient
group: Group
Returns Promise<Orderbook>
log Ob
Parameters
client: MangoClient
group: Group
Returns Promise<string>
max Ask Leverage
Parameters
group: Group
Returns number
maximum leverage one can ask on this market, this is only for display purposes,
also see getMaxQuoteForSerum3BidUi and getMaxBaseForSerum3AskUi
-
max Bid Leverage
Parameters
group: Group
Returns number
maximum leverage one can bid on this market, this is only for display purposes,
+
max Bid Leverage
Parameters
group: Group
Returns number
maximum leverage one can bid on this market, this is only for display purposes,
also see getMaxQuoteForSerum3BidUi and getMaxBaseForSerum3AskUi
-
Static from
Parameters
publicKey: PublicKey
obj: { baseTokenIndex: number; forceClose: number; group: PublicKey; marketIndex: number; name: number[]; quoteTokenIndex: number; reduceOnly: number; registrationTime: BN; serumMarketExternal: PublicKey; serumProgram: PublicKey }
base Token Index: number
force Close: number
group: PublicKey
market Index: number
name: number[]
quote Token Index: number
reduce Only: number
registration Time: BN
serum Market External: PublicKey
serum Program: PublicKey
Returns Serum3Market
Generated using TypeDoc
\ No newline at end of file
+
Static from
Parameters
publicKey: PublicKey
obj: { baseTokenIndex: number; forceClose: number; group: PublicKey; marketIndex: number; name: number[]; quoteTokenIndex: number; reduceOnly: number; registrationTime: BN; serumMarketExternal: PublicKey; serumProgram: PublicKey }
base Token Index: number
force Close: number
group: PublicKey
market Index: number
name: number[]
quote Token Index: number
reduce Only: number
registration Time: BN
serum Market External: PublicKey
serum Program: PublicKey
Returns Serum3Market
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3OrderType.html b/ts/client/classes/Serum3OrderType.html
index 2725407a4..9a2a4f7fc 100644
--- a/ts/client/classes/Serum3OrderType.html
+++ b/ts/client/classes/Serum3OrderType.html
@@ -1 +1 @@
-Serum3OrderType | @blockworks-foundation/mango-v4 Class Serum3OrderType
Hierarchy
- Serum3OrderType
Index
Constructors
Properties
Constructors
constructor
Returns Serum3OrderType
Properties
Static immediate Or Cancel
Type declaration
immediate Or Cancel: {}
Static limit
Type declaration
limit: {}
Static post Only
Type declaration
post Only: {}
Generated using TypeDoc
\ No newline at end of file
+Serum3OrderType | @blockworks-foundation/mango-v4 Class Serum3OrderType
Hierarchy
- Serum3OrderType
Index
Constructors
Properties
Constructors
constructor
Returns Serum3OrderType
Properties
Static immediate Or Cancel
Type declaration
immediate Or Cancel: {}
Static limit
Type declaration
limit: {}
Static post Only
Type declaration
post Only: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3Orders.html b/ts/client/classes/Serum3Orders.html
index 53859e3ea..efa21aefc 100644
--- a/ts/client/classes/Serum3Orders.html
+++ b/ts/client/classes/Serum3Orders.html
@@ -1 +1 @@
-Serum3Orders | @blockworks-foundation/mango-v4 Class Serum3Orders
Hierarchy
- Serum3Orders
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
openOrders: PublicKey
marketIndex: MarketIndex
baseTokenIndex: TokenIndex
quoteTokenIndex: TokenIndex
Returns Serum3Orders
Properties
base Token Index
market Index
open Orders
quote Token Index
Static Serum3 Market Index Unset
Methods
is Active
Returns boolean
Static from
Parameters
dto: Serum3PositionDto
Returns Serum3Orders
Generated using TypeDoc
\ No newline at end of file
+Serum3Orders | @blockworks-foundation/mango-v4 Class Serum3Orders
Hierarchy
- Serum3Orders
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
openOrders: PublicKey
marketIndex: MarketIndex
baseTokenIndex: TokenIndex
quoteTokenIndex: TokenIndex
Returns Serum3Orders
Properties
base Token Index
market Index
open Orders
quote Token Index
Static Serum3 Market Index Unset
Methods
is Active
Returns boolean
Static from
Parameters
dto: Serum3PositionDto
Returns Serum3Orders
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3PositionDto.html b/ts/client/classes/Serum3PositionDto.html
index 8fbe48c3c..da574c1a0 100644
--- a/ts/client/classes/Serum3PositionDto.html
+++ b/ts/client/classes/Serum3PositionDto.html
@@ -1 +1 @@
-Serum3PositionDto | @blockworks-foundation/mango-v4 Class Serum3PositionDto
Hierarchy
- Serum3PositionDto
Index
Constructors
constructor
Parameters
openOrders: PublicKey
marketIndex: number
baseBorrowsWithoutFee: BN
quoteBorrowsWithoutFee: BN
baseTokenIndex: number
quoteTokenIndex: number
reserved: number[]
Returns Serum3PositionDto
Properties
base Borrows Without Fee
base Token Index
market Index
open Orders
quote Borrows Without Fee
quote Token Index
reserved
Generated using TypeDoc
\ No newline at end of file
+Serum3PositionDto | @blockworks-foundation/mango-v4 Class Serum3PositionDto
Hierarchy
- Serum3PositionDto
Index
Constructors
constructor
Parameters
openOrders: PublicKey
marketIndex: number
baseBorrowsWithoutFee: BN
quoteBorrowsWithoutFee: BN
baseTokenIndex: number
quoteTokenIndex: number
reserved: number[]
Returns Serum3PositionDto
Properties
base Borrows Without Fee
base Token Index
market Index
open Orders
quote Borrows Without Fee
quote Token Index
reserved
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3SelfTradeBehavior.html b/ts/client/classes/Serum3SelfTradeBehavior.html
index eb8606a02..0a6a2f30b 100644
--- a/ts/client/classes/Serum3SelfTradeBehavior.html
+++ b/ts/client/classes/Serum3SelfTradeBehavior.html
@@ -1 +1 @@
-Serum3SelfTradeBehavior | @blockworks-foundation/mango-v4 Class Serum3SelfTradeBehavior
Hierarchy
- Serum3SelfTradeBehavior
Index
Constructors
Properties
Constructors
constructor
Returns Serum3SelfTradeBehavior
Properties
Static abort Transaction
Type declaration
abort Transaction: {}
Static cancel Provide
Type declaration
cancel Provide: {}
Static decrement Take
Type declaration
decrement Take: {}
Generated using TypeDoc
\ No newline at end of file
+Serum3SelfTradeBehavior | @blockworks-foundation/mango-v4 Class Serum3SelfTradeBehavior
Hierarchy
- Serum3SelfTradeBehavior
Index
Constructors
Properties
Constructors
constructor
Returns Serum3SelfTradeBehavior
Properties
Static abort Transaction
Type declaration
abort Transaction: {}
Static cancel Provide
Type declaration
cancel Provide: {}
Static decrement Take
Type declaration
decrement Take: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/Serum3Side.html b/ts/client/classes/Serum3Side.html
index e433515b5..a0512537e 100644
--- a/ts/client/classes/Serum3Side.html
+++ b/ts/client/classes/Serum3Side.html
@@ -1 +1 @@
-Serum3Side | @blockworks-foundation/mango-v4 Class Serum3Side
Hierarchy
- Serum3Side
Index
Constructors
Properties
Constructors
constructor
Returns Serum3Side
Properties
Static ask
Type declaration
ask: {}
Static bid
Type declaration
bid: {}
Generated using TypeDoc
\ No newline at end of file
+Serum3Side | @blockworks-foundation/mango-v4 Class Serum3Side
Hierarchy
- Serum3Side
Index
Constructors
Properties
Constructors
constructor
Returns Serum3Side
Properties
Static ask
Type declaration
ask: {}
Static bid
Type declaration
bid: {}
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/StubOracle.html b/ts/client/classes/StubOracle.html
index 835758822..2f83bea88 100644
--- a/ts/client/classes/StubOracle.html
+++ b/ts/client/classes/StubOracle.html
@@ -1 +1 @@
-StubOracle | @blockworks-foundation/mango-v4 Class StubOracle
Hierarchy
- StubOracle
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
mint: PublicKey
price: I80F48Dto
lastUpdated: BN
Returns StubOracle
Properties
group
last Updated
mint
price
public Key
Methods
Static from
Parameters
publicKey: PublicKey
obj: { group: PublicKey; lastUpdated: BN; mint: PublicKey; price: I80F48Dto }
group: PublicKey
last Updated: BN
mint: PublicKey
price: I80F48Dto
Returns StubOracle
Generated using TypeDoc
\ No newline at end of file
+StubOracle | @blockworks-foundation/mango-v4 Class StubOracle
Hierarchy
- StubOracle
Index
Constructors
constructor
Parameters
publicKey: PublicKey
group: PublicKey
mint: PublicKey
price: I80F48Dto
lastUpdated: BN
Returns StubOracle
Properties
group
last Updated
mint
price
public Key
Methods
Static from
Parameters
publicKey: PublicKey
obj: { group: PublicKey; lastUpdated: BN; mint: PublicKey; price: I80F48Dto }
group: PublicKey
last Updated: BN
mint: PublicKey
price: I80F48Dto
Returns StubOracle
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/TokenPosition.html b/ts/client/classes/TokenPosition.html
index 3c0d93529..1809e608c 100644
--- a/ts/client/classes/TokenPosition.html
+++ b/ts/client/classes/TokenPosition.html
@@ -1,7 +1,7 @@
-TokenPosition | @blockworks-foundation/mango-v4 Class TokenPosition
Hierarchy
- TokenPosition
Index
Constructors
constructor
Parameters
indexedPosition: I80F48
tokenIndex: TokenIndex
inUseCount: number
previousIndex: I80F48
cumulativeDepositInterest: number
cumulativeBorrowInterest: number
Returns TokenPosition
Properties
cumulative Borrow Interest
cumulative Deposit Interest
in Use Count
indexed Position
previous Index
token Index
Static Token Index Unset
Methods
balance
balance Ui
Parameters
bank: Bank
Returns number
UI balance, is signed
-
borrows
borrows Ui
Parameters
bank: Bank
Returns number
UI borrows, 0 if position has deposits
-
deposits
deposits Ui
Parameters
bank: Bank
Returns number
UI deposits, 0 if position has borrows
-
is Active
Returns boolean
to String
Parameters
Optional group: Group
Optional index: number
Returns string
Static from
Parameters
dto: TokenPositionDto
Returns TokenPosition
Generated using TypeDoc
\ No newline at end of file
+TokenPosition | @blockworks-foundation/mango-v4 Class TokenPosition
Hierarchy
- TokenPosition
Index
Constructors
constructor
Parameters
indexedPosition: I80F48
tokenIndex: TokenIndex
inUseCount: number
previousIndex: I80F48
cumulativeDepositInterest: number
cumulativeBorrowInterest: number
Returns TokenPosition
Properties
cumulative Borrow Interest
cumulative Deposit Interest
in Use Count
indexed Position
previous Index
token Index
Static Token Index Unset
Methods
balance
balance Ui
Parameters
bank: Bank
Returns number
UI balance, is signed
+
borrows
borrows Ui
Parameters
bank: Bank
Returns number
UI borrows, 0 if position has deposits
+
deposits
deposits Ui
Parameters
bank: Bank
Returns number
UI deposits, 0 if position has borrows
+
is Active
Returns boolean
to String
Parameters
Optional group: Group
Optional index: number
Returns string
Static from
Parameters
dto: TokenPositionDto
Returns TokenPosition
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/classes/TokenPositionDto.html b/ts/client/classes/TokenPositionDto.html
index 752e0c24a..ed9d65768 100644
--- a/ts/client/classes/TokenPositionDto.html
+++ b/ts/client/classes/TokenPositionDto.html
@@ -1 +1 @@
-TokenPositionDto | @blockworks-foundation/mango-v4 Class TokenPositionDto
Hierarchy
- TokenPositionDto
Index
Constructors
constructor
Parameters
indexedPosition: I80F48Dto
tokenIndex: number
inUseCount: number
reserved: number[]
previousIndex: I80F48Dto
cumulativeDepositInterest: number
cumulativeBorrowInterest: number
Returns TokenPositionDto
Properties
cumulative Borrow Interest
cumulative Deposit Interest
in Use Count
indexed Position
previous Index
reserved
token Index
Generated using TypeDoc
\ No newline at end of file
+TokenPositionDto | @blockworks-foundation/mango-v4 Class TokenPositionDto
Hierarchy
- TokenPositionDto
Index
Constructors
constructor
Parameters
indexedPosition: I80F48Dto
tokenIndex: number
inUseCount: number
reserved: number[]
previousIndex: I80F48Dto
cumulativeDepositInterest: number
cumulativeBorrowInterest: number
Returns TokenPositionDto
Properties
cumulative Borrow Interest
cumulative Deposit Interest
in Use Count
indexed Position
previous Index
reserved
token Index
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/enums/OracleProvider.html b/ts/client/enums/OracleProvider.html
index 6bf23b92c..c722238f2 100644
--- a/ts/client/enums/OracleProvider.html
+++ b/ts/client/enums/OracleProvider.html
@@ -1 +1 @@
-OracleProvider | @blockworks-foundation/mango-v4 Enumeration OracleProvider
Generated using TypeDoc
\ No newline at end of file
+OracleProvider | @blockworks-foundation/mango-v4 Enumeration OracleProvider
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/enums/SwapMode.html b/ts/client/enums/SwapMode.html
index f9fd5658c..2bc6cd61d 100644
--- a/ts/client/enums/SwapMode.html
+++ b/ts/client/enums/SwapMode.html
@@ -1 +1 @@
-SwapMode | @blockworks-foundation/mango-v4 Enumeration SwapMode
Generated using TypeDoc
\ No newline at end of file
+SwapMode | @blockworks-foundation/mango-v4 Enumeration SwapMode
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/index.html b/ts/client/index.html
index affd3c337..8a8baf600 100644
--- a/ts/client/index.html
+++ b/ts/client/index.html
@@ -1,4 +1,4 @@
-@blockworks-foundation/mango-v4 @blockworks-foundation/mango-v4
Index
Enumerations
Classes
- As
- Bank
- Book
Side - Book
Side Type - Flash
Loan Type - Flash
Loan Withdraw - Group
- Health
Type - I80
F48 - I80
F48 Dto - Inner
Node - Interest
Rate Params - Leaf
Node - Mango
Account - Mango
Client - Mint
Info - Oracle
Config Params - Perp
Event Queue - Perp
Market - Perp
Oo - Perp
Oo Dto - Perp
Order - Perp
Order Side - Perp
Order Type - Perp
Position - Perp
Position Dto - Serum3
Market - Serum3
Order Type - Serum3
Orders - Serum3
Position Dto - Serum3
Self Trade Behavior - Serum3
Side - Stub
Oracle - Token
Position - Token
Position Dto
Interfaces
Type aliases
Variables
Functions
- HUNDRED_
I80 F48 - MAX_
I80 F48 - ONE_
I80 F48 - RUST_
I64_ MAX - RUST_
I64_ MIN - RUST_
U64_ MAX - ZERO_
I80 F48 - bps
To Decimal - build
Ix Gate - build
Versioned Tx - create
Associated Token Account Idempotent Instruction - fetch
Jupiter Transaction - fetch
Routes - get
Associated Token Address - percentage
To Decimal - prepare
Mango Router Instructions - to
Native - to
Native I80 F48 - to
Native I80 F48 For Quote - to
Ui Decimals - to
Ui Decimals For Quote - to
Ui I80 F48
Type aliases
Account Info Map
Amm Label
Modify
Type parameters
T
R
Oracle Config
Type declaration
conf Filter: I80F48
max Staleness Slots: BN
Oracle Config Dto
Type declaration
conf Filter: I80F48Dto
max Staleness Slots: BN
Parsed Fill Event
Perp Market Index
Platform Fee
Type declaration
fee Account: string
fee Bps: number
Quote Mint To Referrer
Routes
Stable Price Model
Type declaration
delay Accumulator Price: number
delay Accumulator Time: number
delay Growth Limit: number
delay Interval Seconds: number
delay Prices: number[]
last Delay Interval Index: number
last Update Timestamp: BN
stable Growth Limit: number
stable Price: number
Token
Type declaration
address: string
chain Id: number
decimals: number
extensions: { coingeckoId?: string }
Optional coingecko Id?: string
logoURI: string
name: string
symbol: string
tags: string[]
Token Index
Token Mint Address
Variables
Const I64_ MAX_ BN
Const MANGO_ ROUTER_ API_ URL
Const MANGO_ V4_ ID
Type declaration
devnet: PublicKey
mainnet- beta: PublicKey
testnet: PublicKey
Const Null Perp Edit Params
Const Null Token Edit Params
Const OPENBOOK_ PROGRAM_ ID
Type declaration
devnet: PublicKey
mainnet- beta: PublicKey
Const QUOTE_ DECIMALS
Const True Ix Gate Params
Const U64_ MAX_ BN
Functions
HUNDRED_ I80 F48
Returns I80F48
MAX_ I80 F48
Returns I80F48
ONE_ I80 F48
Returns I80F48
RUST_ I64_ MAX
Returns BN
RUST_ I64_ MIN
Returns BN
RUST_ U64_ MAX
Returns BN
ZERO_ I80 F48
Returns I80F48
bps To Decimal
Parameters
bps: number
Returns number
build Ix Gate
Parameters
p: IxGateParams
Returns BN
build Versioned Tx
Parameters
provider: AnchorProvider
ix: TransactionInstruction[]
additionalSigners: Signer[] = []
alts: AddressLookupTableAccount[] = []
Returns Promise<VersionedTransaction>
create Associated Token Account Idempotent Instruction
Parameters
payer: PublicKey
owner: PublicKey
mint: PublicKey
Returns Promise<TransactionInstruction>
fetch Jupiter Transaction
Parameters
connection: Connection
selectedRoute: RouteInfo
userPublicKey: PublicKey
slippage: number
inputMint: PublicKey
outputMint: PublicKey
Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
fetch Routes
Parameters
inputMint: any
outputMint: any
amount: string = '0'
slippage: number = 50
swapMode: string = 'ExactIn'
feeBps: string = '0'
wallet: PublicKey = PublicKey.default
Returns Promise<Routes>
get Associated Token Address
-
+
@blockworks-foundation/mango-v4 @blockworks-foundation/mango-v4
Index
Enumerations
Classes
- As
- Bank
- Book
Side - Book
Side Type - Flash
Loan Type - Flash
Loan Withdraw - Group
- Health
Type - I80
F48 - I80
F48 Dto - Inner
Node - Interest
Rate Params - Leaf
Node - Mango
Account - Mango
Client - Mint
Info - Oracle
Config Params - Perp
Event Queue - Perp
Market - Perp
Oo - Perp
Oo Dto - Perp
Order - Perp
Order Side - Perp
Order Type - Perp
Position - Perp
Position Dto - Serum3
Market - Serum3
Order Type - Serum3
Orders - Serum3
Position Dto - Serum3
Self Trade Behavior - Serum3
Side - Stub
Oracle - Token
Position - Token
Position Dto
Interfaces
Type aliases
Variables
Functions
- HUNDRED_
I80 F48 - MAX_
I80 F48 - ONE_
I80 F48 - RUST_
I64_ MAX - RUST_
I64_ MIN - RUST_
U64_ MAX - ZERO_
I80 F48 - bps
To Decimal - build
Ix Gate - build
Versioned Tx - create
Associated Token Account Idempotent Instruction - fetch
Jupiter Transaction - fetch
Routes - get
Associated Token Address - percentage
To Decimal - prepare
Mango Router Instructions - to
Native - to
Native I80 F48 - to
Native I80 F48 For Quote - to
Ui Decimals - to
Ui Decimals For Quote - to
Ui I80 F48
Type aliases
Account Info Map
Amm Label
Modify
Type parameters
T
R
Oracle Config
Type declaration
conf Filter: I80F48
max Staleness Slots: BN
Oracle Config Dto
Type declaration
conf Filter: I80F48Dto
max Staleness Slots: BN
Parsed Fill Event
Perp Market Index
Platform Fee
Type declaration
fee Account: string
fee Bps: number
Quote Mint To Referrer
Routes
Stable Price Model
Type declaration
delay Accumulator Price: number
delay Accumulator Time: number
delay Growth Limit: number
delay Interval Seconds: number
delay Prices: number[]
last Delay Interval Index: number
last Update Timestamp: BN
stable Growth Limit: number
stable Price: number
Token
Type declaration
address: string
chain Id: number
decimals: number
extensions: { coingeckoId?: string }
Optional coingecko Id?: string
logoURI: string
name: string
symbol: string
tags: string[]
Token Index
Token Mint Address
Variables
Const I64_ MAX_ BN
Const MANGO_ ROUTER_ API_ URL
Const MANGO_ V4_ ID
Type declaration
devnet: PublicKey
mainnet- beta: PublicKey
testnet: PublicKey
Const Null Perp Edit Params
Const Null Token Edit Params
Const OPENBOOK_ PROGRAM_ ID
Type declaration
devnet: PublicKey
mainnet- beta: PublicKey
Const QUOTE_ DECIMALS
Const True Ix Gate Params
Const U64_ MAX_ BN
Functions
HUNDRED_ I80 F48
Returns I80F48
MAX_ I80 F48
Returns I80F48
ONE_ I80 F48
Returns I80F48
RUST_ I64_ MAX
Returns BN
RUST_ I64_ MIN
Returns BN
RUST_ U64_ MAX
Returns BN
ZERO_ I80 F48
Returns I80F48
bps To Decimal
Parameters
bps: number
Returns number
build Ix Gate
Parameters
p: IxGateParams
Returns BN
build Versioned Tx
Parameters
provider: AnchorProvider
ix: TransactionInstruction[]
additionalSigners: Signer[] = []
alts: AddressLookupTableAccount[] = []
Returns Promise<VersionedTransaction>
create Associated Token Account Idempotent Instruction
Parameters
payer: PublicKey
owner: PublicKey
mint: PublicKey
Returns Promise<TransactionInstruction>
fetch Jupiter Transaction
Parameters
connection: Connection
selectedRoute: RouteInfo
userPublicKey: PublicKey
slippage: number
inputMint: PublicKey
outputMint: PublicKey
Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
fetch Routes
Parameters
inputMint: any
outputMint: any
amount: string = '0'
slippage: number = 50
swapMode: string = 'ExactIn'
feeBps: string = '0'
wallet: PublicKey = PublicKey.default
Returns Promise<Routes>
get Associated Token Address
-
Get the address of the associated token account for a given mint and owner
Parameters
mint: PublicKey
Token mint account
@@ -11,4 +11,4 @@
associatedTokenProgramId: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
SPL Associated Token program account
Returns Promise<PublicKey>
Address of the associated token account
-
percentage To Decimal
Parameters
percentage: number
Returns number
prepare Mango Router Instructions
Parameters
selectedRoute: RouteInfo
inputMint: PublicKey
outputMint: PublicKey
userPublicKey: PublicKey
Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
to Native
Parameters
uiAmount: number
decimals: number
Returns BN
to Native I80 F48
Parameters
uiAmount: number
decimals: number
Returns I80F48
to Native I80 F48 For Quote
Parameters
uiAmount: number
Returns I80F48
to Ui Decimals
Parameters
nativeAmount: number | BN | I80F48
decimals: number
Returns number
to Ui Decimals For Quote
Parameters
nativeAmount: number | BN | I80F48
Returns number
to Ui I80 F48
Generated using TypeDoc
\ No newline at end of file
+percentage To Decimal
Parameters
percentage: number
Returns number
prepare Mango Router Instructions
Parameters
selectedRoute: RouteInfo
inputMint: PublicKey
outputMint: PublicKey
userPublicKey: PublicKey
Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
to Native
Parameters
uiAmount: number
decimals: number
Returns BN
to Native I80 F48
Parameters
uiAmount: number
decimals: number
Returns I80F48
to Native I80 F48 For Quote
Parameters
uiAmount: number
Returns I80F48
to Ui Decimals
Parameters
nativeAmount: number | BN | I80F48
decimals: number
Returns number
to Ui Decimals For Quote
Parameters
nativeAmount: number | BN | I80F48
Returns number
to Ui I80 F48
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/BankForHealth.html b/ts/client/interfaces/BankForHealth.html
index f496fd007..80f2f11b8 100644
--- a/ts/client/interfaces/BankForHealth.html
+++ b/ts/client/interfaces/BankForHealth.html
@@ -1 +1 @@
-BankForHealth | @blockworks-foundation/mango-v4 Interface BankForHealth
Generated using TypeDoc
\ No newline at end of file
+BankForHealth | @blockworks-foundation/mango-v4 Interface BankForHealth
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/Event.html b/ts/client/interfaces/Event.html
index 5adb8952f..8705c66ef 100644
--- a/ts/client/interfaces/Event.html
+++ b/ts/client/interfaces/Event.html
@@ -1 +1 @@
-Event | @blockworks-foundation/mango-v4 Interface Event
Generated using TypeDoc
\ No newline at end of file
+Event | @blockworks-foundation/mango-v4 Interface Event
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/ExactOutSwapParams.html b/ts/client/interfaces/ExactOutSwapParams.html
index f134f08a8..ee3c44fe2 100644
--- a/ts/client/interfaces/ExactOutSwapParams.html
+++ b/ts/client/interfaces/ExactOutSwapParams.html
@@ -1,3 +1,3 @@
-ExactOutSwapParams | @blockworks-foundation/mango-v4 Interface ExactOutSwapParams
Hierarchy
- SwapParams
- ExactOutSwapParams
Index
Properties
amount
+ExactOutSwapParams | @blockworks-foundation/mango-v4 Interface ExactOutSwapParams
Hierarchy
- SwapParams
- ExactOutSwapParams
Index
Properties
amount
amount is used for instruction and can be null when it is an intermediate swap, only the first swap has an amount
-destination Mint
in Amount
Optional open Orders Address
Optional overflow Fee Account
Optional platform Fee
Optional quote Mint To Referrer
slippage Bps
source Mint
swap Mode
user Destination Token Account
user Source Token Account
user Transfer Authority
Generated using TypeDoc
\ No newline at end of file
+destination Mint
in Amount
Optional open Orders Address
Optional overflow Fee Account
Optional platform Fee
Optional quote Mint To Referrer
slippage Bps
source Mint
swap Mode
user Destination Token Account
user Source Token Account
user Transfer Authority
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/Fee.html b/ts/client/interfaces/Fee.html
index b89b9d736..91814f364 100644
--- a/ts/client/interfaces/Fee.html
+++ b/ts/client/interfaces/Fee.html
@@ -1 +1 @@
-Fee | @blockworks-foundation/mango-v4 Interface Fee
Generated using TypeDoc
\ No newline at end of file
+Fee | @blockworks-foundation/mango-v4 Interface Fee
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/FillEvent.html b/ts/client/interfaces/FillEvent.html
index 30e309877..2bbd3ad92 100644
--- a/ts/client/interfaces/FillEvent.html
+++ b/ts/client/interfaces/FillEvent.html
@@ -1 +1 @@
-FillEvent | @blockworks-foundation/mango-v4 Interface FillEvent
Hierarchy
- Event
- FillEvent
Index
Properties
event Type
maker
maker Fee
maker Order Id
maker Out
maker Slot
maker Timestamp
price
quantity
seq Num
taker
taker Client Order Id
taker Fee
taker Order Id
taker Side
timestamp
Generated using TypeDoc
\ No newline at end of file
+FillEvent | @blockworks-foundation/mango-v4 Interface FillEvent
Hierarchy
- Event
- FillEvent
Index
Properties
event Type
maker
maker Fee
maker Order Id
maker Out
maker Slot
maker Timestamp
price
quantity
seq Num
taker
taker Client Order Id
taker Fee
taker Order Id
taker Side
timestamp
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/LiquidateEvent.html b/ts/client/interfaces/LiquidateEvent.html
index 82692ff88..ddb546f0f 100644
--- a/ts/client/interfaces/LiquidateEvent.html
+++ b/ts/client/interfaces/LiquidateEvent.html
@@ -1 +1 @@
-LiquidateEvent | @blockworks-foundation/mango-v4 Interface LiquidateEvent
Generated using TypeDoc
\ No newline at end of file
+LiquidateEvent | @blockworks-foundation/mango-v4 Interface LiquidateEvent
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/MarketInfo.html b/ts/client/interfaces/MarketInfo.html
index 88d9ef487..272f787e1 100644
--- a/ts/client/interfaces/MarketInfo.html
+++ b/ts/client/interfaces/MarketInfo.html
@@ -1 +1 @@
-MarketInfo | @blockworks-foundation/mango-v4 Interface MarketInfo
Generated using TypeDoc
\ No newline at end of file
+MarketInfo | @blockworks-foundation/mango-v4 Interface MarketInfo
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/OutEvent.html b/ts/client/interfaces/OutEvent.html
index eff834d0b..f32b7dfa1 100644
--- a/ts/client/interfaces/OutEvent.html
+++ b/ts/client/interfaces/OutEvent.html
@@ -1 +1 @@
-OutEvent | @blockworks-foundation/mango-v4 Interface OutEvent
Generated using TypeDoc
\ No newline at end of file
+OutEvent | @blockworks-foundation/mango-v4 Interface OutEvent
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/Quote.html b/ts/client/interfaces/Quote.html
index a7eb2575b..8f1435242 100644
--- a/ts/client/interfaces/Quote.html
+++ b/ts/client/interfaces/Quote.html
@@ -1 +1 @@
-Quote | @blockworks-foundation/mango-v4 Interface Quote
Generated using TypeDoc
\ No newline at end of file
+Quote | @blockworks-foundation/mango-v4 Interface Quote
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/QuoteParams.html b/ts/client/interfaces/QuoteParams.html
index ca23b99b5..e7a4a1967 100644
--- a/ts/client/interfaces/QuoteParams.html
+++ b/ts/client/interfaces/QuoteParams.html
@@ -1 +1 @@
-QuoteParams | @blockworks-foundation/mango-v4 Interface QuoteParams
Generated using TypeDoc
\ No newline at end of file
+QuoteParams | @blockworks-foundation/mango-v4 Interface QuoteParams
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/RouteInfo.html b/ts/client/interfaces/RouteInfo.html
index f1183fea5..1739e7e51 100644
--- a/ts/client/interfaces/RouteInfo.html
+++ b/ts/client/interfaces/RouteInfo.html
@@ -1 +1 @@
-RouteInfo | @blockworks-foundation/mango-v4 Interface RouteInfo
Generated using TypeDoc
\ No newline at end of file
+RouteInfo | @blockworks-foundation/mango-v4 Interface RouteInfo
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/SwapParams.html b/ts/client/interfaces/SwapParams.html
index ba50a6109..cf38ffe45 100644
--- a/ts/client/interfaces/SwapParams.html
+++ b/ts/client/interfaces/SwapParams.html
@@ -1,3 +1,3 @@
-SwapParams | @blockworks-foundation/mango-v4 Interface SwapParams
Hierarchy
- SwapParams
Index
Properties
amount
+SwapParams | @blockworks-foundation/mango-v4 Interface SwapParams
Hierarchy
- SwapParams
Index
Properties
amount
amount is used for instruction and can be null when it is an intermediate swap, only the first swap has an amount
-destination Mint
Optional open Orders Address
Optional quote Mint To Referrer
source Mint
swap Mode
user Destination Token Account
user Source Token Account
user Transfer Authority
Generated using TypeDoc
\ No newline at end of file
+destination Mint
Optional open Orders Address
Optional quote Mint To Referrer
source Mint
swap Mode
user Destination Token Account
user Source Token Account
user Transfer Authority
Generated using TypeDoc
\ No newline at end of file
diff --git a/ts/client/interfaces/TransactionFeeInfo.html b/ts/client/interfaces/TransactionFeeInfo.html
index b07926d97..1832c93b0 100644
--- a/ts/client/interfaces/TransactionFeeInfo.html
+++ b/ts/client/interfaces/TransactionFeeInfo.html
@@ -1 +1 @@
-TransactionFeeInfo | @blockworks-foundation/mango-v4 Interface TransactionFeeInfo
Generated using TypeDoc
\ No newline at end of file
+TransactionFeeInfo | @blockworks-foundation/mango-v4 Interface TransactionFeeInfo
Generated using TypeDoc
\ No newline at end of file
- 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