From 28b310ce59f23c4298d5903a1e43e5307a562576 Mon Sep 17 00:00:00 2001 From: farnyser Date: Mon, 19 Feb 2024 09:33:31 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20blockwor?= =?UTF-8?q?ks-foundation/mango-v4@338a9cb7b85680690da098382624056102f3e9ef?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rs/.rustc_info.json | 2 +- ts/client/classes/As.html | 2 +- ts/client/classes/Bank.html | 14 +++--- ts/client/classes/BookSide.html | 6 +-- ts/client/classes/FlashLoanWithdraw.html | 2 +- ts/client/classes/Group.html | 6 +-- ts/client/classes/HealthType.html | 2 +- ts/client/classes/I80F48.html | 8 +-- ts/client/classes/I80F48Dto.html | 2 +- ts/client/classes/InnerNode.html | 2 +- ts/client/classes/InterestRateParams.html | 2 +- ts/client/classes/LeafNode.html | 2 +- ts/client/classes/MangoAccount.html | 50 +++++++++---------- ts/client/classes/MangoClient.html | 12 ++--- ts/client/classes/MangoError.html | 2 +- ts/client/classes/MintInfo.html | 2 +- ts/client/classes/OracleConfigParams.html | 2 +- ts/client/classes/PerpEventQueue.html | 2 +- ts/client/classes/PerpMarket.html | 8 +-- ts/client/classes/PerpOo.html | 2 +- ts/client/classes/PerpOoDto.html | 2 +- ts/client/classes/PerpOrder.html | 2 +- ts/client/classes/PerpPosition.html | 6 +-- ts/client/classes/PerpPositionDto.html | 2 +- ts/client/classes/Serum3Market.html | 6 +-- ts/client/classes/Serum3Orders.html | 2 +- ts/client/classes/Serum3PositionDto.html | 2 +- ts/client/classes/StubOracle.html | 2 +- ts/client/classes/TokenConditionalSwap.html | 2 +- .../classes/TokenConditionalSwapDto.html | 2 +- ts/client/classes/TokenPosition.html | 14 +++--- ts/client/classes/TokenPositionDto.html | 2 +- ts/client/enums/OracleProvider.html | 2 +- ts/client/enums/SwapMode.html | 2 +- ts/client/enums/TransactionErrors.html | 2 +- ts/client/index.html | 12 ++--- ts/client/interfaces/AccountEquity.html | 2 +- ts/client/interfaces/BankForHealth.html | 2 +- ts/client/interfaces/CumulativeFunding.html | 2 +- ts/client/interfaces/Event.html | 2 +- ts/client/interfaces/ExactOutSwapParams.html | 4 +- ts/client/interfaces/Fee.html | 2 +- ts/client/interfaces/FillEvent.html | 2 +- ts/client/interfaces/LatestBlockhash.html | 2 +- ts/client/interfaces/LiqorPriceImpact.html | 2 +- ts/client/interfaces/LiquidateEvent.html | 2 +- ts/client/interfaces/LiquidationBatches.html | 2 +- .../interfaces/MangoSignatureStatus.html | 2 +- ts/client/interfaces/MarketInfo.html | 2 +- ts/client/interfaces/OutEvent.html | 2 +- .../PerpPositionsToBeLiquidated.html | 2 +- ts/client/interfaces/Quote.html | 2 +- ts/client/interfaces/QuoteParams.html | 2 +- ts/client/interfaces/Risk.html | 2 +- ts/client/interfaces/RouteInfo.html | 2 +- ts/client/interfaces/SwapParams.html | 4 +- ts/client/interfaces/TransactionFeeInfo.html | 2 +- ts/client/modules/BookSideType.html | 2 +- ts/client/modules/FlashLoanType.html | 2 +- ts/client/modules/PerpOrderSide.html | 2 +- ts/client/modules/PerpOrderType.html | 2 +- ts/client/modules/PerpSelfTradeBehavior.html | 2 +- ts/client/modules/Serum3OrderType.html | 2 +- .../modules/Serum3SelfTradeBehavior.html | 2 +- ts/client/modules/Serum3Side.html | 2 +- ...TokenConditionalSwapDisplayPriceStyle.html | 2 +- .../TokenConditionalSwapIntention.html | 2 +- 67 files changed, 129 insertions(+), 129 deletions(-) diff --git a/rs/.rustc_info.json b/rs/.rustc_info.json index f35b3bddf..e58751759 100644 --- a/rs/.rustc_info.json +++ b/rs/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":3338297881922824614,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.69.0 (84c898d65 2023-04-16)\nbinary: rustc\ncommit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\ncommit-date: 2023-04-16\nhost: x86_64-unknown-linux-gnu\nrelease: 1.69.0\nLLVM version: 15.0.7\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/runner/.rustup/toolchains/1.69-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file +{"rustc_fingerprint":14733637370179483626,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/runner/.rustup/toolchains/1.69-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.69.0 (84c898d65 2023-04-16)\nbinary: rustc\ncommit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\ncommit-date: 2023-04-16\nhost: x86_64-unknown-linux-gnu\nrelease: 1.69.0\nLLVM version: 15.0.7\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/ts/client/classes/As.html b/ts/client/classes/As.html index a8d76ea10..abae447d7 100644 --- a/ts/client/classes/As.html +++ b/ts/client/classes/As.html @@ -1 +1 @@ -As | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • Tag: keyof never

Hierarchy

  • As

Index

Constructors

Properties

Constructors

  • new As<Tag>(): As<Tag>
  • Type parameters

    • Tag: string | number | symbol

    Returns As<Tag>

Properties

[$as$]: Record<Tag, true>
$as$: typeof $as$

Generated using TypeDoc

\ No newline at end of file +As | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • Tag: keyof never

Hierarchy

  • As

Index

Constructors

Properties

Constructors

  • new As<Tag>(): As<Tag>
  • Type parameters

    • Tag: string | number | symbol

    Returns As<Tag>

Properties

[$as$]: Record<Tag, true>
$as$: typeof $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 aa9e3f0b8..707b2d20f 100644 --- a/ts/client/classes/Bank.html +++ b/ts/client/classes/Bank.html @@ -1,7 +1,7 @@ -Bank | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Bank

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

  • new Bank(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, feesWithdrawn: BN, tokenConditionalSwapTakerFeeRate: number, tokenConditionalSwapMakerFeeRate: number, flashLoanSwapFeeRate: number, interestTargetUtilization: number, interestCurveScaling: number, potentialSerumTokens: BN, maintWeightShiftStart: BN, maintWeightShiftEnd: BN, maintWeightShiftDurationInv: I80F48Dto, maintWeightShiftAssetTarget: I80F48Dto, maintWeightShiftLiabTarget: I80F48Dto, fallbackOracle: PublicKey, depositLimit: BN, zeroUtilRate: I80F48Dto, platformLiquidationFee: I80F48Dto, collectedLiquidationFees: I80F48Dto, allowAssetLiquidation: boolean, collectedCollateralFees: I80F48Dto, collateralFeePerDay: number): Bank
  • 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
    • feesWithdrawn: BN
    • tokenConditionalSwapTakerFeeRate: number
    • tokenConditionalSwapMakerFeeRate: number
    • flashLoanSwapFeeRate: number
    • interestTargetUtilization: number
    • interestCurveScaling: number
    • potentialSerumTokens: BN
    • maintWeightShiftStart: BN
    • maintWeightShiftEnd: BN
    • maintWeightShiftDurationInv: I80F48Dto
    • maintWeightShiftAssetTarget: I80F48Dto
    • maintWeightShiftLiabTarget: I80F48Dto
    • fallbackOracle: PublicKey
    • depositLimit: BN
    • zeroUtilRate: I80F48Dto
    • platformLiquidationFee: I80F48Dto
    • collectedLiquidationFees: I80F48Dto
    • allowAssetLiquidation: boolean
    • collectedCollateralFees: I80F48Dto
    • collateralFeePerDay: number

    Returns Bank

Properties

_oracleLastKnownDeviation: undefined | I80F48
_oracleLastUpdatedSlot: undefined | number
_oracleProvider: undefined | OracleProvider
_price: undefined | I80F48
_uiPrice: undefined | number
adjustmentFactor: I80F48
allowAssetLiquidation: boolean
avgUtilization: I80F48
bankNum: number
bankRateLastUpdated: BN
borrowIndex: I80F48
borrowWeightScaleStartQuote: number
collateralFeePerDay: number
collectedCollateralFees: I80F48
collectedFeesNative: I80F48
collectedLiquidationFees: I80F48
depositIndex: I80F48
depositLimit: BN
depositWeightScaleStartQuote: number
dust: I80F48
fallbackOracle: PublicKey
feesWithdrawn: BN
flashLoanApprovedAmount: BN
flashLoanSwapFeeRate: number
flashLoanTokenAccountInitial: BN
forceClose: boolean
group: PublicKey
indexLastUpdated: BN
indexedBorrows: I80F48
indexedDeposits: I80F48
initAssetWeight: I80F48
initLiabWeight: I80F48
interestCurveScaling: number
interestTargetUtilization: number
lastNetBorrowsWindowStartTs: BN
liquidationFee: I80F48
loanFeeRate: I80F48
loanOriginationFeeRate: I80F48
maintAssetWeight: I80F48
maintLiabWeight: I80F48
maintWeightShiftAssetTarget: I80F48
maintWeightShiftDurationInv: I80F48
maintWeightShiftEnd: BN
maintWeightShiftLiabTarget: I80F48
maintWeightShiftStart: BN
maxRate: I80F48
minVaultToDepositsRatio: number
mint: PublicKey
mintDecimals: number
name: string
netBorrowLimitPerWindowQuote: BN
netBorrowLimitWindowSizeTs: BN
netBorrowsInWindow: BN
oracle: PublicKey
oracleConfig: OracleConfig
platformLiquidationFee: I80F48
potentialSerumTokens: BN
publicKey: PublicKey
rate0: I80F48
rate1: I80F48
reduceOnly: number
stablePriceModel: StablePriceModel
tokenConditionalSwapMakerFeeRate: number
tokenConditionalSwapTakerFeeRate: number
tokenIndex: TokenIndex
util0: I80F48
util1: I80F48
vault: PublicKey
zeroUtilRate: I80F48

Accessors

  • get oracleLastUpdatedSlot(): number
  • get uiPrice(): number

Methods

  • areBorrowsReduceOnly(): boolean
  • areDepositsReduceOnly(): boolean
  • getBorrowLimitLeftInWindow(): I80F48
  • getBorrowRateUi(): number
  • getBorrowRateWithoutUpkeepRate(): I80F48
  • getDepositRateUi(): number
  • getMaxWithdraw(vaultBalance: BN, userDeposits?: I80F48): I80F48
  • getNetBorrowLimitPerWindow(): I80F48
  • getNetBorrowLimitPerWindowUi(): number
  • getRemainingDepositLimit(): null | BN
  • getTimeToNextBorrowLimitWindowStartsTs(): number
  • isOracleStaleOrUnconfident(nowSlot: number): boolean
  • toString(): string
  • uiBorrows(): number
  • uiDeposits(): number
  • from(publicKey: PublicKey, obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collateralFeePerDay: number; collectedCollateralFees: I80F48Dto; collectedFeesNative: I80F48Dto; collectedLiquidationFees: I80F48Dto; depositIndex: I80F48Dto; depositLimit: BN; depositWeightScaleStartQuote: number; disableAssetLiquidation: number; dust: I80F48Dto; fallbackOracle: PublicKey; feesWithdrawn: BN; flashLoanApprovedAmount: BN; flashLoanSwapFeeRate: number; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; interestCurveScaling: number; interestTargetUtilization: number; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maintWeightShiftAssetTarget: I80F48Dto; maintWeightShiftDurationInv: I80F48Dto; maintWeightShiftEnd: BN; maintWeightShiftLiabTarget: I80F48Dto; maintWeightShiftStart: BN; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; platformLiquidationFee: I80F48Dto; potentialSerumTokens: BN; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenConditionalSwapMakerFeeRate: number; tokenConditionalSwapTakerFeeRate: number; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey; zeroUtilRate: I80F48Dto }): Bank
  • Parameters

    • publicKey: PublicKey
    • obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collateralFeePerDay: number; collectedCollateralFees: I80F48Dto; collectedFeesNative: I80F48Dto; collectedLiquidationFees: I80F48Dto; depositIndex: I80F48Dto; depositLimit: BN; depositWeightScaleStartQuote: number; disableAssetLiquidation: number; dust: I80F48Dto; fallbackOracle: PublicKey; feesWithdrawn: BN; flashLoanApprovedAmount: BN; flashLoanSwapFeeRate: number; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; interestCurveScaling: number; interestTargetUtilization: number; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maintWeightShiftAssetTarget: I80F48Dto; maintWeightShiftDurationInv: I80F48Dto; maintWeightShiftEnd: BN; maintWeightShiftLiabTarget: I80F48Dto; maintWeightShiftStart: BN; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; platformLiquidationFee: I80F48Dto; potentialSerumTokens: BN; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenConditionalSwapMakerFeeRate: number; tokenConditionalSwapTakerFeeRate: number; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey; zeroUtilRate: I80F48Dto }
      • adjustmentFactor: I80F48Dto
      • avgUtilization: I80F48Dto
      • bankNum: number
      • bankRateLastUpdated: BN
      • borrowIndex: I80F48Dto
      • borrowWeightScaleStartQuote: number
      • collateralFeePerDay: number
      • collectedCollateralFees: I80F48Dto
      • collectedFeesNative: I80F48Dto
      • collectedLiquidationFees: I80F48Dto
      • depositIndex: I80F48Dto
      • depositLimit: BN
      • depositWeightScaleStartQuote: number
      • disableAssetLiquidation: number
      • dust: I80F48Dto
      • fallbackOracle: PublicKey
      • feesWithdrawn: BN
      • flashLoanApprovedAmount: BN
      • flashLoanSwapFeeRate: number
      • flashLoanTokenAccountInitial: BN
      • forceClose: number
      • group: PublicKey
      • indexLastUpdated: BN
      • indexedBorrows: I80F48Dto
      • indexedDeposits: I80F48Dto
      • initAssetWeight: I80F48Dto
      • initLiabWeight: I80F48Dto
      • interestCurveScaling: number
      • interestTargetUtilization: number
      • lastNetBorrowsWindowStartTs: BN
      • liquidationFee: I80F48Dto
      • loanFeeRate: I80F48Dto
      • loanOriginationFeeRate: I80F48Dto
      • maintAssetWeight: I80F48Dto
      • maintLiabWeight: I80F48Dto
      • maintWeightShiftAssetTarget: I80F48Dto
      • maintWeightShiftDurationInv: I80F48Dto
      • maintWeightShiftEnd: BN
      • maintWeightShiftLiabTarget: I80F48Dto
      • maintWeightShiftStart: BN
      • maxRate: I80F48Dto
      • minVaultToDepositsRatio: number
      • mint: PublicKey
      • mintDecimals: number
      • name: number[]
      • netBorrowLimitPerWindowQuote: BN
      • netBorrowLimitWindowSizeTs: BN
      • netBorrowsInWindow: BN
      • oracle: PublicKey
      • oracleConfig: OracleConfigDto
      • platformLiquidationFee: I80F48Dto
      • potentialSerumTokens: BN
      • rate0: I80F48Dto
      • rate1: I80F48Dto
      • reduceOnly: number
      • stablePriceModel: StablePriceModel
      • tokenConditionalSwapMakerFeeRate: number
      • tokenConditionalSwapTakerFeeRate: number
      • tokenIndex: number
      • util0: I80F48Dto
      • util1: I80F48Dto
      • vault: PublicKey
      • zeroUtilRate: I80F48Dto

    Returns Bank

Generated using TypeDoc

\ No newline at end of file +Bank | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Bank

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

  • new Bank(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, feesWithdrawn: BN, tokenConditionalSwapTakerFeeRate: number, tokenConditionalSwapMakerFeeRate: number, flashLoanSwapFeeRate: number, interestTargetUtilization: number, interestCurveScaling: number, potentialSerumTokens: BN, maintWeightShiftStart: BN, maintWeightShiftEnd: BN, maintWeightShiftDurationInv: I80F48Dto, maintWeightShiftAssetTarget: I80F48Dto, maintWeightShiftLiabTarget: I80F48Dto, fallbackOracle: PublicKey, depositLimit: BN, zeroUtilRate: I80F48Dto, platformLiquidationFee: I80F48Dto, collectedLiquidationFees: I80F48Dto, allowAssetLiquidation: boolean, collectedCollateralFees: I80F48Dto, collateralFeePerDay: number): Bank
  • 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
    • feesWithdrawn: BN
    • tokenConditionalSwapTakerFeeRate: number
    • tokenConditionalSwapMakerFeeRate: number
    • flashLoanSwapFeeRate: number
    • interestTargetUtilization: number
    • interestCurveScaling: number
    • potentialSerumTokens: BN
    • maintWeightShiftStart: BN
    • maintWeightShiftEnd: BN
    • maintWeightShiftDurationInv: I80F48Dto
    • maintWeightShiftAssetTarget: I80F48Dto
    • maintWeightShiftLiabTarget: I80F48Dto
    • fallbackOracle: PublicKey
    • depositLimit: BN
    • zeroUtilRate: I80F48Dto
    • platformLiquidationFee: I80F48Dto
    • collectedLiquidationFees: I80F48Dto
    • allowAssetLiquidation: boolean
    • collectedCollateralFees: I80F48Dto
    • collateralFeePerDay: number

    Returns Bank

Properties

_oracleLastKnownDeviation: undefined | I80F48
_oracleLastUpdatedSlot: undefined | number
_oracleProvider: undefined | OracleProvider
_price: undefined | I80F48
_uiPrice: undefined | number
adjustmentFactor: I80F48
allowAssetLiquidation: boolean
avgUtilization: I80F48
bankNum: number
bankRateLastUpdated: BN
borrowIndex: I80F48
borrowWeightScaleStartQuote: number
collateralFeePerDay: number
collectedCollateralFees: I80F48
collectedFeesNative: I80F48
collectedLiquidationFees: I80F48
depositIndex: I80F48
depositLimit: BN
depositWeightScaleStartQuote: number
dust: I80F48
fallbackOracle: PublicKey
feesWithdrawn: BN
flashLoanApprovedAmount: BN
flashLoanSwapFeeRate: number
flashLoanTokenAccountInitial: BN
forceClose: boolean
group: PublicKey
indexLastUpdated: BN
indexedBorrows: I80F48
indexedDeposits: I80F48
initAssetWeight: I80F48
initLiabWeight: I80F48
interestCurveScaling: number
interestTargetUtilization: number
lastNetBorrowsWindowStartTs: BN
liquidationFee: I80F48
loanFeeRate: I80F48
loanOriginationFeeRate: I80F48
maintAssetWeight: I80F48
maintLiabWeight: I80F48
maintWeightShiftAssetTarget: I80F48
maintWeightShiftDurationInv: I80F48
maintWeightShiftEnd: BN
maintWeightShiftLiabTarget: I80F48
maintWeightShiftStart: BN
maxRate: I80F48
minVaultToDepositsRatio: number
mint: PublicKey
mintDecimals: number
name: string
netBorrowLimitPerWindowQuote: BN
netBorrowLimitWindowSizeTs: BN
netBorrowsInWindow: BN
oracle: PublicKey
oracleConfig: OracleConfig
platformLiquidationFee: I80F48
potentialSerumTokens: BN
publicKey: PublicKey
rate0: I80F48
rate1: I80F48
reduceOnly: number
stablePriceModel: StablePriceModel
tokenConditionalSwapMakerFeeRate: number
tokenConditionalSwapTakerFeeRate: number
tokenIndex: TokenIndex
util0: I80F48
util1: I80F48
vault: PublicKey
zeroUtilRate: I80F48

Accessors

  • get oracleLastUpdatedSlot(): number
  • get uiPrice(): number

Methods

  • areBorrowsReduceOnly(): boolean
  • areDepositsReduceOnly(): boolean
  • getBorrowLimitLeftInWindow(): I80F48
  • getBorrowRateUi(): number
  • getBorrowRateWithoutUpkeepRate(): I80F48
  • getDepositRateUi(): number
  • getMaxWithdraw(vaultBalance: BN, userDeposits?: I80F48): I80F48
  • getNetBorrowLimitPerWindow(): I80F48
  • getNetBorrowLimitPerWindowUi(): number
  • getRemainingDepositLimit(): null | BN
  • getTimeToNextBorrowLimitWindowStartsTs(): number
  • isOracleStaleOrUnconfident(nowSlot: number): boolean
  • toString(): string
  • uiBorrows(): number
  • uiDeposits(): number
  • from(publicKey: PublicKey, obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collateralFeePerDay: number; collectedCollateralFees: I80F48Dto; collectedFeesNative: I80F48Dto; collectedLiquidationFees: I80F48Dto; depositIndex: I80F48Dto; depositLimit: BN; depositWeightScaleStartQuote: number; disableAssetLiquidation: number; dust: I80F48Dto; fallbackOracle: PublicKey; feesWithdrawn: BN; flashLoanApprovedAmount: BN; flashLoanSwapFeeRate: number; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; interestCurveScaling: number; interestTargetUtilization: number; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maintWeightShiftAssetTarget: I80F48Dto; maintWeightShiftDurationInv: I80F48Dto; maintWeightShiftEnd: BN; maintWeightShiftLiabTarget: I80F48Dto; maintWeightShiftStart: BN; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; platformLiquidationFee: I80F48Dto; potentialSerumTokens: BN; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenConditionalSwapMakerFeeRate: number; tokenConditionalSwapTakerFeeRate: number; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey; zeroUtilRate: I80F48Dto }): Bank
  • Parameters

    • publicKey: PublicKey
    • obj: { adjustmentFactor: I80F48Dto; avgUtilization: I80F48Dto; bankNum: number; bankRateLastUpdated: BN; borrowIndex: I80F48Dto; borrowWeightScaleStartQuote: number; collateralFeePerDay: number; collectedCollateralFees: I80F48Dto; collectedFeesNative: I80F48Dto; collectedLiquidationFees: I80F48Dto; depositIndex: I80F48Dto; depositLimit: BN; depositWeightScaleStartQuote: number; disableAssetLiquidation: number; dust: I80F48Dto; fallbackOracle: PublicKey; feesWithdrawn: BN; flashLoanApprovedAmount: BN; flashLoanSwapFeeRate: number; flashLoanTokenAccountInitial: BN; forceClose: number; group: PublicKey; indexLastUpdated: BN; indexedBorrows: I80F48Dto; indexedDeposits: I80F48Dto; initAssetWeight: I80F48Dto; initLiabWeight: I80F48Dto; interestCurveScaling: number; interestTargetUtilization: number; lastNetBorrowsWindowStartTs: BN; liquidationFee: I80F48Dto; loanFeeRate: I80F48Dto; loanOriginationFeeRate: I80F48Dto; maintAssetWeight: I80F48Dto; maintLiabWeight: I80F48Dto; maintWeightShiftAssetTarget: I80F48Dto; maintWeightShiftDurationInv: I80F48Dto; maintWeightShiftEnd: BN; maintWeightShiftLiabTarget: I80F48Dto; maintWeightShiftStart: BN; maxRate: I80F48Dto; minVaultToDepositsRatio: number; mint: PublicKey; mintDecimals: number; name: number[]; netBorrowLimitPerWindowQuote: BN; netBorrowLimitWindowSizeTs: BN; netBorrowsInWindow: BN; oracle: PublicKey; oracleConfig: OracleConfigDto; platformLiquidationFee: I80F48Dto; potentialSerumTokens: BN; rate0: I80F48Dto; rate1: I80F48Dto; reduceOnly: number; stablePriceModel: StablePriceModel; tokenConditionalSwapMakerFeeRate: number; tokenConditionalSwapTakerFeeRate: number; tokenIndex: number; util0: I80F48Dto; util1: I80F48Dto; vault: PublicKey; zeroUtilRate: I80F48Dto }
      • adjustmentFactor: I80F48Dto
      • avgUtilization: I80F48Dto
      • bankNum: number
      • bankRateLastUpdated: BN
      • borrowIndex: I80F48Dto
      • borrowWeightScaleStartQuote: number
      • collateralFeePerDay: number
      • collectedCollateralFees: I80F48Dto
      • collectedFeesNative: I80F48Dto
      • collectedLiquidationFees: I80F48Dto
      • depositIndex: I80F48Dto
      • depositLimit: BN
      • depositWeightScaleStartQuote: number
      • disableAssetLiquidation: number
      • dust: I80F48Dto
      • fallbackOracle: PublicKey
      • feesWithdrawn: BN
      • flashLoanApprovedAmount: BN
      • flashLoanSwapFeeRate: number
      • flashLoanTokenAccountInitial: BN
      • forceClose: number
      • group: PublicKey
      • indexLastUpdated: BN
      • indexedBorrows: I80F48Dto
      • indexedDeposits: I80F48Dto
      • initAssetWeight: I80F48Dto
      • initLiabWeight: I80F48Dto
      • interestCurveScaling: number
      • interestTargetUtilization: number
      • lastNetBorrowsWindowStartTs: BN
      • liquidationFee: I80F48Dto
      • loanFeeRate: I80F48Dto
      • loanOriginationFeeRate: I80F48Dto
      • maintAssetWeight: I80F48Dto
      • maintLiabWeight: I80F48Dto
      • maintWeightShiftAssetTarget: I80F48Dto
      • maintWeightShiftDurationInv: I80F48Dto
      • maintWeightShiftEnd: BN
      • maintWeightShiftLiabTarget: I80F48Dto
      • maintWeightShiftStart: BN
      • maxRate: I80F48Dto
      • minVaultToDepositsRatio: number
      • mint: PublicKey
      • mintDecimals: number
      • name: number[]
      • netBorrowLimitPerWindowQuote: BN
      • netBorrowLimitWindowSizeTs: BN
      • netBorrowsInWindow: BN
      • oracle: PublicKey
      • oracleConfig: OracleConfigDto
      • platformLiquidationFee: I80F48Dto
      • potentialSerumTokens: BN
      • rate0: I80F48Dto
      • rate1: I80F48Dto
      • reduceOnly: number
      • stablePriceModel: StablePriceModel
      • tokenConditionalSwapMakerFeeRate: number
      • tokenConditionalSwapTakerFeeRate: number
      • tokenIndex: number
      • util0: I80F48Dto
      • util1: I80F48Dto
      • vault: PublicKey
      • zeroUtilRate: I80F48Dto

    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 ef900c352..7018f30a9 100644 --- a/ts/client/classes/BookSide.html +++ b/ts/client/classes/BookSide.html @@ -1,7 +1,7 @@ -BookSide | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BookSide

Index

Constructors

Properties

client: MangoClient
now: BN
orderTreeNodes: OrderTreeNodes
perpMarket: PerpMarket
rootFixed: OrderTreeRoot
rootOraclePegged: OrderTreeRoot
INNER_NODE_TAG: number = 1
LEAF_NODE_TAG: number = 2

Methods

  • fixedItems(): Generator<PerpOrder, any, unknown>
  • getImpactPriceUi(baseLots: BN): undefined | number
  • getL2(depth: number): [number, number, BN, BN][]
  • getL2Ui(depth: number): [number, number][]
  • oraclePeggedItems(): Generator<PerpOrder, any, unknown>
  • getPriceFromKey(key: BN): BN

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/client/classes/FlashLoanWithdraw.html b/ts/client/classes/FlashLoanWithdraw.html index 3ba08171c..027bc4080 100644 --- a/ts/client/classes/FlashLoanWithdraw.html +++ b/ts/client/classes/FlashLoanWithdraw.html @@ -1 +1 @@ -FlashLoanWithdraw | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Generated using TypeDoc

\ No newline at end of file +FlashLoanWithdraw | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/client/classes/Group.html b/ts/client/classes/Group.html index 978c7e0a2..d0f91bbb4 100644 --- a/ts/client/classes/Group.html +++ b/ts/client/classes/Group.html @@ -1,5 +1,5 @@ -Group | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Group

Index

Constructors

  • new Group(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, fastListingIntervalStart: BN, fastListingsInInterval: number, allowedFastListingsPerInterval: number, collateralFeeInterval: 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>, pis: PriceImpact[]): Group
  • 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
    • fastListingIntervalStart: BN
    • fastListingsInInterval: number
    • allowedFastListingsPerInterval: number
    • collateralFeeInterval: 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>
    • pis: PriceImpact[]

    Returns Group

Properties

addressLookupTables: PublicKey[]
addressLookupTablesList: AddressLookupTableAccount[]
admin: PublicKey
allowedFastListingsPerInterval: number
banksMapByMint: Map<string, Bank[]>
banksMapByName: Map<string, Bank[]>
banksMapByTokenIndex: Map<TokenIndex, Bank[]>
buybackFees: boolean
buybackFeesExpiryInterval: BN
buybackFeesMngoBonusFactor: number
buybackFeesSwapMangoAccount: PublicKey
collateralFeeInterval: BN
creator: PublicKey
depositLimitQuote: any
fastListingAdmin: PublicKey
fastListingIntervalStart: BN
fastListingsInInterval: number
groupNum: number
insuranceMint: PublicKey
insuranceVault: PublicKey
ixGate: BN
mintInfosMapByMint: Map<string, MintInfo>
mintInfosMapByTokenIndex: Map<TokenIndex, MintInfo>
mngoTokenIndex: TokenIndex
perpMarketsMapByMarketIndex: Map<PerpMarketIndex, PerpMarket>
perpMarketsMapByName: Map<string, PerpMarket>
perpMarketsMapByOracle: Map<string, PerpMarket>
publicKey: PublicKey
securityAdmin: PublicKey
serum3ExternalMarketsMap: Map<string, Market>
serum3MarketsMapByExternal: Map<string, Serum3Market>
serum3MarketsMapByMarketIndex: Map<MarketIndex, Serum3Market>
testing: number
vaultAmountsMap: Map<string, BN>
version: number

Methods

  • consoleLogBanks(): void
  • decodePriceFromOracleAi(coder: BorshAccountsCoder<string>, oracle: PublicKey, ai: AccountInfo<Buffer>, baseDecimals: number, client: MangoClient): Promise<{ deviation: I80F48; lastUpdatedSlot: number; price: I80F48; provider: OracleProvider; uiPrice: number }>
  • getFirstBankByMint(mintPk: PublicKey): Bank
  • getFirstBankForMngo(): Bank
  • getFirstBankForPerpSettlement(): Bank
  • getInsuranceMintDecimals(): number
  • getMintDecimals(mintPk: PublicKey): number
  • getMintDecimalsByTokenIndex(tokenIndex: TokenIndex): number
  • getPerpMarketByName(perpMarketName: string): PerpMarket
  • getPerpMarketByOracle(oracle: PublicKey): PerpMarket
  • getPriceImpactByTokenIndex(tokenIndex: TokenIndex, usdcAmountUi: number): number
  • getSerum3ExternalMarket(externalMarketPk: PublicKey): Market
  • getSerum3MarketByExternalMarket(externalMarketPk: PublicKey): Serum3Market
  • getSerum3MarketByMarketIndex(marketIndex: MarketIndex): Serum3Market
  • getTokenVaultBalanceByMint(mintPk: PublicKey): BN
  • getTokenVaultBalanceByMintUi(mintPk: PublicKey): number
  • loadSerum3AsksForMarket(client: MangoClient, externalMarketPk: PublicKey): Promise<Orderbook>
  • loadSerum3BidsForMarket(client: MangoClient, externalMarketPk: PublicKey): Promise<Orderbook>
  • reloadBankOraclePrices(client: MangoClient): Promise<void>
  • reloadBanks(client: MangoClient, ids?: Id): Promise<void>
  • reloadMintInfos(client: MangoClient, ids?: Id): Promise<void>
  • reloadPerpMarketOraclePrices(client: MangoClient): Promise<void>
  • reloadPerpMarkets(client: MangoClient, ids?: Id): Promise<void>
  • reloadPriceImpactData(): Promise<void>
  • reloadSerum3ExternalMarkets(client: MangoClient, ids?: Id): Promise<void>
  • reloadSerum3Markets(client: MangoClient, ids?: Id): Promise<void>
  • toNativeDecimals(uiAmount: number, mintPk: PublicKey): BN
  • toNativePrice(uiPrice: number, baseDecimals: number): I80F48
  • toString(): string
  • toUiPrice(price: number | I80F48, baseDecimals: number): number
  • from(publicKey: PublicKey, obj: { addressLookupTables: PublicKey[]; admin: PublicKey; allowedFastListingsPerInterval: number; buybackFees: number; buybackFeesExpiryInterval: BN; buybackFeesMngoBonusFactor: number; buybackFeesSwapMangoAccount: PublicKey; collateralFeeInterval: BN; creator: PublicKey; depositLimitQuote: BN; fastListingAdmin: PublicKey; fastListingIntervalStart: BN; fastListingsInInterval: number; groupNum: number; insuranceMint: PublicKey; insuranceVault: PublicKey; ixGate: BN; mngoTokenIndex: number; securityAdmin: PublicKey; testing: number; version: number }): Group
  • Parameters

    • publicKey: PublicKey
    • obj: { addressLookupTables: PublicKey[]; admin: PublicKey; allowedFastListingsPerInterval: number; buybackFees: number; buybackFeesExpiryInterval: BN; buybackFeesMngoBonusFactor: number; buybackFeesSwapMangoAccount: PublicKey; collateralFeeInterval: BN; creator: PublicKey; depositLimitQuote: BN; fastListingAdmin: PublicKey; fastListingIntervalStart: BN; fastListingsInInterval: number; groupNum: number; insuranceMint: PublicKey; insuranceVault: PublicKey; ixGate: BN; mngoTokenIndex: number; securityAdmin: PublicKey; testing: number; version: number }
      • addressLookupTables: PublicKey[]
      • admin: PublicKey
      • allowedFastListingsPerInterval: number
      • buybackFees: number
      • buybackFeesExpiryInterval: BN
      • buybackFeesMngoBonusFactor: number
      • buybackFeesSwapMangoAccount: PublicKey
      • collateralFeeInterval: BN
      • creator: PublicKey
      • depositLimitQuote: BN
      • fastListingAdmin: PublicKey
      • fastListingIntervalStart: BN
      • fastListingsInInterval: number
      • groupNum: number
      • insuranceMint: PublicKey
      • insuranceVault: PublicKey
      • ixGate: BN
      • mngoTokenIndex: number
      • securityAdmin: 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 16b2b6788..4db709eca 100644 --- a/ts/client/classes/HealthType.html +++ b/ts/client/classes/HealthType.html @@ -1 +1 @@ -HealthType | @blockworks-foundation/mango-v4
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • HealthType

Index

Constructors

Properties

init: { init: {} } = ...

Type declaration

  • init: {}
    liquidationEnd: { liquidationEnd: {} } = ...

    Type declaration

    • liquidationEnd: {}
      maint: { maint: {} } = ...

      Type declaration

      • maint: {}

        Generated using TypeDoc

        \ No newline at end of file +HealthType | @blockworks-foundation/mango-v4
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • HealthType

        Index

        Constructors

        Properties

        init: { init: {} } = ...

        Type declaration

        • init: {}
          liquidationEnd: { liquidationEnd: {} } = ...

          Type declaration

          • liquidationEnd: {}
            maint: { 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 ed304b74a..4d55b15e6 100644 --- a/ts/client/classes/I80F48.html +++ b/ts/client/classes/I80F48.html @@ -1,11 +1,11 @@ -I80F48 | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • I80F48

              Index

              Constructors

              Properties

              data: BN
              FRACTIONS: number = 48
              MAX_BN: BN = ...
              MAX_SIZE: number = 128
              +I80F48 | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • I80F48

              Index

              Constructors

              Properties

              data: BN
              FRACTIONS: number = 48
              MAX_BN: BN = ...
              MAX_SIZE: number = 128

              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

              -
              MIN_BN: BN = ...
              MULTIPLIER_BIG: any = ...
              MULTIPLIER_BN: BN = ...
              MULTIPLIER_NUMBER: number = ...

              Methods

              • getBinaryLayout(): string
              • getData(): BN
              • isNeg(): boolean
              • isPos(): boolean
              • isZero(): boolean
              MIN_BN: BN = ...
              MULTIPLIER_BIG: any = ...
              MULTIPLIER_BN: BN = ...
              MULTIPLIER_NUMBER: number = ...

              Methods

              • getBinaryLayout(): string
              • getData(): BN
              • isNeg(): boolean
              • isPos(): boolean
              • isZero(): boolean
              • toArray(): Uint8Array
              • toArrayLike(ArrayType: BufferConstructor, endian?: Endianness, length?: number): Buffer
              • toBig(): Big
              • toFixed(decimals?: number): string
              • toArray(): Uint8Array
              • toArrayLike(ArrayType: BufferConstructor, endian?: Endianness, length?: number): Buffer
              • toBig(): Big
              • toFixed(decimals?: number): string
              • toLocaleString(locales?: string | string[], options?: NumberFormatOptions): string
              • toNumber(): number
              • toString(): string
              • toTwos(): BN
              • fromArray(src: Uint8Array): I80F48
              • fromNumberOrUndef(x?: number): undefined | I80F48
              • fromOptionalString(x?: string): undefined | I80F48

              Legend

              • Constructor
              • Property
              • Method
              • Property
              • Method
              • Private property
              • Private method
              • Static property
              • Static method

              Settings

              Theme

              Generated using TypeDoc

              \ No newline at end of file +

              Parameters

              • Optional decimals: number

              Returns string

              • toLocaleString(locales?: string | string[], options?: NumberFormatOptions): string
              • toNumber(): number
              • toString(): string
              • toTwos(): BN
              • fromArray(src: Uint8Array): I80F48
              • fromNumberOrUndef(x?: number): undefined | I80F48
              • fromOptionalString(x?: string): undefined | 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 b1a7066d9..6a7ce378e 100644 --- a/ts/client/classes/I80F48Dto.html +++ b/ts/client/classes/I80F48Dto.html @@ -1 +1 @@ -I80F48Dto | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Generated using TypeDoc

              \ No newline at end of file +I80F48Dto | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Generated using TypeDoc

              \ No newline at end of file diff --git a/ts/client/classes/InnerNode.html b/ts/client/classes/InnerNode.html index 3eede3cb2..5993dc475 100644 --- a/ts/client/classes/InnerNode.html +++ b/ts/client/classes/InnerNode.html @@ -1 +1 @@ -InnerNode | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • InnerNode

              Index

              Constructors

              Properties

              Methods

              Constructors

              Properties

              children: [number]

              Methods

              Generated using TypeDoc

              \ No newline at end of file +InnerNode | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • InnerNode

              Index

              Constructors

              Properties

              Methods

              Constructors

              Properties

              children: [number]

              Methods

              Generated using TypeDoc

              \ No newline at end of file diff --git a/ts/client/classes/InterestRateParams.html b/ts/client/classes/InterestRateParams.html index f40b9523c..94cd94341 100644 --- a/ts/client/classes/InterestRateParams.html +++ b/ts/client/classes/InterestRateParams.html @@ -1 +1 @@ -InterestRateParams | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Generated using TypeDoc

              \ No newline at end of file +InterestRateParams | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Generated using TypeDoc

              \ No newline at end of file diff --git a/ts/client/classes/LeafNode.html b/ts/client/classes/LeafNode.html index 12082b212..ec6b5699c 100644 --- a/ts/client/classes/LeafNode.html +++ b/ts/client/classes/LeafNode.html @@ -1 +1 @@ -LeafNode | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • LeafNode

              Index

              Constructors

              • new LeafNode(ownerSlot: number, orderType: PerpOrderType, timeInForce: number, key: BN, owner: PublicKey, quantity: BN, timestamp: BN, pegLimit: BN): LeafNode

              Properties

              key: BN
              orderType: PerpOrderType
              owner: PublicKey
              ownerSlot: number
              pegLimit: BN
              quantity: BN
              timeInForce: number
              timestamp: BN

              Methods

              • from(obj: { key: BN; orderType: PerpOrderType; owner: PublicKey; ownerSlot: number; pegLimit: BN; quantity: BN; timeInForce: number; timestamp: BN }): LeafNode

              Generated using TypeDoc

              \ No newline at end of file +LeafNode | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • LeafNode

              Index

              Constructors

              • new LeafNode(ownerSlot: number, orderType: PerpOrderType, timeInForce: number, key: BN, owner: PublicKey, quantity: BN, timestamp: BN, pegLimit: BN): LeafNode

              Properties

              key: BN
              orderType: PerpOrderType
              owner: PublicKey
              ownerSlot: number
              pegLimit: BN
              quantity: BN
              timeInForce: number
              timestamp: BN

              Methods

              • from(obj: { key: BN; orderType: PerpOrderType; owner: PublicKey; ownerSlot: number; pegLimit: BN; quantity: BN; timeInForce: number; timestamp: BN }): 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 bed7885bd..d3b10e7ef 100644 --- a/ts/client/classes/MangoAccount.html +++ b/ts/client/classes/MangoAccount.html @@ -1,69 +1,69 @@ -MangoAccount | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • MangoAccount

              Index

              Constructors

              Properties

              Methods

              Constructors

              • new MangoAccount(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[], tokenConditionalSwaps: TokenConditionalSwapDto[], serum3OosMapByMarketIndex: Map<number, OpenOrders>): MangoAccount

              Properties

              accountNum: number
              beingLiquidated: boolean
              buybackFeesAccruedCurrent: BN
              buybackFeesAccruedPrevious: BN
              buybackFeesExpiryTimestamp: BN
              delegate: PublicKey
              frozenUntil: BN
              group: PublicKey
              headerVersion: number
              healthRegionBeginInitHealth: BN
              inHealthRegion: boolean
              name: string
              netDeposits: BN
              owner: PublicKey
              perpOpenOrders: PerpOo[]
              perpSpotTransfers: BN
              perps: PerpPosition[]
              publicKey: PublicKey
              serum3: Serum3Orders[]
              serum3OosMapByMarketIndex: Map<number, OpenOrders>
              tokenConditionalSwaps: TokenConditionalSwap[]
              tokens: TokenPosition[]

              Methods

              • calculateEquivalentSourceAmount(sourceBank: Bank, targetBank: Bank, targetRemainingDepositLimit: BN): I80F48
              • toString(group?: Group, onlyTokens?: boolean): string
              • from(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; tokenConditionalSwaps: unknown; tokens: unknown }): MangoAccount
              • 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; tokenConditionalSwaps: unknown; tokens: unknown }
                  • 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
                  • tokenConditionalSwaps: 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 8b46abf68..09e228488 100644 --- a/ts/client/classes/MangoClient.html +++ b/ts/client/classes/MangoClient.html @@ -1,4 +1,4 @@ -MangoClient | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • MangoClient

              Index

              Constructors

              Properties

              Accessors

              Methods

              Constructors

              • new MangoClient(program: Program<MangoV4>, programId: PublicKey, cluster: Cluster, opts?: MangoClientOptions): MangoClient

              Properties

              cluster: Cluster
              estimateFee: boolean
              idsSource: IdsSource
              multipleConnections: Connection[] = []
              openbookFeesToDao: boolean
              opts: MangoClientOptions = {}
              postSendTxCallback?: (callbackOpts: TxCallbackOptions) => void

              Type declaration

                • (callbackOpts: TxCallbackOptions): void
                • Parameters

                  • callbackOpts: TxCallbackOptions

                  Returns void

              postTxConfirmationCallback?: (callbackOpts: TxCallbackOptions) => void

              Type declaration

                • (callbackOpts: TxCallbackOptions): void
                • Parameters

                  • callbackOpts: TxCallbackOptions

                  Returns void

              prependedGlobalAdditionalInstructions: TransactionInstruction[] = []
              prioritizationFee: number
              program: Program<MangoV4>
              programId: PublicKey
              txConfirmationCommitment: Commitment

              Accessors

              • get connection(): Connection
              • get walletPk(): PublicKey

              Methods

              • accountBuybackFeesWithMngoIx(group: Group, mangoAccount: MangoAccount, maxBuybackUsd?: number): Promise<TransactionInstruction>
              • accountExpandV2(group: Group, account: MangoAccount, tokenCount: number, serum3Count: number, perpCount: number, perpOoCount: number, tokenConditionalSwapCount: number): Promise<MangoSignatureStatus>
              • accountExpandV2Ix(group: Group, account: MangoAccount, tokenCount: number, serum3Count: number, perpCount: number, perpOoCount: number, tokenConditionalSwapCount: number): Promise<TransactionInstruction>
              • Parameters

                • group: Group
                • account: MangoAccount
                • tokenCount: number
                • serum3Count: number
                • perpCount: number
                • perpOoCount: number
                • tokenConditionalSwapCount: number

                Returns Promise<TransactionInstruction>

              Returns PublicKey[]

              • 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

                Returns Promise<MangoSignatureStatus>

              • createMangoAccount(group: Group, accountNumber?: number, name?: string, tokenCount?: number, serum3Count?: number, perpCount?: number, perpOoCount?: number): Promise<MangoSignatureStatus>
              • estimatePrioritizationFee(ixs: TransactionInstruction[]): Promise<number>
              • createMangoAccount(group: Group, accountNumber?: number, name?: string, tokenCount?: number, serum3Count?: number, perpCount?: number, perpOoCount?: number): Promise<MangoSignatureStatus>
              • estimatePrioritizationFee(ixs: TransactionInstruction[]): Promise<number>
              • Returns an estimate of a prioritization fee for a set of instructions.

                The estimate is based on the median fees of writable accounts that will be involved in the transaction.

                Parameters

                • ixs: TransactionInstruction[]

                  the instructions that make up the transaction

                Returns Promise<number>

                prioritizationFeeEstimate -- in microLamports

                -
              • getBanksForGroup(group: Group): Promise<Bank[]>
              • getGroup(groupPk: PublicKey): Promise<Group>
              • getGroupForCreator(creatorPk: PublicKey, groupNum: number): Promise<Group>
              • getGroupsForCreator(creatorPk: PublicKey): Promise<Group[]>
              • getIds(groupPk: PublicKey): Promise<undefined | Id>
              • getMangoAccount(mangoAccountPk: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount>
              • getMangoAccountForOwner(group: Group, ownerPk: PublicKey, accountNumber: number, loadSerum3Oo?: boolean): Promise<undefined | MangoAccount>
              • getMangoAccountFromAi(mangoAccountPk: PublicKey, ai: AccountInfo<Buffer>): MangoAccount
              • getMangoAccountFromPk(mangoAccountPk: PublicKey): Promise<MangoAccount>
              • getMangoAccountWithSlot(mangoAccountPk: PublicKey, loadSerum3Oo?: boolean): Promise<undefined | { slot: number; value: MangoAccount }>
              • getMangoAccountsForDelegate(group: Group, delegate: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount[]>
              • getMangoAccountsForOwner(group: Group, ownerPk: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount[]>
              • groupCreate(groupNum: number, testing: boolean, version: number, insuranceMintPk: PublicKey): Promise<MangoSignatureStatus>
              • groupEdit(group: Group, admin?: PublicKey, fastListingAdmin?: PublicKey, securityAdmin?: PublicKey, testing?: number, version?: number, depositLimitQuote?: BN, feesPayWithMngo?: boolean, feesMngoBonusRate?: number, feesSwapMangoAccount?: PublicKey, feesMngoTokenIndex?: TokenIndex, feesExpiryInterval?: BN, allowedFastListingsPerInterval?: number, collateralFeeInterval?: BN): Promise<MangoSignatureStatus>
              • 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
                • Optional allowedFastListingsPerInterval: number
                • Optional collateralFeeInterval: BN

                Returns Promise<MangoSignatureStatus>

              • marginTrade(__namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }): Promise<MangoSignatureStatus>
              • Parameters

                • __namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }
                  • amountIn: number
                  • flashLoanType: FlashLoanType
                  • group: Group
                  • inputMintPk: PublicKey
                  • mangoAccount: MangoAccount
                  • outputMintPk: PublicKey
                  • userDefinedAlts: AddressLookupTableAccount[]
                  • userDefinedInstructions: TransactionInstruction[]

                Returns Promise<MangoSignatureStatus>

              • perpCancelOrderByClientOrderIdIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, clientOrderId: BN): Promise<TransactionInstruction>
              • perpConsumeEventsIx(group: Group, perpMarketIndex: PerpMarketIndex, accounts: PublicKey[], limit: number): Promise<TransactionInstruction>
              • perpCreateMarket(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, platformLiquidationFee: number): Promise<MangoSignatureStatus>
              • 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
                • platformLiquidationFee: number

                Returns Promise<MangoSignatureStatus>

              • perpPlaceOrderIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, price: number, quantity: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpPlaceOrderPeggedIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, priceOffset: number, quantity: number, pegLimit?: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpPlaceOrderPeggedV2Ix(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, priceOffset: number, quantity: number, pegLimit?: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, selfTradeBehavior?: PerpSelfTradeBehavior, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpUpdateFundingIx(group: Group, perpMarket: PerpMarket): Promise<TransactionInstruction>
              • sendAndConfirmTransaction(ixs: TransactionInstruction[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • sendAndConfirmTransaction(ixs: TransactionInstruction[], opts?: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • Parameters

                • ixs: TransactionInstruction[]
                • Optional opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • Parameters

                • ixs: TransactionInstruction[]
                • Optional opts: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • sendAndConfirmTransactionForGroup(group: Group, ixs: TransactionInstruction[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • sendAndConfirmTransactionForGroup(group: Group, ixs: TransactionInstruction[], opts?: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • ixs: TransactionInstruction[]
                • Optional opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • Parameters

                • group: Group
                • ixs: TransactionInstruction[]
                • Optional opts: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • serum3CancelAllOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, limit?: number): Promise<TransactionInstruction>
              • serum3CancelOrderByClientIdIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, clientOrderId: BN): Promise<TransactionInstruction>
              • serum3CancelOrderIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, side: Serum3Side, orderId: BN): Promise<TransactionInstruction>
              • serum3CloseOpenOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3CreateOpenOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3EditMarket(group: Group, serum3MarketIndex: MarketIndex, reduceOnly: null | boolean, forceClose: null | boolean, name: null | string, oraclePriceBand: null | number): Promise<MangoSignatureStatus>
              • serum3EditMarketIx(group: Group, serum3MarketIndex: MarketIndex, admin: PublicKey, reduceOnly: null | boolean, forceClose: null | boolean, name: null | string, oraclePriceBand: null | number): Promise<TransactionInstruction>
              • Parameters

                • group: Group
                • serum3MarketIndex: MarketIndex
                • admin: PublicKey
                • reduceOnly: null | boolean
                • forceClose: null | boolean
                • name: null | string
                • oraclePriceBand: null | number

                Returns Promise<TransactionInstruction>

              • serum3GetMarkets(group: Group, baseTokenIndex?: number, quoteTokenIndex?: number): Promise<Serum3Market[]>
              • serum3RegisterMarket(group: Group, serum3MarketExternalPk: PublicKey, baseBank: Bank, quoteBank: Bank, marketIndex: number, name: string, oraclePriceBand: number): Promise<MangoSignatureStatus>
              • serum3SettleFundsIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3SettleFundsV2Ix(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • tcsStopLossOnBorrow(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsStopLossOnBorrowIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxBuyUi: null | number
                • pricePremium: null | number
                • allowMargin: null | boolean
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsStopLossOnDeposit(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsStopLossOnDepositIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxSell: null | number
                • pricePremium: null | number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsTakeProfitOnBorrow(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsTakeProfitOnBorrowIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxBuyUi: null | number
                • pricePremium: null | number
                • allowMargin: null | boolean
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsTakeProfitOnDeposit(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsTakeProfitOnDepositIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxSell: null | number
                • pricePremium: null | number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCancelIx(group: Group, account: MangoAccount, tokenConditionalSwapId: BN): Promise<TransactionInstruction>
              • tokenConditionalSwapCreate(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimitNativeNative: number, upperLimitNativeNative: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", pricePremium: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimitNativeNative: number
                • upperLimitNativeNative: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • pricePremium: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreateIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimitNativeNative: number, upperLimitNativeNative: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", pricePremium: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimitNativeNative: number
                • upperLimitNativeNative: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • pricePremium: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreateLinearAuction(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, priceStart: number, priceEnd: number, maxBuy: number, maxSell: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, displayPriceInSellTokenPerBuyToken: boolean, startTimestamp: number, durationSeconds: number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • priceStart: number
                • priceEnd: number
                • maxBuy: number
                • maxSell: number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • displayPriceInSellTokenPerBuyToken: boolean
                • startTimestamp: number
                • durationSeconds: number
                • expiryTimestamp: null | number

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreateLinearAuctionIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, priceStart: number, priceEnd: number, maxBuy: number, maxSell: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, displayPriceInSellTokenPerBuyToken: boolean, startTimestamp: number, durationSeconds: number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • priceStart: number
                • priceEnd: number
                • maxBuy: number
                • maxSell: number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • displayPriceInSellTokenPerBuyToken: boolean
                • startTimestamp: number
                • durationSeconds: number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreatePremiumAuction(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimit: number, upperLimit: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", maxPricePremiumPercent: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean, durationSeconds: number): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimit: number
                • upperLimit: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • maxPricePremiumPercent: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean
                • durationSeconds: number

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreatePremiumAuctionIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimit: number, upperLimit: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", maxPricePremiumPercent: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean, durationSeconds: number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimit: number
                • upperLimit: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • maxPricePremiumPercent: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean
                • durationSeconds: number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreateRawIx(group: Group, account: MangoAccount, buyMintPk: PublicKey, sellMintPk: PublicKey, maxBuy: BN, maxSell: BN, expiryTimestamp: null | number, priceLowerLimit: number, priceUpperLimit: number, pricePremiumRate: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, priceDisplayStyle: TokenConditionalSwapDisplayPriceStyle, intention: TokenConditionalSwapIntention): Promise<TransactionInstruction[]>
              • tokenConditionalSwapTriggerIx(group: Group, liqee: MangoAccount, liqor: MangoAccount, tokenConditionalSwapId: BN, maxBuyTokenToLiqee: number, maxSellTokenToLiqor: number): Promise<TransactionInstruction>
              • tokenRegister(group: Group, mintPk: PublicKey, oraclePk: PublicKey, fallbackOraclePk: PublicKey, tokenIndex: number, name: string, params: TokenRegisterParams): Promise<MangoSignatureStatus>
              • tokenRegisterTrustless(group: Group, mintPk: PublicKey, oraclePk: PublicKey, tokenIndex: number, name: string): Promise<MangoSignatureStatus>
              • tokenUpdateIndexAndRateIx(group: Group, mintPk: PublicKey): Promise<TransactionInstruction>
              • getBanksForGroup(group: Group): Promise<Bank[]>
              • getGroup(groupPk: PublicKey): Promise<Group>
              • getGroupForCreator(creatorPk: PublicKey, groupNum: number): Promise<Group>
              • getGroupsForCreator(creatorPk: PublicKey): Promise<Group[]>
              • getIds(groupPk: PublicKey): Promise<undefined | Id>
              • getMangoAccount(mangoAccountPk: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount>
              • getMangoAccountForOwner(group: Group, ownerPk: PublicKey, accountNumber: number, loadSerum3Oo?: boolean): Promise<undefined | MangoAccount>
              • getMangoAccountFromAi(mangoAccountPk: PublicKey, ai: AccountInfo<Buffer>): MangoAccount
              • getMangoAccountFromPk(mangoAccountPk: PublicKey): Promise<MangoAccount>
              • getMangoAccountWithSlot(mangoAccountPk: PublicKey, loadSerum3Oo?: boolean): Promise<undefined | { slot: number; value: MangoAccount }>
              • getMangoAccountsForDelegate(group: Group, delegate: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount[]>
              • getMangoAccountsForOwner(group: Group, ownerPk: PublicKey, loadSerum3Oo?: boolean): Promise<MangoAccount[]>
              • groupCreate(groupNum: number, testing: boolean, version: number, insuranceMintPk: PublicKey): Promise<MangoSignatureStatus>
              • groupEdit(group: Group, admin?: PublicKey, fastListingAdmin?: PublicKey, securityAdmin?: PublicKey, testing?: number, version?: number, depositLimitQuote?: BN, feesPayWithMngo?: boolean, feesMngoBonusRate?: number, feesSwapMangoAccount?: PublicKey, feesMngoTokenIndex?: TokenIndex, feesExpiryInterval?: BN, allowedFastListingsPerInterval?: number, collateralFeeInterval?: BN): Promise<MangoSignatureStatus>
              • 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
                • Optional allowedFastListingsPerInterval: number
                • Optional collateralFeeInterval: BN

                Returns Promise<MangoSignatureStatus>

              • marginTrade(__namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }): Promise<MangoSignatureStatus>
              • Parameters

                • __namedParameters: { amountIn: number; flashLoanType: FlashLoanType; group: Group; inputMintPk: PublicKey; mangoAccount: MangoAccount; outputMintPk: PublicKey; userDefinedAlts: AddressLookupTableAccount[]; userDefinedInstructions: TransactionInstruction[] }
                  • amountIn: number
                  • flashLoanType: FlashLoanType
                  • group: Group
                  • inputMintPk: PublicKey
                  • mangoAccount: MangoAccount
                  • outputMintPk: PublicKey
                  • userDefinedAlts: AddressLookupTableAccount[]
                  • userDefinedInstructions: TransactionInstruction[]

                Returns Promise<MangoSignatureStatus>

              • perpCancelOrderByClientOrderIdIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, clientOrderId: BN): Promise<TransactionInstruction>
              • perpConsumeEventsIx(group: Group, perpMarketIndex: PerpMarketIndex, accounts: PublicKey[], limit: number): Promise<TransactionInstruction>
              • perpCreateMarket(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, platformLiquidationFee: number): Promise<MangoSignatureStatus>
              • 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
                • platformLiquidationFee: number

                Returns Promise<MangoSignatureStatus>

              • perpPlaceOrderIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, price: number, quantity: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpPlaceOrderPeggedIx(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, priceOffset: number, quantity: number, pegLimit?: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpPlaceOrderPeggedV2Ix(group: Group, mangoAccount: MangoAccount, perpMarketIndex: PerpMarketIndex, side: PerpOrderSide, priceOffset: number, quantity: number, pegLimit?: number, maxQuoteQuantity?: number, clientOrderId?: number, orderType?: PerpOrderType, selfTradeBehavior?: PerpSelfTradeBehavior, reduceOnly?: boolean, expiryTimestamp?: number, limit?: number): Promise<TransactionInstruction>
              • perpUpdateFundingIx(group: Group, perpMarket: PerpMarket): Promise<TransactionInstruction>
              • sendAndConfirmTransaction(ixs: TransactionInstruction[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • sendAndConfirmTransaction(ixs: TransactionInstruction[], opts?: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • Parameters

                • ixs: TransactionInstruction[]
                • Optional opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • Parameters

                • ixs: TransactionInstruction[]
                • Optional opts: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • sendAndConfirmTransactionForGroup(group: Group, ixs: TransactionInstruction[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • sendAndConfirmTransactionForGroup(group: Group, ixs: TransactionInstruction[], opts?: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • ixs: TransactionInstruction[]
                • Optional opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • Parameters

                • group: Group
                • ixs: TransactionInstruction[]
                • Optional opts: { confirmInBackground: true } & Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>

                Returns Promise<MangoSignatureStatus>

              • serum3CancelAllOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, limit?: number): Promise<TransactionInstruction>
              • serum3CancelOrderByClientIdIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, clientOrderId: BN): Promise<TransactionInstruction>
              • serum3CancelOrderIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey, side: Serum3Side, orderId: BN): Promise<TransactionInstruction>
              • serum3CloseOpenOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3CreateOpenOrdersIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3EditMarket(group: Group, serum3MarketIndex: MarketIndex, reduceOnly: null | boolean, forceClose: null | boolean, name: null | string, oraclePriceBand: null | number): Promise<MangoSignatureStatus>
              • serum3EditMarketIx(group: Group, serum3MarketIndex: MarketIndex, admin: PublicKey, reduceOnly: null | boolean, forceClose: null | boolean, name: null | string, oraclePriceBand: null | number): Promise<TransactionInstruction>
              • Parameters

                • group: Group
                • serum3MarketIndex: MarketIndex
                • admin: PublicKey
                • reduceOnly: null | boolean
                • forceClose: null | boolean
                • name: null | string
                • oraclePriceBand: null | number

                Returns Promise<TransactionInstruction>

              • serum3GetMarkets(group: Group, baseTokenIndex?: number, quoteTokenIndex?: number): Promise<Serum3Market[]>
              • serum3RegisterMarket(group: Group, serum3MarketExternalPk: PublicKey, baseBank: Bank, quoteBank: Bank, marketIndex: number, name: string, oraclePriceBand: number): Promise<MangoSignatureStatus>
              • serum3SettleFundsIx(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • serum3SettleFundsV2Ix(group: Group, mangoAccount: MangoAccount, externalMarketPk: PublicKey): Promise<TransactionInstruction>
              • tcsStopLossOnBorrow(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsStopLossOnBorrowIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxBuyUi: null | number
                • pricePremium: null | number
                • allowMargin: null | boolean
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsStopLossOnDeposit(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsStopLossOnDepositIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxSell: null | number
                • pricePremium: null | number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsTakeProfitOnBorrow(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsTakeProfitOnBorrowIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxBuyUi: null | number, pricePremium: null | number, allowMargin: null | boolean, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxBuyUi: null | number
                • pricePremium: null | number
                • allowMargin: null | boolean
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tcsTakeProfitOnDeposit(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • tcsTakeProfitOnDepositIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, thresholdPrice: number, thresholdPriceInSellPerBuyToken: boolean, maxSell: null | number, pricePremium: null | number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • thresholdPrice: number
                • thresholdPriceInSellPerBuyToken: boolean
                • maxSell: null | number
                • pricePremium: null | number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCancelIx(group: Group, account: MangoAccount, tokenConditionalSwapId: BN): Promise<TransactionInstruction>
              • tokenConditionalSwapCreate(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimitNativeNative: number, upperLimitNativeNative: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", pricePremium: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimitNativeNative: number
                • upperLimitNativeNative: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • pricePremium: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreateIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimitNativeNative: number, upperLimitNativeNative: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", pricePremium: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimitNativeNative: number
                • upperLimitNativeNative: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • pricePremium: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreateLinearAuction(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, priceStart: number, priceEnd: number, maxBuy: number, maxSell: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, displayPriceInSellTokenPerBuyToken: boolean, startTimestamp: number, durationSeconds: number, expiryTimestamp: null | number): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • priceStart: number
                • priceEnd: number
                • maxBuy: number
                • maxSell: number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • displayPriceInSellTokenPerBuyToken: boolean
                • startTimestamp: number
                • durationSeconds: number
                • expiryTimestamp: null | number

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreateLinearAuctionIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, priceStart: number, priceEnd: number, maxBuy: number, maxSell: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, displayPriceInSellTokenPerBuyToken: boolean, startTimestamp: number, durationSeconds: number, expiryTimestamp: null | number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • priceStart: number
                • priceEnd: number
                • maxBuy: number
                • maxSell: number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • displayPriceInSellTokenPerBuyToken: boolean
                • startTimestamp: number
                • durationSeconds: number
                • expiryTimestamp: null | number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreatePremiumAuction(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimit: number, upperLimit: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", maxPricePremiumPercent: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean, durationSeconds: number): Promise<MangoSignatureStatus>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimit: number
                • upperLimit: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • maxPricePremiumPercent: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean
                • durationSeconds: number

                Returns Promise<MangoSignatureStatus>

              • tokenConditionalSwapCreatePremiumAuctionIx(group: Group, account: MangoAccount, sellBank: Bank, buyBank: Bank, lowerLimit: number, upperLimit: number, maxBuy: number, maxSell: number, tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow", maxPricePremiumPercent: null | number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, expiryTimestamp: null | number, displayPriceInSellTokenPerBuyToken: boolean, durationSeconds: number): Promise<TransactionInstruction[]>
              • Parameters

                • group: Group
                • account: MangoAccount
                • sellBank: Bank
                • buyBank: Bank
                • lowerLimit: number
                • upperLimit: number
                • maxBuy: number
                • maxSell: number
                • tcsIntention: null | "TakeProfitOnDeposit" | "StopLossOnDeposit" | "TakeProfitOnBorrow" | "StopLossOnBorrow"
                • maxPricePremiumPercent: null | number
                • allowCreatingDeposits: boolean
                • allowCreatingBorrows: boolean
                • expiryTimestamp: null | number
                • displayPriceInSellTokenPerBuyToken: boolean
                • durationSeconds: number

                Returns Promise<TransactionInstruction[]>

              • tokenConditionalSwapCreateRawIx(group: Group, account: MangoAccount, buyMintPk: PublicKey, sellMintPk: PublicKey, maxBuy: BN, maxSell: BN, expiryTimestamp: null | number, priceLowerLimit: number, priceUpperLimit: number, pricePremiumRate: number, allowCreatingDeposits: boolean, allowCreatingBorrows: boolean, priceDisplayStyle: TokenConditionalSwapDisplayPriceStyle, intention: TokenConditionalSwapIntention): Promise<TransactionInstruction[]>
              • tokenConditionalSwapTriggerIx(group: Group, liqee: MangoAccount, liqor: MangoAccount, tokenConditionalSwapId: BN, maxBuyTokenToLiqee: number, maxSellTokenToLiqor: number): Promise<TransactionInstruction>
              • tokenRegister(group: Group, mintPk: PublicKey, oraclePk: PublicKey, fallbackOraclePk: PublicKey, tokenIndex: number, name: string, params: TokenRegisterParams): Promise<MangoSignatureStatus>
              • tokenRegisterTrustless(group: Group, mintPk: PublicKey, oraclePk: PublicKey, tokenIndex: number, name: string): Promise<MangoSignatureStatus>
              • tokenUpdateIndexAndRateIx(group: Group, mintPk: PublicKey): Promise<TransactionInstruction>
              • tokenWithdrawNativeIx(group: Group, mangoAccount: MangoAccount, mintPk: PublicKey, nativeAmount: BN, allowBorrow: boolean): Promise<TransactionInstruction[]>
              • connect(provider: default, cluster: Cluster, programId: PublicKey, opts?: MangoClientOptions): MangoClient
              • tokenWithdrawNativeIx(group: Group, mangoAccount: MangoAccount, mintPk: PublicKey, nativeAmount: BN, allowBorrow: boolean): Promise<TransactionInstruction[]>
              • connect(provider: default, cluster: Cluster, programId: PublicKey, opts?: MangoClientOptions): MangoClient
              • Connect with defaults,

                • random ephemeral keypair,
                • @@ -31,4 +31,4 @@ use forceClose flag

                • connects to mainnet-beta
                • uses well known program Id
                -

                Parameters

                • clusterUrl: string

                Returns MangoClient

              • connectForGroupName(provider: default, groupName: string): MangoClient

              Generated using TypeDoc

              \ No newline at end of file +

              Parameters

              Returns MangoClient

              Generated using TypeDoc

              \ No newline at end of file diff --git a/ts/client/classes/MangoError.html b/ts/client/classes/MangoError.html index 91f261176..5d3108a5e 100644 --- a/ts/client/classes/MangoError.html +++ b/ts/client/classes/MangoError.html @@ -1,4 +1,4 @@ -MangoError | @blockworks-foundation/mango-v4
              Options
              All
              • Public
              • Public/Protected
              • All
              Menu

              Hierarchy

              • Error
                • MangoError

              Index

              Constructors

              • new MangoError(__namedParameters: Object): MangoError

              Properties

              cause?: unknown
              message: string
              name: string
              stack?: string
              txid: string
              prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

              Type declaration

                • (err: Error, stackTraces: CallSite[]): any
                • +MangoError | @blockworks-foundation/mango-v4
                  Options
                  All
                  • Public
                  • Public/Protected
                  • All
                  Menu

                  Hierarchy

                  • Error
                    • MangoError

                  Index

                  Constructors

                  • new MangoError(__namedParameters: Object): MangoError

                  Properties

                  cause?: unknown
                  message: string
                  name: string
                  stack?: string
                  txid: string
                  prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

                  Type declaration

                  stackTraceLimit: number

                  Methods

                  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
                  • diff --git a/ts/client/classes/MintInfo.html b/ts/client/classes/MintInfo.html index a65fe13ee..3d6fe2db3 100644 --- a/ts/client/classes/MintInfo.html +++ b/ts/client/classes/MintInfo.html @@ -1 +1 @@ -MintInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • MintInfo

                    Index

                    Constructors

                    • new MintInfo(publicKey: PublicKey, group: PublicKey, tokenIndex: TokenIndex, mint: PublicKey, banks: PublicKey[], vaults: PublicKey[], oracle: PublicKey, registrationTime: BN, groupInsuranceFund: boolean): MintInfo

                    Properties

                    banks: PublicKey[]
                    group: PublicKey
                    groupInsuranceFund: boolean
                    mint: PublicKey
                    oracle: PublicKey
                    publicKey: PublicKey
                    registrationTime: BN
                    tokenIndex: TokenIndex
                    vaults: PublicKey[]

                    Methods

                    • firstBank(): PublicKey
                    • firstVault(): PublicKey
                    • toString(): string
                    • from(publicKey: PublicKey, obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }): MintInfo
                    • Parameters

                      • publicKey: PublicKey
                      • obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }
                        • banks: PublicKey[]
                        • group: PublicKey
                        • groupInsuranceFund: number
                        • mint: PublicKey
                        • oracle: PublicKey
                        • registrationTime: BN
                        • tokenIndex: number
                        • vaults: PublicKey[]

                      Returns MintInfo

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +MintInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • MintInfo

                    Index

                    Constructors

                    • new MintInfo(publicKey: PublicKey, group: PublicKey, tokenIndex: TokenIndex, mint: PublicKey, banks: PublicKey[], vaults: PublicKey[], oracle: PublicKey, registrationTime: BN, groupInsuranceFund: boolean): MintInfo

                    Properties

                    banks: PublicKey[]
                    group: PublicKey
                    groupInsuranceFund: boolean
                    mint: PublicKey
                    oracle: PublicKey
                    publicKey: PublicKey
                    registrationTime: BN
                    tokenIndex: TokenIndex
                    vaults: PublicKey[]

                    Methods

                    • firstBank(): PublicKey
                    • firstVault(): PublicKey
                    • toString(): string
                    • from(publicKey: PublicKey, obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }): MintInfo
                    • Parameters

                      • publicKey: PublicKey
                      • obj: { banks: PublicKey[]; group: PublicKey; groupInsuranceFund: number; mint: PublicKey; oracle: PublicKey; registrationTime: BN; tokenIndex: number; vaults: PublicKey[] }
                        • banks: PublicKey[]
                        • group: PublicKey
                        • groupInsuranceFund: number
                        • mint: PublicKey
                        • oracle: PublicKey
                        • registrationTime: BN
                        • tokenIndex: number
                        • vaults: PublicKey[]

                      Returns MintInfo

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/OracleConfigParams.html b/ts/client/classes/OracleConfigParams.html index 8838492d2..eeb25b1bd 100644 --- a/ts/client/classes/OracleConfigParams.html +++ b/ts/client/classes/OracleConfigParams.html @@ -1 +1 @@ -OracleConfigParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +OracleConfigParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpEventQueue.html b/ts/client/classes/PerpEventQueue.html index d928cf07d..f027ee771 100644 --- a/ts/client/classes/PerpEventQueue.html +++ b/ts/client/classes/PerpEventQueue.html @@ -1 +1 @@ -PerpEventQueue | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpEventQueue

                    Index

                    Constructors

                    Properties

                    count: number
                    head: number
                    rawEvents: (FillEvent | OutEvent | LiquidateEvent)[]
                    seqNum: BN
                    FILL_EVENT_TYPE: number = 0
                    LIQUIDATE_EVENT_TYPE: number = 2
                    OUT_EVENT_TYPE: number = 1

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpEventQueue | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpEventQueue

                    Index

                    Constructors

                    Properties

                    count: number
                    head: number
                    rawEvents: (FillEvent | OutEvent | LiquidateEvent)[]
                    seqNum: BN
                    FILL_EVENT_TYPE: number = 0
                    LIQUIDATE_EVENT_TYPE: number = 2
                    OUT_EVENT_TYPE: number = 1

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpMarket.html b/ts/client/classes/PerpMarket.html index b20808ea5..8b9c3ca92 100644 --- a/ts/client/classes/PerpMarket.html +++ b/ts/client/classes/PerpMarket.html @@ -1,12 +1,12 @@ -PerpMarket | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpMarket

                    Index

                    Constructors

                    • new PerpMarket(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, feesWithdrawn: BN, platformLiquidationFee: I80F48Dto, accruedLiquidationFees: I80F48Dto): PerpMarket

                    Properties

                    _asks: BookSide
                    _bids: BookSide
                    _oracleLastKnownDeviation: undefined | I80F48
                    _oracleLastUpdatedSlot: number
                    _oracleProvider: OracleProvider
                    _price: I80F48
                    _uiPrice: number
                    accruedLiquidationFees: I80F48
                    asks: PublicKey
                    baseDecimals: number
                    baseLiquidationFee: I80F48
                    baseLotSize: BN
                    baseLotsToUiConverter: number
                    bids: PublicKey
                    eventQueue: PublicKey
                    feePenalty: number
                    feesAccrued: I80F48
                    feesSettled: I80F48
                    feesWithdrawn: BN
                    forceClose: boolean
                    fundingLastUpdated: BN
                    group: PublicKey
                    groupInsuranceFund: boolean
                    impactQuantity: BN
                    initBaseAssetWeight: I80F48
                    initBaseLiabWeight: I80F48
                    initOverallAssetWeight: I80F48
                    longFunding: I80F48
                    maintBaseAssetWeight: I80F48
                    maintBaseLiabWeight: I80F48
                    maintOverallAssetWeight: I80F48
                    makerFee: I80F48
                    maxFunding: I80F48
                    minFunding: I80F48
                    name: string
                    openInterest: BN
                    oracle: PublicKey
                    oracleConfig: OracleConfig
                    perpMarketIndex: PerpMarketIndex
                    platformLiquidationFee: I80F48
                    positivePnlLiquidationFee: I80F48
                    priceLotsToUiConverter: number
                    publicKey: PublicKey
                    quoteLotSize: BN
                    quoteLotsToUiConverter: number
                    reduceOnly: boolean
                    registrationTime: BN
                    seqNum: BN
                    settleFeeAmountThreshold: number
                    settleFeeFlat: number
                    settleFeeFractionLowHealth: number
                    settlePnlLimitFactor: number
                    settlePnlLimitWindowSizeTs: BN
                    settleTokenIndex: TokenIndex
                    shortFunding: I80F48
                    stablePriceModel: StablePriceModel
                    takerFee: I80F48

                    Accessors

                    • get minOrderSize(): number
                    • get oracleLastUpdatedSlot(): number
                    • get tickSize(): number
                    • get uiPrice(): number

                    Methods

                    • baseLotsToUi(quantity: BN): number
                    • insidePriceLimit(side: PerpOrderSide, orderPrice: number): boolean
                    • isOracleStaleOrUnconfident(nowSlot: number): boolean
                    • priceLotsToNative(price: BN): I80F48
                    • priceLotsToUi(price: BN): number
                    • priceNativeToUi(price: number): number
                    • quoteLotsToUi(quantity: BN): number
                    • toString(): string
                    • uiBaseToLots(quantity: number): BN
                    • uiPriceToLots(price: number): BN
                    • uiQuoteToLots(uiQuote: number): BN
                    • from(publicKey: PublicKey, obj: { accruedLiquidationFees: I80F48Dto; asks: PublicKey; baseDecimals: number; baseLiquidationFee: I80F48Dto; baseLotSize: BN; bids: PublicKey; eventQueue: PublicKey; feePenalty: number; feesAccrued: I80F48Dto; feesSettled: I80F48Dto; feesWithdrawn: BN; 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; platformLiquidationFee: I80F48Dto; 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 }): PerpMarket
                    • Parameters

                      • publicKey: PublicKey
                      • obj: { accruedLiquidationFees: I80F48Dto; asks: PublicKey; baseDecimals: number; baseLiquidationFee: I80F48Dto; baseLotSize: BN; bids: PublicKey; eventQueue: PublicKey; feePenalty: number; feesAccrued: I80F48Dto; feesSettled: I80F48Dto; feesWithdrawn: BN; 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; platformLiquidationFee: I80F48Dto; 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 }
                        • accruedLiquidationFees: I80F48Dto
                        • asks: PublicKey
                        • baseDecimals: number
                        • baseLiquidationFee: I80F48Dto
                        • baseLotSize: BN
                        • bids: PublicKey
                        • eventQueue: PublicKey
                        • feePenalty: number
                        • feesAccrued: I80F48Dto
                        • feesSettled: I80F48Dto
                        • feesWithdrawn: BN
                        • 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
                        • platformLiquidationFee: I80F48Dto
                        • 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

                      Returns PerpMarket

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpOo.html b/ts/client/classes/PerpOo.html index 513e1e379..1cf2da19c 100644 --- a/ts/client/classes/PerpOo.html +++ b/ts/client/classes/PerpOo.html @@ -1 +1 @@ -PerpOo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOo

                    Index

                    Constructors

                    • new PerpOo(sideAndTree: any, orderMarket: number, clientId: BN, id: BN): PerpOo

                    Properties

                    clientId: BN
                    id: BN
                    orderMarket: number
                    sideAndTree: any
                    OrderMarketUnset: number = 65535

                    Methods

                    • isActive(): boolean

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpOo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOo

                    Index

                    Constructors

                    • new PerpOo(sideAndTree: any, orderMarket: number, clientId: BN, id: BN): PerpOo

                    Properties

                    clientId: BN
                    id: BN
                    orderMarket: number
                    sideAndTree: any
                    OrderMarketUnset: number = 65535

                    Methods

                    • isActive(): boolean

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpOoDto.html b/ts/client/classes/PerpOoDto.html index 59efbb2dc..07061df96 100644 --- a/ts/client/classes/PerpOoDto.html +++ b/ts/client/classes/PerpOoDto.html @@ -1 +1 @@ -PerpOoDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOoDto

                    Index

                    Constructors

                    • new PerpOoDto(sideAndTree: any, market: number, clientId: BN, id: BN): PerpOoDto

                    Properties

                    clientId: BN
                    id: BN
                    market: number
                    sideAndTree: any

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpOoDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOoDto

                    Index

                    Constructors

                    • new PerpOoDto(sideAndTree: any, market: number, clientId: BN, id: BN): PerpOoDto

                    Properties

                    clientId: BN
                    id: BN
                    market: number
                    sideAndTree: any

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpOrder.html b/ts/client/classes/PerpOrder.html index 229f178de..9abbd6027 100644 --- a/ts/client/classes/PerpOrder.html +++ b/ts/client/classes/PerpOrder.html @@ -1 +1 @@ -PerpOrder | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOrder

                    Index

                    Constructors

                    • new PerpOrder(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, isOraclePegged?: boolean, orderType: PerpOrderType, oraclePeggedProperties?: OraclePeggedProperties): PerpOrder
                    • 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

                    expiryTimestamp: BN
                    feeTier: 0
                    isExpired: boolean = false
                    isOraclePegged: boolean = false
                    openOrdersSlot: number
                    oraclePeggedProperties?: OraclePeggedProperties
                    orderId: BN
                    orderType: PerpOrderType
                    owner: PublicKey
                    perpMarketIndex: number
                    priceLots: BN
                    seqNum: BN
                    sizeLots: BN
                    timestamp: BN
                    uiPrice: number
                    uiSize: number

                    Accessors

                    • get price(): number
                    • get size(): number

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpOrder | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpOrder

                    Index

                    Constructors

                    • new PerpOrder(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, isOraclePegged?: boolean, orderType: PerpOrderType, oraclePeggedProperties?: OraclePeggedProperties): PerpOrder
                    • 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

                    expiryTimestamp: BN
                    feeTier: 0
                    isExpired: boolean = false
                    isOraclePegged: boolean = false
                    openOrdersSlot: number
                    oraclePeggedProperties?: OraclePeggedProperties
                    orderId: BN
                    orderType: PerpOrderType
                    owner: PublicKey
                    perpMarketIndex: number
                    priceLots: BN
                    seqNum: BN
                    sizeLots: BN
                    timestamp: BN
                    uiPrice: number
                    uiSize: number

                    Accessors

                    • get price(): number
                    • get size(): number

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpPosition.html b/ts/client/classes/PerpPosition.html index 133333488..9d53531de 100644 --- a/ts/client/classes/PerpPosition.html +++ b/ts/client/classes/PerpPosition.html @@ -1,9 +1,9 @@ -PerpPosition | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpPosition

                    Index

                    Constructors

                    • new PerpPosition(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, deprecatedRealizedTradePnlNative: I80F48, oneshotSettlePnlAllowance: I80F48, recurringSettlePnlAllowance: BN, realizedPnlForPositionNative: I80F48): PerpPosition
                    • 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
                      • deprecatedRealizedTradePnlNative: I80F48
                      • oneshotSettlePnlAllowance: I80F48
                      • recurringSettlePnlAllowance: BN
                      • realizedPnlForPositionNative: I80F48

                      Returns PerpPosition

                    Properties

                    asksBaseLots: BN
                    avgEntryPricePerBaseLot: number
                    basePositionLots: BN
                    bidsBaseLots: BN
                    cumulativeLongFunding: number
                    cumulativeShortFunding: number
                    deprecatedRealizedTradePnlNative: I80F48
                    longSettledFunding: I80F48
                    makerVolume: BN
                    marketIndex: PerpMarketIndex
                    oneshotSettlePnlAllowance: I80F48
                    perpSpotTransfers: BN
                    quotePositionNative: I80F48
                    quoteRunningNative: BN
                    realizedPnlForPositionNative: I80F48
                    recurringSettlePnlAllowance: BN
                    settlePnlLimitSettledInCurrentWindowNative: BN
                    settlePnlLimitWindow: number
                    shortSettledFunding: I80F48
                    takerBaseLots: BN
                    takerQuoteLots: BN
                    takerVolume: BN
                    PerpMarketIndexUnset: number = 65535

                    Methods

                    • availableSettleLimit(perpMarket: PerpMarket): [BN, BN]
                    • cumulativePnlOverPositionLifetimeUi(perpMarket: PerpMarket): number
                    • getAverageEntryPriceUi(perpMarket: PerpMarket): number
                    • getBasePositionUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
                    • getBreakEvenPriceUi(perpMarket: PerpMarket): number
                    • getNotionalValueUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
                    • getQuotePositionUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
                    • getRealizedPnlUi(): number
                    • getUnRealizedPnlUi(perpMarket: PerpMarket): number
                    • getUnsettledFundingUi(perpMarket: PerpMarket): number
                    • hasOpenOrders(): boolean
                    • isActive(): boolean

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/PerpPositionDto.html b/ts/client/classes/PerpPositionDto.html index b9f62d02e..53f05459d 100644 --- a/ts/client/classes/PerpPositionDto.html +++ b/ts/client/classes/PerpPositionDto.html @@ -1 +1 @@ -PerpPositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpPositionDto

                    Index

                    Constructors

                    • new PerpPositionDto(marketIndex: number, settlePnlLimitWindow: number, settlePnlLimitSettledInCurrentWindowNative: BN, basePositionLots: BN, quotePositionNative: { 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, deprecatedRealizedTradePnlNative: I80F48Dto, oneshotSettlePnlAllowance: I80F48Dto, recurringSettlePnlAllowance: BN, realizedPnlForPositionNative: I80F48Dto): PerpPositionDto
                    • 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
                      • deprecatedRealizedTradePnlNative: I80F48Dto
                      • oneshotSettlePnlAllowance: I80F48Dto
                      • recurringSettlePnlAllowance: BN
                      • realizedPnlForPositionNative: I80F48Dto

                      Returns PerpPositionDto

                    Properties

                    asksBaseLots: BN
                    avgEntryPricePerBaseLot: number
                    basePositionLots: BN
                    bidsBaseLots: BN
                    cumulativeLongFunding: number
                    cumulativeShortFunding: number
                    deprecatedRealizedTradePnlNative: I80F48Dto
                    longSettledFunding: I80F48Dto
                    makerVolume: BN
                    marketIndex: number
                    oneshotSettlePnlAllowance: I80F48Dto
                    perpSpotTransfers: BN
                    quotePositionNative: { val: BN }

                    Type declaration

                    • val: BN
                    quoteRunningNative: BN
                    realizedPnlForPositionNative: I80F48Dto
                    recurringSettlePnlAllowance: BN
                    settlePnlLimitSettledInCurrentWindowNative: BN
                    settlePnlLimitWindow: number
                    shortSettledFunding: I80F48Dto
                    takerBaseLots: BN
                    takerQuoteLots: BN
                    takerVolume: BN

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpPositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpPositionDto

                    Index

                    Constructors

                    • new PerpPositionDto(marketIndex: number, settlePnlLimitWindow: number, settlePnlLimitSettledInCurrentWindowNative: BN, basePositionLots: BN, quotePositionNative: { 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, deprecatedRealizedTradePnlNative: I80F48Dto, oneshotSettlePnlAllowance: I80F48Dto, recurringSettlePnlAllowance: BN, realizedPnlForPositionNative: I80F48Dto): PerpPositionDto
                    • 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
                      • deprecatedRealizedTradePnlNative: I80F48Dto
                      • oneshotSettlePnlAllowance: I80F48Dto
                      • recurringSettlePnlAllowance: BN
                      • realizedPnlForPositionNative: I80F48Dto

                      Returns PerpPositionDto

                    Properties

                    asksBaseLots: BN
                    avgEntryPricePerBaseLot: number
                    basePositionLots: BN
                    bidsBaseLots: BN
                    cumulativeLongFunding: number
                    cumulativeShortFunding: number
                    deprecatedRealizedTradePnlNative: I80F48Dto
                    longSettledFunding: I80F48Dto
                    makerVolume: BN
                    marketIndex: number
                    oneshotSettlePnlAllowance: I80F48Dto
                    perpSpotTransfers: BN
                    quotePositionNative: { val: BN }

                    Type declaration

                    • val: BN
                    quoteRunningNative: BN
                    realizedPnlForPositionNative: I80F48Dto
                    recurringSettlePnlAllowance: BN
                    settlePnlLimitSettledInCurrentWindowNative: BN
                    settlePnlLimitWindow: number
                    shortSettledFunding: I80F48Dto
                    takerBaseLots: BN
                    takerQuoteLots: BN
                    takerVolume: BN

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/Serum3Market.html b/ts/client/classes/Serum3Market.html index 9c5d30b72..dbfa4343f 100644 --- a/ts/client/classes/Serum3Market.html +++ b/ts/client/classes/Serum3Market.html @@ -1,5 +1,5 @@ -Serum3Market | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Serum3Market

                    Index

                    Constructors

                    • new Serum3Market(publicKey: PublicKey, group: PublicKey, baseTokenIndex: TokenIndex, quoteTokenIndex: TokenIndex, name: number[], serumProgram: PublicKey, serumMarketExternal: PublicKey, marketIndex: MarketIndex, registrationTime: BN, reduceOnly: boolean, forceClose: boolean, oraclePriceBand: number): Serum3Market
                    • Parameters

                      • publicKey: PublicKey
                      • group: PublicKey
                      • baseTokenIndex: TokenIndex
                      • quoteTokenIndex: TokenIndex
                      • name: number[]
                      • serumProgram: PublicKey
                      • serumMarketExternal: PublicKey
                      • marketIndex: MarketIndex
                      • registrationTime: BN
                      • reduceOnly: boolean
                      • forceClose: boolean
                      • oraclePriceBand: number

                      Returns Serum3Market

                    Properties

                    baseTokenIndex: TokenIndex
                    forceClose: boolean
                    group: PublicKey
                    marketIndex: MarketIndex
                    name: string
                    oraclePriceBand: number
                    publicKey: PublicKey
                    quoteTokenIndex: TokenIndex
                    reduceOnly: boolean
                    registrationTime: BN
                    serumMarketExternal: PublicKey
                    serumProgram: PublicKey

                    Methods

                    • computePriceForMarketOrderOfSize(client: MangoClient, group: Group, size: number, side: "buy" | "sell"): Promise<number>
                    • findOoPda(programId: PublicKey, mangoAccount: PublicKey): Promise<PublicKey>
                    • getFeeRates(taker?: boolean): number
                    • maxAskLeverage(group: Group): number
                    • from(publicKey: PublicKey, obj: { baseTokenIndex: number; forceClose: number; group: PublicKey; marketIndex: number; name: number[]; oraclePriceBand: number; quoteTokenIndex: number; reduceOnly: number; registrationTime: BN; serumMarketExternal: PublicKey; serumProgram: PublicKey }): Serum3Market
                    • Parameters

                      • publicKey: PublicKey
                      • obj: { baseTokenIndex: number; forceClose: number; group: PublicKey; marketIndex: number; name: number[]; oraclePriceBand: number; quoteTokenIndex: number; reduceOnly: number; registrationTime: BN; serumMarketExternal: PublicKey; serumProgram: PublicKey }
                        • baseTokenIndex: number
                        • forceClose: number
                        • group: PublicKey
                        • marketIndex: number
                        • name: number[]
                        • oraclePriceBand: number
                        • quoteTokenIndex: number
                        • reduceOnly: number
                        • registrationTime: BN
                        • serumMarketExternal: PublicKey
                        • serumProgram: PublicKey

                      Returns Serum3Market

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/Serum3Orders.html b/ts/client/classes/Serum3Orders.html index 15730d8ca..6aa8690e9 100644 --- a/ts/client/classes/Serum3Orders.html +++ b/ts/client/classes/Serum3Orders.html @@ -1 +1 @@ -Serum3Orders | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Serum3Orders

                    Index

                    Constructors

                    • new Serum3Orders(openOrders: PublicKey, marketIndex: MarketIndex, baseTokenIndex: TokenIndex, quoteTokenIndex: TokenIndex, highestPlacedBidInv: number, lowestPlacedAsk: number): Serum3Orders

                    Properties

                    baseTokenIndex: TokenIndex
                    highestPlacedBidInv: number
                    lowestPlacedAsk: number
                    marketIndex: MarketIndex
                    openOrders: PublicKey
                    quoteTokenIndex: TokenIndex
                    Serum3MarketIndexUnset: number = 65535

                    Methods

                    • isActive(): boolean

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Serum3Orders | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Serum3Orders

                    Index

                    Constructors

                    • new Serum3Orders(openOrders: PublicKey, marketIndex: MarketIndex, baseTokenIndex: TokenIndex, quoteTokenIndex: TokenIndex, highestPlacedBidInv: number, lowestPlacedAsk: number): Serum3Orders

                    Properties

                    baseTokenIndex: TokenIndex
                    highestPlacedBidInv: number
                    lowestPlacedAsk: number
                    marketIndex: MarketIndex
                    openOrders: PublicKey
                    quoteTokenIndex: TokenIndex
                    Serum3MarketIndexUnset: number = 65535

                    Methods

                    • isActive(): boolean

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/Serum3PositionDto.html b/ts/client/classes/Serum3PositionDto.html index d3affc2a9..8e6d47045 100644 --- a/ts/client/classes/Serum3PositionDto.html +++ b/ts/client/classes/Serum3PositionDto.html @@ -1 +1 @@ -Serum3PositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Serum3PositionDto

                    Index

                    Constructors

                    • new Serum3PositionDto(openOrders: PublicKey, marketIndex: number, baseBorrowsWithoutFee: BN, quoteBorrowsWithoutFee: BN, baseTokenIndex: number, quoteTokenIndex: number, highestPlacedBidInv: number, lowestPlacedAsk: number, reserved: number[]): Serum3PositionDto

                    Properties

                    baseBorrowsWithoutFee: BN
                    baseTokenIndex: number
                    highestPlacedBidInv: number
                    lowestPlacedAsk: number
                    marketIndex: number
                    openOrders: PublicKey
                    quoteBorrowsWithoutFee: BN
                    quoteTokenIndex: number
                    reserved: number[]

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Serum3PositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Serum3PositionDto

                    Index

                    Constructors

                    • new Serum3PositionDto(openOrders: PublicKey, marketIndex: number, baseBorrowsWithoutFee: BN, quoteBorrowsWithoutFee: BN, baseTokenIndex: number, quoteTokenIndex: number, highestPlacedBidInv: number, lowestPlacedAsk: number, reserved: number[]): Serum3PositionDto

                    Properties

                    baseBorrowsWithoutFee: BN
                    baseTokenIndex: number
                    highestPlacedBidInv: number
                    lowestPlacedAsk: number
                    marketIndex: number
                    openOrders: PublicKey
                    quoteBorrowsWithoutFee: BN
                    quoteTokenIndex: number
                    reserved: number[]

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/StubOracle.html b/ts/client/classes/StubOracle.html index 705a40030..26df79654 100644 --- a/ts/client/classes/StubOracle.html +++ b/ts/client/classes/StubOracle.html @@ -1 +1 @@ -StubOracle | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • StubOracle

                    Index

                    Constructors

                    • new StubOracle(publicKey: PublicKey, group: PublicKey, mint: PublicKey, price: I80F48Dto, lastUpdateTs: BN, lastUpdateSlot: BN, deviation: I80F48Dto): StubOracle

                    Properties

                    deviation: I80F48
                    group: PublicKey
                    lastUpdateSlot: BN
                    lastUpdateTs: BN
                    mint: PublicKey
                    price: I80F48
                    publicKey: PublicKey

                    Methods

                    • from(publicKey: PublicKey, obj: { deviation: I80F48Dto; group: PublicKey; lastUpdateSlot: BN; lastUpdateTs: BN; mint: PublicKey; price: I80F48Dto }): StubOracle

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +StubOracle | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • StubOracle

                    Index

                    Constructors

                    • new StubOracle(publicKey: PublicKey, group: PublicKey, mint: PublicKey, price: I80F48Dto, lastUpdateTs: BN, lastUpdateSlot: BN, deviation: I80F48Dto): StubOracle

                    Properties

                    deviation: I80F48
                    group: PublicKey
                    lastUpdateSlot: BN
                    lastUpdateTs: BN
                    mint: PublicKey
                    price: I80F48
                    publicKey: PublicKey

                    Methods

                    • from(publicKey: PublicKey, obj: { deviation: I80F48Dto; group: PublicKey; lastUpdateSlot: BN; lastUpdateTs: BN; mint: PublicKey; price: I80F48Dto }): StubOracle

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/TokenConditionalSwap.html b/ts/client/classes/TokenConditionalSwap.html index 2475cad1f..e838c4a8c 100644 --- a/ts/client/classes/TokenConditionalSwap.html +++ b/ts/client/classes/TokenConditionalSwap.html @@ -1 +1 @@ -TokenConditionalSwap | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenConditionalSwap

                    Index

                    Constructors

                    Properties

                    allowCreatingBorrows: boolean
                    allowCreatingDeposits: boolean
                    bought: BN
                    buyTokenIndex: TokenIndex
                    expiryTimestamp: BN
                    id: BN
                    isConfigured: boolean
                    makerFeeRate: number
                    maxBuy: BN
                    maxSell: BN
                    priceLowerLimit: number
                    pricePremiumRate: number
                    priceUpperLimit: number
                    sellTokenIndex: TokenIndex
                    sold: BN
                    takerFeeRate: number

                    Methods

                    • getAllowCreatingBorrows(): boolean
                    • getAllowCreatingDeposits(): boolean
                    • getBoughtUi(group: Group): number
                    • getCurrentPairPriceUi(group: Group): number
                    • getCurrentlySuggestedPremium(group: Group): number
                    • getExpiryTimestampInEpochSeconds(): number
                    • getMaxBuyUi(group: Group): number
                    • getMaxSellUi(group: Group): number
                    • getPriceLowerLimitUi(group: Group): number
                    • getPricePremium(): number
                    • getPriceUpperLimitUi(group: Group): number
                    • getSoldUi(group: Group): number
                    • getThresholdPriceUi(group: Group): number
                    • priceLimitToUi(group: Group, sellTokenPerBuyTokenNative: number): number
                    • toString(group: Group): string
                    • computePremium(group: Group, buyBank: Bank, sellBank: Bank, maxBuy: BN, maxSell: BN, maxBuyUi: number, maxSellUi: number): number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TokenConditionalSwap | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenConditionalSwap

                    Index

                    Constructors

                    Properties

                    allowCreatingBorrows: boolean
                    allowCreatingDeposits: boolean
                    bought: BN
                    buyTokenIndex: TokenIndex
                    expiryTimestamp: BN
                    id: BN
                    isConfigured: boolean
                    makerFeeRate: number
                    maxBuy: BN
                    maxSell: BN
                    priceLowerLimit: number
                    pricePremiumRate: number
                    priceUpperLimit: number
                    sellTokenIndex: TokenIndex
                    sold: BN
                    takerFeeRate: number

                    Methods

                    • getAllowCreatingBorrows(): boolean
                    • getAllowCreatingDeposits(): boolean
                    • getBoughtUi(group: Group): number
                    • getCurrentPairPriceUi(group: Group): number
                    • getCurrentlySuggestedPremium(group: Group): number
                    • getExpiryTimestampInEpochSeconds(): number
                    • getMaxBuyUi(group: Group): number
                    • getMaxSellUi(group: Group): number
                    • getPriceLowerLimitUi(group: Group): number
                    • getPricePremium(): number
                    • getPriceUpperLimitUi(group: Group): number
                    • getSoldUi(group: Group): number
                    • getThresholdPriceUi(group: Group): number
                    • priceLimitToUi(group: Group, sellTokenPerBuyTokenNative: number): number
                    • toString(group: Group): string
                    • computePremium(group: Group, buyBank: Bank, sellBank: Bank, maxBuy: BN, maxSell: BN, maxBuyUi: number, maxSellUi: number): number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/TokenConditionalSwapDto.html b/ts/client/classes/TokenConditionalSwapDto.html index fc2478e0c..e35c831fc 100644 --- a/ts/client/classes/TokenConditionalSwapDto.html +++ b/ts/client/classes/TokenConditionalSwapDto.html @@ -1 +1 @@ -TokenConditionalSwapDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenConditionalSwapDto

                    Index

                    Constructors

                    • new TokenConditionalSwapDto(id: BN, maxBuy: BN, maxSell: BN, bought: BN, sold: BN, expiryTimestamp: BN, priceLowerLimit: number, priceUpperLimit: number, pricePremiumRate: number, takerFeeRate: number, makerFeeRate: number, buyTokenIndex: number, sellTokenIndex: number, isConfigured: number, allowCreatingDeposits: number, allowCreatingBorrows: number, displayPriceStyle: number, intention: number): TokenConditionalSwapDto
                    • Parameters

                      • id: BN
                      • maxBuy: BN
                      • maxSell: BN
                      • bought: BN
                      • sold: BN
                      • expiryTimestamp: BN
                      • priceLowerLimit: number
                      • priceUpperLimit: number
                      • pricePremiumRate: number
                      • takerFeeRate: number
                      • makerFeeRate: number
                      • buyTokenIndex: number
                      • sellTokenIndex: number
                      • isConfigured: number
                      • allowCreatingDeposits: number
                      • allowCreatingBorrows: number
                      • displayPriceStyle: number
                      • intention: number

                      Returns TokenConditionalSwapDto

                    Properties

                    allowCreatingBorrows: number
                    allowCreatingDeposits: number
                    bought: BN
                    buyTokenIndex: number
                    displayPriceStyle: number
                    expiryTimestamp: BN
                    id: BN
                    intention: number
                    isConfigured: number
                    makerFeeRate: number
                    maxBuy: BN
                    maxSell: BN
                    priceLowerLimit: number
                    pricePremiumRate: number
                    priceUpperLimit: number
                    sellTokenIndex: number
                    sold: BN
                    takerFeeRate: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TokenConditionalSwapDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenConditionalSwapDto

                    Index

                    Constructors

                    • new TokenConditionalSwapDto(id: BN, maxBuy: BN, maxSell: BN, bought: BN, sold: BN, expiryTimestamp: BN, priceLowerLimit: number, priceUpperLimit: number, pricePremiumRate: number, takerFeeRate: number, makerFeeRate: number, buyTokenIndex: number, sellTokenIndex: number, isConfigured: number, allowCreatingDeposits: number, allowCreatingBorrows: number, displayPriceStyle: number, intention: number): TokenConditionalSwapDto
                    • Parameters

                      • id: BN
                      • maxBuy: BN
                      • maxSell: BN
                      • bought: BN
                      • sold: BN
                      • expiryTimestamp: BN
                      • priceLowerLimit: number
                      • priceUpperLimit: number
                      • pricePremiumRate: number
                      • takerFeeRate: number
                      • makerFeeRate: number
                      • buyTokenIndex: number
                      • sellTokenIndex: number
                      • isConfigured: number
                      • allowCreatingDeposits: number
                      • allowCreatingBorrows: number
                      • displayPriceStyle: number
                      • intention: number

                      Returns TokenConditionalSwapDto

                    Properties

                    allowCreatingBorrows: number
                    allowCreatingDeposits: number
                    bought: BN
                    buyTokenIndex: number
                    displayPriceStyle: number
                    expiryTimestamp: BN
                    id: BN
                    intention: number
                    isConfigured: number
                    makerFeeRate: number
                    maxBuy: BN
                    maxSell: BN
                    priceLowerLimit: number
                    pricePremiumRate: number
                    priceUpperLimit: number
                    sellTokenIndex: number
                    sold: BN
                    takerFeeRate: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/TokenPosition.html b/ts/client/classes/TokenPosition.html index 5217f0adf..31e505b3a 100644 --- a/ts/client/classes/TokenPosition.html +++ b/ts/client/classes/TokenPosition.html @@ -1,7 +1,7 @@ -TokenPosition | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenPosition

                    Index

                    Constructors

                    • new TokenPosition(indexedPosition: I80F48, tokenIndex: TokenIndex, inUseCount: number, previousIndex: I80F48, cumulativeDepositInterest: number, cumulativeBorrowInterest: number): TokenPosition

                    Properties

                    cumulativeBorrowInterest: number
                    cumulativeDepositInterest: number
                    inUseCount: number
                    indexedPosition: I80F48
                    previousIndex: I80F48
                    tokenIndex: TokenIndex
                    TokenIndexUnset: number = 65535

                    Methods

                    • balanceUi(bank: Bank): number
                    • borrowsUi(bank: Bank): number
                    • depositsUi(bank: Bank): number
                    • isActive(): boolean
                    • toString(group?: Group, index?: number): string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TokenPosition | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenPosition

                    Index

                    Constructors

                    • new TokenPosition(indexedPosition: I80F48, tokenIndex: TokenIndex, inUseCount: number, previousIndex: I80F48, cumulativeDepositInterest: number, cumulativeBorrowInterest: number): TokenPosition

                    Properties

                    cumulativeBorrowInterest: number
                    cumulativeDepositInterest: number
                    inUseCount: number
                    indexedPosition: I80F48
                    previousIndex: I80F48
                    tokenIndex: TokenIndex
                    TokenIndexUnset: number = 65535

                    Methods

                    • balanceUi(bank: Bank): number
                    • borrowsUi(bank: Bank): number
                    • depositsUi(bank: Bank): number
                    • isActive(): boolean
                    • toString(group?: Group, index?: number): string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/classes/TokenPositionDto.html b/ts/client/classes/TokenPositionDto.html index 381a17509..06f4bc833 100644 --- a/ts/client/classes/TokenPositionDto.html +++ b/ts/client/classes/TokenPositionDto.html @@ -1 +1 @@ -TokenPositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenPositionDto

                    Index

                    Constructors

                    • new TokenPositionDto(indexedPosition: I80F48Dto, tokenIndex: number, inUseCount: number, reserved: number[], previousIndex: I80F48Dto, cumulativeDepositInterest: number, cumulativeBorrowInterest: number): TokenPositionDto

                    Properties

                    cumulativeBorrowInterest: number
                    cumulativeDepositInterest: number
                    inUseCount: number
                    indexedPosition: I80F48Dto
                    previousIndex: I80F48Dto
                    reserved: number[]
                    tokenIndex: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TokenPositionDto | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • TokenPositionDto

                    Index

                    Constructors

                    • new TokenPositionDto(indexedPosition: I80F48Dto, tokenIndex: number, inUseCount: number, reserved: number[], previousIndex: I80F48Dto, cumulativeDepositInterest: number, cumulativeBorrowInterest: number): TokenPositionDto

                    Properties

                    cumulativeBorrowInterest: number
                    cumulativeDepositInterest: number
                    inUseCount: number
                    indexedPosition: I80F48Dto
                    previousIndex: I80F48Dto
                    reserved: number[]
                    tokenIndex: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/enums/OracleProvider.html b/ts/client/enums/OracleProvider.html index 70be6d098..0753d59b5 100644 --- a/ts/client/enums/OracleProvider.html +++ b/ts/client/enums/OracleProvider.html @@ -1 +1 @@ -OracleProvider | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +OracleProvider | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/enums/SwapMode.html b/ts/client/enums/SwapMode.html index c5c410a32..e6faabc0c 100644 --- a/ts/client/enums/SwapMode.html +++ b/ts/client/enums/SwapMode.html @@ -1 +1 @@ -SwapMode | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +SwapMode | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/enums/TransactionErrors.html b/ts/client/enums/TransactionErrors.html index b8ed98495..e62b17db6 100644 --- a/ts/client/enums/TransactionErrors.html +++ b/ts/client/enums/TransactionErrors.html @@ -1 +1 @@ -TransactionErrors | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TransactionErrors | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/index.html b/ts/client/index.html index 2b880e447..b19e43205 100644 --- a/ts/client/index.html +++ b/ts/client/index.html @@ -1,7 +1,7 @@ -@blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    @blockworks-foundation/mango-v4

                    Index

                    Namespaces

                    Enumerations

                    Classes

                    Interfaces

                    Type aliases

                    Variables

                    Functions

                    Type aliases

                    AccountInfoMap: Map<string, AccountInfo<Buffer> | null>
                    AmmLabel: "Aldrin" | "Crema" | "Cropper" | "Cykura" | "DeltaFi" | "GooseFX" | "Invariant" | "Lifinity" | "Lifinity V2" | "Marinade" | "Mercurial" | "Meteora" | "Raydium" | "Raydium CLMM" | "Saber" | "Serum" | "Orca" | "Step" | "Penguin" | "Saros" | "Stepn" | "Orca (Whirlpools)" | "Sencha" | "Saber (Decimals)" | "Dradex" | "Balansol" | "Openbook" | "Unknown"
                    BookSideType: { bids: Record<string, never> } | { asks: Record<string, never> }
                    FlashLoanType: { unknown: Record<string, never> } | { swap: Record<string, never> } | { swapWithoutFee: Record<string, never> }
                    MangoV4: { accounts: [{ name: "bank"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 16] } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "oracle"; type: "publicKey" }, { name: "oracleConfig"; type: { defined: "OracleConfig" } }, { name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["the index used to scale the value of an IndexedPosition", "TODO: should always be >= 0, add checks?"]; name: "depositIndex"; type: { defined: "I80F48" } }, { name: "borrowIndex"; type: { defined: "I80F48" } }, { docs: ["deposits/borrows for this bank", "", "Note that these may become negative. It's perfectly fine for users to borrow one one bank", "(increasing indexed_borrows there) and paying back on another (possibly decreasing indexed_borrows", "below zero).", "", "The vault amount is not deducable from these values.", "", "These become meaningful when summed over all banks (like in update_index_and_rate)."]; name: "indexedDeposits"; type: { defined: "I80F48" } }, { name: "indexedBorrows"; type: { defined: "I80F48" } }, { name: "indexLastUpdated"; type: "u64" }, { name: "bankRateLastUpdated"; type: "u64" }, { name: "avgUtilization"; type: { defined: "I80F48" } }, { name: "adjustmentFactor"; type: { defined: "I80F48" } }, { docs: ["The unscaled borrow interest curve is defined as continuous piecewise linear with the points:", "", "- 0% util: zero_util_rate", "- util0% util: rate0", "- util1% util: rate1", "- 100% util: max_rate", "", "The final rate is this unscaled curve multiplied by interest_curve_scaling."]; name: "util0"; type: { defined: "I80F48" } }, { name: "rate0"; type: { defined: "I80F48" } }, { name: "util1"; type: { defined: "I80F48" } }, { name: "rate1"; type: { defined: "I80F48" } }, { docs: ["the 100% utilization rate", "", "This isn't the max_rate, since this still gets scaled by interest_curve_scaling,", "which is >=1."]; name: "maxRate"; type: { defined: "I80F48" } }, { docs: ["Fees collected over the lifetime of the bank", "", "See fees_withdrawn for how much of the fees was withdrawn.", "See collected_liquidation_fees for the (included) subtotal for liquidation related fees."]; name: "collectedFeesNative"; type: { defined: "I80F48" } }, { name: "loanOriginationFeeRate"; type: { defined: "I80F48" } }, { name: "loanFeeRate"; type: { defined: "I80F48" } }, { name: "maintAssetWeight"; type: { defined: "I80F48" } }, { name: "initAssetWeight"; type: { defined: "I80F48" } }, { name: "maintLiabWeight"; type: { defined: "I80F48" } }, { name: "initLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Liquidation fee that goes to the liqor.", "", "Liquidation always involves two tokens, and the sum of the two configured fees is used.", "", "A fraction of the price, like 0.05 for a 5% fee during liquidation.", "", "See also platform_liquidation_fee."]; name: "liquidationFee"; type: { defined: "I80F48" } }, { name: "dust"; type: { defined: "I80F48" } }, { name: "flashLoanTokenAccountInitial"; type: "u64" }, { name: "flashLoanApprovedAmount"; type: "u64" }, { name: "tokenIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "mintDecimals"; type: "u8" }, { name: "bankNum"; type: "u32" }, { docs: ["The maximum utilization allowed when borrowing is 1-this value", "WARNING: Outdated name, kept for IDL compatibility"]; name: "minVaultToDepositsRatio"; type: "f64" }, { docs: ["Size in seconds of a net borrows window"]; name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { docs: ["Timestamp at which the last net borrows window started"]; name: "lastNetBorrowsWindowStartTs"; type: "u64" }, { docs: ["Net borrow limit per window in quote native; set to -1 to disable."]; name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { docs: ["Sum of all deposits and borrows in the last window, in native units."]; name: "netBorrowsInWindow"; type: "i64" }, { docs: ["Soft borrow limit in native quote", "", "Once the borrows on the bank exceed this quote value, init_liab_weight is scaled up.", "Set to f64::MAX to disable.", "", "See scaled_init_liab_weight()."]; name: "borrowWeightScaleStartQuote"; type: "f64" }, { docs: ["Limit for collateral of deposits in native quote", "", "Once the deposits in the bank exceed this quote value, init_asset_weight is scaled", "down to keep the total collateral value constant.", "Set to f64::MAX to disable.", "", "See scaled_init_asset_weight()."]; name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { docs: ["If set to 1, deposits cannot be liquidated when an account is liquidatable.", "That means bankrupt accounts may still have assets of this type deposited."]; name: "disableAssetLiquidation"; type: "u8" }, { name: "padding"; type: { array: ["u8", 5] } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Fees for the token conditional swap feature"]; name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { docs: ["Target utilization: If actual utilization is higher, scale up interest.", "If it's lower, scale down interest (if possible)"]; name: "interestTargetUtilization"; type: "f32" }, { docs: ["Current interest curve scaling, always >= 1.0", "", "Except when first migrating to having this field, then 0.0"]; name: "interestCurveScaling"; type: "f64" }, { docs: ["Largest amount of tokens that might be added the the bank based on", "serum open order execution."]; name: "potentialSerumTokens"; type: "u64" }, { docs: ["Start timestamp in seconds at which maint weights should start to change away", "from maint_asset_weight, maint_liab_weight towards _asset_target and _liab_target.", "If _start and _end and _duration_inv are 0, no shift is configured."]; name: "maintWeightShiftStart"; type: "u64" }, { docs: ["End timestamp in seconds until which the maint weights should reach the configured targets."]; name: "maintWeightShiftEnd"; type: "u64" }, { docs: ["Cache of the inverse of maint_weight_shift_end - maint_weight_shift_start,", "or zero if no shift is configured"]; name: "maintWeightShiftDurationInv"; type: { defined: "I80F48" } }, { docs: ["Maint asset weight to reach at _shift_end."]; name: "maintWeightShiftAssetTarget"; type: { defined: "I80F48" } }, { name: "maintWeightShiftLiabTarget"; type: { defined: "I80F48" } }, { docs: ["Oracle that may be used if the main oracle is stale or not confident enough.", "If this is Pubkey::default(), no fallback is available."]; name: "fallbackOracle"; type: "publicKey" }, { docs: ["zero means none, in token native"]; name: "depositLimit"; type: "u64" }, { docs: ["The unscaled borrow interest curve point for zero utilization.", "", "See util0, rate0, util1, rate1, max_rate"]; name: "zeroUtilRate"; type: { defined: "I80F48" } }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were collected during liquidation (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedLiquidationFees"; type: { defined: "I80F48" } }, { docs: ["Collateral fees that have been collected (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedCollateralFees"; type: { defined: "I80F48" } }, { docs: ["The daily collateral fees rate for fully utilized collateral."]; name: "collateralFeePerDay"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 1900] } }]; kind: "struct" } }, { name: "group"; type: { fields: [{ name: "creator"; type: "publicKey" }, { name: "groupNum"; type: "u32" }, { name: "admin"; type: "publicKey" }, { name: "fastListingAdmin"; type: "publicKey" }, { name: "mngoTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceMint"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }, { name: "buybackFees"; type: "u8" }, { name: "buybackFeesMngoBonusFactor"; type: "f32" }, { name: "addressLookupTables"; type: { array: ["publicKey", 20] } }, { name: "securityAdmin"; type: "publicKey" }, { name: "depositLimitQuote"; type: "u64" }, { name: "ixGate"; type: "u128" }, { name: "buybackFeesSwapMangoAccount"; type: "publicKey" }, { docs: ["Number of seconds after which fees that could be used with the fees buyback feature expire.", "", "The actual expiry is staggered such that the fees users accumulate are always", "available for at least this interval - but may be available for up to twice this time.", "", "When set to 0, there's no expiry of buyback fees."]; name: "buybackFeesExpiryInterval"; type: "u64" }, { docs: ["Fast-listings are limited per week, this is the start of the current fast-listing interval", "in seconds since epoch"]; name: "fastListingIntervalStart"; type: "u64" }, { docs: ["Number of fast listings that happened this interval"]; name: "fastListingsInInterval"; type: "u16" }, { docs: ["Number of fast listings that are allowed per interval"]; name: "allowedFastListingsPerInterval"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { docs: ["Intervals in which collateral fee is applied"]; name: "collateralFeeInterval"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 1800] } }]; kind: "struct" } }, { name: "mangoAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { docs: ["Tracks that this account should be liquidated until init_health >= 0.", "", "Normally accounts can not be liquidated while maint_health >= 0. But when an account", "reaches maint_health < 0, liquidators will call a liquidation instruction and thereby", "set this flag. Now the account may be liquidated until init_health >= 0.", "", "Many actions should be disabled while the account is being liquidated, even if", "its maint health has recovered to positive. Creating new open orders would, for example,", "confuse liquidators."]; name: "beingLiquidated"; type: "u8" }, { docs: ["The account is currently inside a health region marked by HealthRegionBegin...HealthRegionEnd.", "", "Must never be set after a transaction ends."]; name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { docs: ["Init health as calculated during HealthReginBegin, rounded up."]; name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { docs: ["Fees usable with the \"fees buyback\" feature.", "This tracks the ones that accrued in the current expiry interval."]; name: "buybackFeesAccruedCurrent"; type: "u64" }, { docs: ["Fees buyback amount from the previous expiry interval."]; name: "buybackFeesAccruedPrevious"; type: "u64" }, { docs: ["End timestamp of the current expiry interval of the buyback fees amount."]; name: "buybackFeesExpiryTimestamp"; type: "u64" }, { docs: ["Next id to use when adding a token condition swap"]; name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { docs: ["Time at which the last collateral fee was charged"]; name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }, { name: "headerVersion"; type: "u8" }, { name: "padding3"; type: { array: ["u8", 7] } }, { name: "padding4"; type: "u32" }, { name: "tokens"; type: { vec: { defined: "TokenPosition" } } }, { name: "padding5"; type: "u32" }, { name: "serum3"; type: { vec: { defined: "Serum3Orders" } } }, { name: "padding6"; type: "u32" }, { name: "perps"; type: { vec: { defined: "PerpPosition" } } }, { name: "padding7"; type: "u32" }, { name: "perpOpenOrders"; type: { vec: { defined: "PerpOpenOrder" } } }, { name: "padding8"; type: "u32" }, { name: "tokenConditionalSwaps"; type: { vec: { defined: "TokenConditionalSwap" } } }, { name: "reservedDynamic"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "mintInfo"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "tokenIndex"; type: "u16" }, { name: "groupInsuranceFund"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }, { name: "mint"; type: "publicKey" }, { name: "banks"; type: { array: ["publicKey", 6] } }, { name: "vaults"; type: { array: ["publicKey", 6] } }, { name: "oracle"; type: "publicKey" }, { name: "registrationTime"; type: "u64" }, { name: "fallbackOracle"; type: "publicKey" }, { name: "reserved"; type: { array: ["u8", 2528] } }]; kind: "struct" } }, { name: "openbookV2Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "openbookV2Program"; type: "publicKey" }, { name: "openbookV2MarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 5] } }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 512] } }]; kind: "struct" } }, { name: "openbookV2MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }, { name: "stubOracle"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "mint"; type: "publicKey" }, { name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateTs"; type: "i64" }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 104] } }]; kind: "struct" } }, { name: "bookSide"; type: { fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" } }, { name: "eventQueue"; type: { fields: [{ name: "header"; type: { defined: "EventQueueHeader" } }, { name: "buf"; type: { array: [{ defined: "AnyEvent" }, 488] } }, { name: "reserved"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "perpMarket"; type: { fields: [{ name: "group"; type: "publicKey" }, { docs: ["Token index that settlements happen in.", "", "Currently required to be 0, USDC. In the future settlement", "may be allowed to happen in other tokens."]; name: "settleTokenIndex"; type: "u16" }, { docs: ["Index of this perp market. Other data, like the MangoAccount's PerpPosition", "reference this market via this index. Unique for this group's perp markets."]; name: "perpMarketIndex"; type: "u16" }, { docs: ["Field used to contain the trusted_market flag and is now unused."]; name: "blocked1"; type: "u8" }, { docs: ["Is this market covered by the group insurance fund?"]; name: "groupInsuranceFund"; type: "u8" }, { docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { docs: ["Name. Trailing zero bytes are ignored."]; name: "name"; type: { array: ["u8", 16] } }, { docs: ["Address of the BookSide account for bids"]; name: "bids"; type: "publicKey" }, { docs: ["Address of the BookSide account for asks"]; name: "asks"; type: "publicKey" }, { docs: ["Address of the EventQueue account"]; name: "eventQueue"; type: "publicKey" }, { docs: ["Oracle account address"]; name: "oracle"; type: "publicKey" }, { docs: ["Oracle configuration"]; name: "oracleConfig"; type: { defined: "OracleConfig" } }, { docs: ["Maintains a stable price based on the oracle price that is less volatile."]; name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["Number of quote native in a quote lot. Must be a power of 10.", "", "Primarily useful for increasing the tick size on the market: A lot price", "of 1 becomes a native price of quote_lot_size/base_lot_size becomes a", "ui price of quote_lot_size*base_decimals/base_lot_size/quote_decimals."]; name: "quoteLotSize"; type: "i64" }, { docs: ["Number of base native in a base lot. Must be a power of 10.", "", "Example: If base decimals for the underlying asset is 6, base lot size", "is 100 and and base position lots is 10_000 then base position native is", "1_000_000 and base position ui is 1."]; name: "baseLotSize"; type: "i64" }, { docs: ["These weights apply to the base position. The quote position has", "no explicit weight (but may be covered by the overall pnl asset weight)."]; name: "maintBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "initBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "maintBaseLiabWeight"; type: { defined: "I80F48" } }, { name: "initBaseLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Number of base lots currently active in the market. Always >= 0.", "", "Since this counts positive base lots and negative base lots, the more relevant", "number of open base lot pairs is half this value."]; name: "openInterest"; type: "i64" }, { docs: ["Total number of orders seen"]; name: "seqNum"; type: "u64" }, { docs: ["Timestamp in seconds that the market was registered at."]; name: "registrationTime"; type: "u64" }, { docs: ["Minimal funding rate per day, must be <= 0."]; name: "minFunding"; type: { defined: "I80F48" } }, { docs: ["Maximal funding rate per day, must be >= 0."]; name: "maxFunding"; type: { defined: "I80F48" } }, { docs: ["For funding, get the impact price this many base lots deep into the book."]; name: "impactQuantity"; type: "i64" }, { docs: ["Current long funding value. Increasing it means that every long base lot", "needs to pay that amount of quote native in funding.", "", "PerpPosition uses and tracks it settle funding. Updated by the perp", "keeper instruction."]; name: "longFunding"; type: { defined: "I80F48" } }, { docs: ["See long_funding."]; name: "shortFunding"; type: { defined: "I80F48" } }, { docs: ["timestamp that funding was last updated in"]; name: "fundingLastUpdated"; type: "u64" }, { docs: ["Fees", "Fee for base position liquidation"]; name: "baseLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Fee when matching maker orders. May be negative."]; name: "makerFee"; type: { defined: "I80F48" } }, { docs: ["Fee for taker orders, may not be negative."]; name: "takerFee"; type: { defined: "I80F48" } }, { docs: ["Fees accrued in native quote currency", "these are increased when new fees are paid and decreased when perp_settle_fees is called"]; name: "feesAccrued"; type: { defined: "I80F48" } }, { docs: ["Fees settled in native quote currency", "these are increased when perp_settle_fees is called, and never decreased"]; name: "feesSettled"; type: { defined: "I80F48" } }, { docs: ["Fee (in quote native) to charge for ioc orders"]; name: "feePenalty"; type: "f32" }, { docs: ["In native units of settlement token, given to each settle call above the", "settle_fee_amount_threshold if settling at least 1% of perp base pos value."]; name: "settleFeeFlat"; type: "f32" }, { docs: ["Pnl settlement amount needed to be eligible for the flat fee."]; name: "settleFeeAmountThreshold"; type: "f32" }, { docs: ["Fraction of pnl to pay out as fee if +pnl account has low health.", "(limited to 2x settle_fee_flat)"]; name: "settleFeeFractionLowHealth"; type: "f32" }, { docs: ["Controls the strictness of the settle limit.", "Set to a negative value to disable the limit.", "", "This factor applies to the settle limit in two ways", "- for the unrealized pnl settle limit, the factor is multiplied with the stable perp base value", "(i.e. limit_factor * base_native * stable_price)", "- when increasing the realized pnl settle limit (stored per PerpPosition), the factor is", "multiplied with the stable value of the perp pnl being realized", "(i.e. limit_factor * reduced_native * stable_price)", "", "See also PerpPosition::settle_pnl_limit_realized_trade"]; name: "settlePnlLimitFactor"; type: "f32" }, { name: "padding3"; type: { array: ["u8", 4] } }, { docs: ["Window size in seconds for the perp settlement limit"]; name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { docs: ["If true, users may no longer increase their market exposure. Only actions", "that reduce their position are still allowed."]; name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding4"; type: { array: ["u8", 6] } }, { docs: ["Weights for full perp market health, if positive"]; name: "maintOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "initOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "positivePnlLiquidationFee"; type: { defined: "I80F48" } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were accrued during liquidation (in native tokens)", "", "These fees are also added to fees_accrued, this is just for bookkeeping the total", "liquidation fees that happened. So never decreases (different to fees_accrued)."]; name: "accruedLiquidationFees"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 1848] } }]; kind: "struct" } }, { name: "serum3Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "serumProgram"; type: "publicKey" }, { name: "serumMarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 1] } }, { docs: ["Limit orders must be <= oracle * (1+band) and >= oracle / (1+band)", "", "Zero value is the default due to migration and disables the limit,", "same as f32::MAX."]; name: "oraclePriceBand"; type: "f32" }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "serum3MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }]; errors: [{ code: 6000; msg: ""; name: "SomeError" }, { code: 6001; msg: ""; name: "NotImplementedError" }, { code: 6002; msg: "checked math error"; name: "MathError" }, { code: 6003; msg: ""; name: "UnexpectedOracle" }, { code: 6004; msg: "oracle type cannot be determined"; name: "UnknownOracleType" }, { code: 6005; msg: ""; name: "InvalidFlashLoanTargetCpiProgram" }, { code: 6006; msg: "health must be positive"; name: "HealthMustBePositive" }, { code: 6007; msg: "health must be positive or not decrease"; name: "HealthMustBePositiveOrIncrease" }, { code: 6008; msg: "health must be negative"; name: "HealthMustBeNegative" }, { code: 6009; msg: "the account is bankrupt"; name: "IsBankrupt" }, { code: 6010; msg: "the account is not bankrupt"; name: "IsNotBankrupt" }, { code: 6011; msg: "no free token position index"; name: "NoFreeTokenPositionIndex" }, { code: 6012; msg: "no free serum3 open orders index"; name: "NoFreeSerum3OpenOrdersIndex" }, { code: 6013; msg: "no free perp position index"; name: "NoFreePerpPositionIndex" }, { code: 6014; msg: "serum3 open orders exist already"; name: "Serum3OpenOrdersExistAlready" }, { code: 6015; msg: "bank vault has insufficent funds"; name: "InsufficentBankVaultFunds" }, { code: 6016; msg: "account is currently being liquidated"; name: "BeingLiquidated" }, { code: 6017; msg: "invalid bank"; name: "InvalidBank" }, { code: 6018; msg: "account profitability is mismatched"; name: "ProfitabilityMismatch" }, { code: 6019; msg: "cannot settle with self"; name: "CannotSettleWithSelf" }, { code: 6020; msg: "perp position does not exist"; name: "PerpPositionDoesNotExist" }, { code: 6021; msg: "max settle amount must be greater than zero"; name: "MaxSettleAmountMustBeGreaterThanZero" }, { code: 6022; msg: "the perp position has open orders or unprocessed fill events"; name: "HasOpenPerpOrders" }, { code: 6023; msg: "an oracle does not reach the confidence threshold"; name: "OracleConfidence" }, { code: 6024; msg: "an oracle is stale"; name: "OracleStale" }, { code: 6025; msg: "settlement amount must always be positive"; name: "SettlementAmountMustBePositive" }, { code: 6026; msg: "bank utilization has reached limit"; name: "BankBorrowLimitReached" }, { code: 6027; msg: "bank net borrows has reached limit - this is an intermittent error - the limit will reset regularly"; name: "BankNetBorrowsLimitReached" }, { code: 6028; msg: "token position does not exist"; name: "TokenPositionDoesNotExist" }, { code: 6029; msg: "token deposits into accounts that are being liquidated must bring their health above the init threshold"; name: "DepositsIntoLiquidatingMustRecover" }, { code: 6030; msg: "token is in reduce only mode"; name: "TokenInReduceOnlyMode" }, { code: 6031; msg: "market is in reduce only mode"; name: "MarketInReduceOnlyMode" }, { code: 6032; msg: "group is halted"; name: "GroupIsHalted" }, { code: 6033; msg: "the perp position has non-zero base lots"; name: "PerpHasBaseLots" }, { code: 6034; msg: "there are open or unsettled serum3 orders"; name: "HasOpenOrUnsettledSerum3Orders" }, { code: 6035; msg: "has liquidatable token position"; name: "HasLiquidatableTokenPosition" }, { code: 6036; msg: "has liquidatable perp base position"; name: "HasLiquidatablePerpBasePosition" }, { code: 6037; msg: "has liquidatable positive perp pnl"; name: "HasLiquidatablePositivePerpPnl" }, { code: 6038; msg: "account is frozen"; name: "AccountIsFrozen" }, { code: 6039; msg: "Init Asset Weight can't be negative"; name: "InitAssetWeightCantBeNegative" }, { code: 6040; msg: "has open perp taker fills"; name: "HasOpenPerpTakerFills" }, { code: 6041; msg: "deposit crosses the current group deposit limit"; name: "DepositLimit" }, { code: 6042; msg: "instruction is disabled"; name: "IxIsDisabled" }, { code: 6043; msg: "no liquidatable perp base position"; name: "NoLiquidatablePerpBasePosition" }, { code: 6044; msg: "perp order id not found on the orderbook"; name: "PerpOrderIdNotFound" }, { code: 6045; msg: "HealthRegions allow only specific instructions between Begin and End"; name: "HealthRegionBadInnerInstruction" }, { code: 6046; msg: "token is in force close"; name: "TokenInForceClose" }, { code: 6047; msg: "incorrect number of health accounts"; name: "InvalidHealthAccountCount" }, { code: 6048; msg: "would self trade"; name: "WouldSelfTrade" }, { code: 6049; msg: "token conditional swap oracle price is not in execution range"; name: "TokenConditionalSwapPriceNotInRange" }, { code: 6050; msg: "token conditional swap is expired"; name: "TokenConditionalSwapExpired" }, { code: 6051; msg: "token conditional swap is not available yet"; name: "TokenConditionalSwapNotStarted" }, { code: 6052; msg: "token conditional swap was already started"; name: "TokenConditionalSwapAlreadyStarted" }, { code: 6053; msg: "token conditional swap it not set"; name: "TokenConditionalSwapNotSet" }, { code: 6054; msg: "token conditional swap trigger did not reach min_buy_token"; name: "TokenConditionalSwapMinBuyTokenNotReached" }, { code: 6055; msg: "token conditional swap cannot pay incentive"; name: "TokenConditionalSwapCantPayIncentive" }, { code: 6056; msg: "token conditional swap taker price is too low"; name: "TokenConditionalSwapTakerPriceTooLow" }, { code: 6057; msg: "token conditional swap index and id don't match"; name: "TokenConditionalSwapIndexIdMismatch" }, { code: 6058; msg: "token conditional swap volume is too small compared to the cost of starting it"; name: "TokenConditionalSwapTooSmallForStartIncentive" }, { code: 6059; msg: "token conditional swap type cannot be started"; name: "TokenConditionalSwapTypeNotStartable" }, { code: 6060; msg: "a bank in the health account list should be writable but is not"; name: "HealthAccountBankNotWritable" }, { code: 6061; msg: "the market does not allow limit orders too far from the current oracle value"; name: "Serum3PriceBandExceeded" }, { code: 6062; msg: "deposit crosses the token's deposit limit"; name: "BankDepositLimit" }, { code: 6063; msg: "delegates can only withdraw to the owner's associated token account"; name: "DelegateWithdrawOnlyToOwnerAta" }, { code: 6064; msg: "delegates can only withdraw if they close the token position"; name: "DelegateWithdrawMustClosePosition" }, { code: 6065; msg: "delegates can only withdraw small amounts"; name: "DelegateWithdrawSmall" }, { code: 6066; msg: "The provided CLMM oracle is not valid"; name: "InvalidCLMMOracle" }, { code: 6067; msg: "invalid usdc/usd feed provided for the CLMM oracle"; name: "InvalidFeedForCLMMOracle" }, { code: 6068; msg: "Pyth USDC/USD or SOL/USD feed not found (required by CLMM oracle)"; name: "MissingFeedForCLMMOracle" }, { code: 6069; msg: "the asset does not allow liquidation"; name: "TokenAssetLiquidationDisabled" }]; events: [{ fields: [{ index: false; name: "initHealth"; type: { defined: "I80F48" } }, { index: false; name: "maintHealth"; type: { defined: "I80F48" } }, { index: false; name: "equity"; type: { defined: "Equity" } }]; name: "MangoAccountData" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "basePosition"; type: "i64" }, { index: false; name: "quotePosition"; type: "i128" }, { index: false; name: "longSettledFunding"; type: "i128" }, { index: false; name: "shortSettledFunding"; type: "i128" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }]; name: "PerpBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "indexedPosition"; type: "i128" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }]; name: "TokenBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetail" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV2" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV3" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "WithdrawLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "DepositLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerOrderId"; type: "u128" }, { index: false; name: "makerFee"; type: "i128" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerOrderId"; type: "u128" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "i128" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }, { index: false; name: "makerClosedPnl"; type: "f64" }, { index: false; name: "takerClosedPnl"; type: "f64" }]; name: "FillLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "oracleConfidence"; type: "i128" }, { index: false; name: "oracleType"; type: { defined: "OracleType" } }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }, { index: false; name: "avgUtilization"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "collectedFees"; type: "i128" }, { index: false; name: "loanFeeRate"; type: "i128" }, { index: false; name: "totalBorrows"; type: "i128" }, { index: false; name: "totalDeposits"; type: "i128" }, { index: false; name: "borrowRate"; type: "i128" }, { index: false; name: "depositRate"; type: "i128" }]; name: "UpdateIndexLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }]; name: "UpdateRateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "util0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "util1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }, { index: false; name: "curveScaling"; type: "f64" }, { index: false; name: "targetUtilization"; type: "f32" }]; name: "UpdateRateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }]; name: "WithdrawLoanOriginationFeeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanAmount"; type: "i128" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }, { index: false; name: "price"; type: { option: "i128" } }]; name: "WithdrawLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "initialLiabNative"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "insuranceTokenIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLiabDepositIndex"; type: "i128" }, { index: false; name: "endingLiabDepositIndex"; type: "i128" }]; name: "TokenLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "cumulativeDepositInterest"; type: "f64" }, { index: false; name: "cumulativeBorrowInterest"; type: "f64" }]; name: "DeactivateTokenPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "cumulativeLongFunding"; type: "f64" }, { index: false; name: "cumulativeShortFunding"; type: "f64" }, { index: false; name: "makerVolume"; type: "u64" }, { index: false; name: "takerVolume"; type: "u64" }, { index: false; name: "perpSpotTransfers"; type: "i64" }]; name: "DeactivatePerpPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "fallbackOracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarket"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "baseDecimals"; type: "u8" }, { index: false; name: "baseLotSize"; type: "i64" }, { index: false; name: "quoteLotSize"; type: "i64" }, { index: false; name: "oracle"; type: "publicKey" }]; name: "PerpMarketMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "serumMarket"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "serumProgram"; type: "publicKey" }, { index: false; name: "serumProgramExternal"; type: "publicKey" }]; name: "Serum3RegisterMarketLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransferLiqee"; type: "i64" }, { index: false; name: "quoteTransferLiqee"; type: "i128" }, { index: false; name: "quoteTransferLiqor"; type: "i128" }, { index: false; name: "quotePlatformFee"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLongFunding"; type: "i128" }, { index: false; name: "startingShortFunding"; type: "i128" }, { index: false; name: "endingLongFunding"; type: "i128" }, { index: false; name: "endingShortFunding"; type: "i128" }]; name: "PerpLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpLiqNegativePnlOrBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccountA"; type: "publicKey" }, { index: false; name: "mangoAccountB"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }, { index: false; name: "settler"; type: "publicKey" }, { index: false; name: "fee"; type: "i128" }]; name: "PerpSettlePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpSettleFeesLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "buybackFees"; type: "i128" }, { index: false; name: "buybackMngo"; type: "i128" }, { index: false; name: "mngoBuybackPrice"; type: "i128" }, { index: false; name: "oraclePrice"; type: "i128" }]; name: "AccountBuybackFeesWithMngoLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "seqNum"; type: "u64" }]; name: "FilledPerpOrderLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "totalBaseLotsTaken"; type: "i64" }, { index: false; name: "totalBaseLotsDecremented"; type: "i64" }, { index: false; name: "totalQuoteLotsTaken"; type: "i64" }, { index: false; name: "totalQuoteLotsDecremented"; type: "i64" }, { index: false; name: "takerFeesPaid"; type: "i128" }, { index: false; name: "feePenalty"; type: "i128" }]; name: "PerpTakerTradeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "accountA"; type: "publicKey" }, { index: false; name: "accountB"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpForceClosePositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }]; name: "TokenConditionalSwapCreateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapCreateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }, { index: false; name: "durationSeconds"; type: "u64" }]; name: "TokenConditionalSwapCreateLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }]; name: "TokenConditionalSwapTriggerLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapTriggerLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }]; name: "TokenConditionalSwapTriggerLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }]; name: "TokenConditionalSwapCancelLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "caller"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "incentiveTokenIndex"; type: "u16" }, { index: false; name: "incentiveAmount"; type: "u64" }]; name: "TokenConditionalSwapStartLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "assetUsageFraction"; type: "i128" }, { index: false; name: "fee"; type: "i128" }]; name: "TokenCollateralFeeLog" }]; instructions: [{ accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminTokenWithdrawFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminPerpWithdrawFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Group" }, { kind: "account"; path: "creator"; type: "publicKey" }, { kind: "arg"; path: "group_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "creator" }, { isMut: false; isSigner: false; name: "insuranceMint" }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "InsuranceVault" }, { kind: "account"; path: "group"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "groupNum"; type: "u32" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }]; name: "groupCreate" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "adminOpt"; type: { option: "publicKey" } }, { name: "fastListingAdminOpt"; type: { option: "publicKey" } }, { name: "securityAdminOpt"; type: { option: "publicKey" } }, { name: "testingOpt"; type: { option: "u8" } }, { name: "versionOpt"; type: { option: "u8" } }, { name: "depositLimitQuoteOpt"; type: { option: "u64" } }, { name: "buybackFeesOpt"; type: { option: "bool" } }, { name: "buybackFeesBonusFactorOpt"; type: { option: "f32" } }, { name: "buybackFeesSwapMangoAccountOpt"; type: { option: "publicKey" } }, { name: "mngoTokenIndexOpt"; type: { option: "u16" } }, { name: "buybackFeesExpiryIntervalOpt"; type: { option: "u64" } }, { name: "allowedFastListingsPerIntervalOpt"; type: { option: "u16" } }, { name: "collateralFeeIntervalOpt"; type: { option: "u64" } }]; name: "groupEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault", "admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "destination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "groupWithdrawInsuranceFund" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "ixGate"; type: "u128" }]; name: "ixGateSet" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin", "insurance_vault"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "groupClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "interestRateParams"; type: { defined: "InterestRateParams" } }, { name: "loanFeeRate"; type: "f32" }, { name: "loanOriginationFeeRate"; type: "f32" }, { name: "maintAssetWeight"; type: "f32" }, { name: "initAssetWeight"; type: "f32" }, { name: "maintLiabWeight"; type: "f32" }, { name: "initLiabWeight"; type: "f32" }, { name: "liquidationFee"; type: "f32" }, { name: "stablePriceDelayIntervalSeconds"; type: "u32" }, { name: "stablePriceDelayGrowthLimit"; type: "f32" }, { name: "stablePriceGrowthLimit"; type: "f32" }, { name: "minVaultToDepositsRatio"; type: "f64" }, { name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { name: "borrowWeightScaleStartQuote"; type: "f64" }, { name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { name: "interestCurveScaling"; type: "f32" }, { name: "interestTargetUtilization"; type: "f32" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "depositLimit"; type: "u64" }, { name: "zeroUtilRate"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }, { name: "disableAssetLiquidation"; type: "bool" }, { name: "collateralFeePerDay"; type: "f32" }]; name: "tokenRegister" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }]; name: "tokenRegisterTrustless" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }, { docs: ["The fallback oracle account is optional and only used when set_fallback_oracle is true.", ""]; isMut: false; isSigner: false; name: "fallbackOracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "interestRateParamsOpt"; type: { option: { defined: "InterestRateParams" } } }, { name: "loanFeeRateOpt"; type: { option: "f32" } }, { name: "loanOriginationFeeRateOpt"; type: { option: "f32" } }, { name: "maintAssetWeightOpt"; type: { option: "f32" } }, { name: "initAssetWeightOpt"; type: { option: "f32" } }, { name: "maintLiabWeightOpt"; type: { option: "f32" } }, { name: "initLiabWeightOpt"; type: { option: "f32" } }, { name: "liquidationFeeOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "minVaultToDepositsRatioOpt"; type: { option: "f64" } }, { name: "netBorrowLimitPerWindowQuoteOpt"; type: { option: "i64" } }, { name: "netBorrowLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "borrowWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "depositWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "resetStablePrice"; type: "bool" }, { name: "resetNetBorrowLimit"; type: "bool" }, { name: "reduceOnlyOpt"; type: { option: "u8" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "tokenConditionalSwapTakerFeeRateOpt"; type: { option: "f32" } }, { name: "tokenConditionalSwapMakerFeeRateOpt"; type: { option: "f32" } }, { name: "flashLoanSwapFeeRateOpt"; type: { option: "f32" } }, { name: "interestCurveScalingOpt"; type: { option: "f32" } }, { name: "interestTargetUtilizationOpt"; type: { option: "f32" } }, { name: "maintWeightShiftStartOpt"; type: { option: "u64" } }, { name: "maintWeightShiftEndOpt"; type: { option: "u64" } }, { name: "maintWeightShiftAssetTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftLiabTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftAbort"; type: "bool" }, { name: "setFallbackOracle"; type: "bool" }, { name: "depositLimitOpt"; type: { option: "u64" } }, { name: "zeroUtilRateOpt"; type: { option: "f32" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }, { name: "disableAssetLiquidationOpt"; type: { option: "bool" } }, { name: "collateralFeePerDayOpt"; type: { option: "f32" } }]; name: "tokenEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: false; isSigner: false; name: "existingBank"; relations: ["group", "mint"] }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group", "mint"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "bankNum"; type: "u32" }]; name: "tokenAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "dustVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "tokenDeregister" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "mintInfo"; relations: ["oracle", "group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "instructions" }]; args: []; name: "tokenUpdateIndexAndRate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }]; name: "accountExpand" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }]; name: "accountExpandV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "accountSizeMigration" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }]; args: [{ name: "nameOpt"; type: { option: "string" } }, { name: "delegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateExpiryOpt"; type: { option: "u64" } }]; name: "accountEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "freeze"; type: "bool" }]; name: "accountToggleFreeze" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "forceClose"; type: "bool" }]; name: "accountClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "daoAccount"; relations: ["group"] }, { isMut: true; isSigner: false; name: "mngoBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "mngoOracle" }, { isMut: true; isSigner: false; name: "feesBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "feesOracle" }]; args: [{ name: "maxBuybackUsd"; type: "u64" }]; name: "accountBuybackFeesWithMngo" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: true; name: "oracle" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "stubOracleClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }]; name: "stubOracleSetTest" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDepositIntoExisting" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "allowBorrow"; type: "bool" }]; name: "tokenWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmounts"; type: { vec: "u64" } }]; name: "flashLoanBegin" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: true; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "inputMint" }, { isMut: false; isSigner: false; name: "outputMint" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "associatedTokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmount"; type: "u64" }]; docs: ["A version of flash_loan_begin that's specialized for swaps and needs fewer", "bytes in the transaction"]; name: "flashLoanSwapBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "numLoans"; type: "u8" }, { name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEndV2" }, { accounts: [{ docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }, { isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "healthRegionBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }]; args: []; name: "healthRegionEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { docs: ["group admin or fast listing admin, checked at #1"]; isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "serumMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "serum_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oraclePriceBand"; type: "f32" }]; docs: ["", "Serum", ""]; name: "serum3RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "oraclePriceBandOpt"; type: { option: "f32" } }]; name: "serum3EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "serumMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "serum3DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3OO" }, { kind: "account"; path: "account"; type: "publicKey" }, { kind: "account"; path: "serum_market"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: []; name: "serum3CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "serum3CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "serum3PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; docs: ["requires the receiver_bank in the health account list to be writable"]; name: "serum3PlaceOrderV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "orderId"; type: "u128" }]; name: "serum3CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "serum3CancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Deprecated instruction that used to settles all free funds from the OpenOrders account", "into the MangoAccount.", "", "Any serum \"referrer rebates\" (ui fees) are considered Mango fees."]; name: "serum3SettleFunds" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; name: "v1" }, { accounts: [{ isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }]; name: "v2" }]; args: [{ name: "feesToDao"; type: "bool" }]; docs: ["Like Serum3SettleFunds, but `fees_to_dao` determines if referrer rebates are considered fees", "or are credited to the MangoAccount."]; name: "serum3SettleFundsV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: "u64" }]; name: "tokenForceCloseBorrowsWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "perpMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "PerpMarket" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "perp_market_index"; type: "u16" }] } }, { docs: ["Accounts are initialised by client,", "anchor discriminator is set first when ix exits,"]; isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "perpMarketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "baseDecimals"; type: "u8" }, { name: "quoteLotSize"; type: "i64" }, { name: "baseLotSize"; type: "i64" }, { name: "maintBaseAssetWeight"; type: "f32" }, { name: "initBaseAssetWeight"; type: "f32" }, { name: "maintBaseLiabWeight"; type: "f32" }, { name: "initBaseLiabWeight"; type: "f32" }, { name: "maintOverallAssetWeight"; type: "f32" }, { name: "initOverallAssetWeight"; type: "f32" }, { name: "baseLiquidationFee"; type: "f32" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "minFunding"; type: "f32" }, { name: "maxFunding"; type: "f32" }, { name: "impactQuantity"; type: "i64" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "feePenalty"; type: "f32" }, { name: "settleFeeFlat"; type: "f32" }, { name: "settleFeeAmountThreshold"; type: "f32" }, { name: "settleFeeFractionLowHealth"; type: "f32" }, { name: "settleTokenIndex"; type: "u16" }, { name: "settlePnlLimitFactor"; type: "f32" }, { name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { name: "positivePnlLiquidationFee"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }]; docs: ["", "Perps", ""]; name: "perpCreateMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "baseDecimalsOpt"; type: { option: "u8" } }, { name: "maintBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "initBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "maintBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "initBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "maintOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "initOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "baseLiquidationFeeOpt"; type: { option: "f32" } }, { name: "makerFeeOpt"; type: { option: "f32" } }, { name: "takerFeeOpt"; type: { option: "f32" } }, { name: "minFundingOpt"; type: { option: "f32" } }, { name: "maxFundingOpt"; type: { option: "f32" } }, { name: "impactQuantityOpt"; type: { option: "i64" } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "feePenaltyOpt"; type: { option: "f32" } }, { name: "settleFeeFlatOpt"; type: { option: "f32" } }, { name: "settleFeeAmountThresholdOpt"; type: { option: "f32" } }, { name: "settleFeeFractionLowHealthOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "settlePnlLimitFactorOpt"; type: { option: "f32" } }, { name: "settlePnlLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "resetStablePrice"; type: "bool" }, { name: "positivePnlLiquidationFeeOpt"; type: { option: "f32" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }]; name: "perpEditMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "perpCloseMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group"] }]; args: []; name: "perpDeactivatePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrder"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrderV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPegged"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPeggedV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "orderId"; type: "u128" }]; name: "perpCancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "perpCancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpCancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "sideOption"; type: { option: { defined: "Side" } } }, { name: "limit"; type: "u8" }]; name: "perpCancelAllOrdersBySide" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "event_queue"] }, { isMut: true; isSigner: false; name: "eventQueue" }]; args: [{ name: "limit"; type: "u64" }]; name: "perpConsumeEvents" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpUpdateFunding" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "settler"; relations: ["group"] }, { isMut: false; isSigner: true; name: "settlerOwner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: []; name: "perpSettlePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpForceClosePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxSettleAmount"; type: "u64" }]; name: "perpSettleFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxBaseTransfer"; type: "i64" }, { name: "maxPnlTransfer"; type: "u64" }]; name: "perpLiqBaseOrPositivePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpLiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "insuranceBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "insuranceBankVault" }, { isMut: false; isSigner: false; name: "insuranceOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcyV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }]; name: "tokenConditionalSwapCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }]; name: "tokenConditionalSwapCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "maxPricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreatePremiumAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceStart"; type: "f64" }, { name: "priceEnd"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "startTimestamp"; type: "u64" }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreateLinearAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { docs: ["The bank's token_index is checked at #1"]; isMut: true; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapCancel" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }]; name: "tokenConditionalSwapTrigger" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }, { name: "minBuyToken"; type: "u64" }, { name: "minTakerPrice"; type: "f32" }]; name: "tokenConditionalSwapTriggerV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapStart" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "tokenChargeCollateralFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }]; name: "altSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: true; name: "payer" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }, { name: "newAddresses"; type: { vec: "publicKey" } }]; name: "altExtend" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }]; args: []; docs: ["Warning, this instruction is for testing purposes only!"]; name: "computeAccountData" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openbookV2Market"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }]; docs: ["", "OpenbookV2", ""]; name: "openbookV2RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }]; name: "openbookV2EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "openbookV2Market"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "openbookV2DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { programId: { kind: "account"; path: "openbook_v2_program"; type: "publicKey" }; seeds: [{ kind: "const"; type: "string"; value: "OpenOrders" }, { kind: "account"; path: "openbook_v2_market"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "accountNum"; type: "u32" }]; name: "openbookV2CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "openbookV2CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "orderType"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceTakerOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "side"; type: "u8" }, { name: "orderId"; type: "u128" }]; name: "openbookV2CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "feesToDao"; type: "bool" }]; name: "openbookV2SettleFunds" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "dummy" }]; args: []; docs: ["", "benchmark", ""]; name: "benchmark" }]; name: "mango_v4"; types: [{ name: "InterestRateParams"; type: { fields: [{ name: "util0"; type: "f32" }, { name: "rate0"; type: "f32" }, { name: "util1"; type: "f32" }, { name: "rate1"; type: "f32" }, { name: "maxRate"; type: "f32" }, { name: "adjustmentFactor"; type: "f32" }]; kind: "struct" } }, { name: "Equity"; type: { fields: [{ name: "tokens"; type: { vec: { defined: "TokenEquity" } } }, { name: "perps"; type: { vec: { defined: "PerpEquity" } } }]; kind: "struct" } }, { name: "TokenEquity"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "PerpEquity"; type: { fields: [{ name: "perpMarketIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "FlashLoanTokenDetail"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "changeAmount"; type: "i128" }, { name: "loan"; type: "i128" }, { name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV2"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Deposit fee paid for positive change_amount.", "", "Not factored into change_amount."]; name: "depositFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV3"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Swap fee paid on the in token of a swap.", "", "Not factored into change_amount."]; name: "swapFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "TokenPosition"; type: { fields: [{ docs: ["The deposit_index (if positive) or borrow_index (if negative) scaled position"]; name: "indexedPosition"; type: { defined: "I80F48" } }, { docs: ["index into Group.tokens"]; name: "tokenIndex"; type: "u16" }, { docs: ["incremented when a market requires this position to stay alive"]; name: "inUseCount"; type: "u16" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "previousIndex"; type: { defined: "I80F48" } }, { name: "cumulativeDepositInterest"; type: "f64" }, { name: "cumulativeBorrowInterest"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "Serum3Orders"; type: { fields: [{ name: "openOrders"; type: "publicKey" }, { docs: ["Tracks the amount of borrows that have flowed into the serum open orders account.", "These borrows did not have the loan origination fee applied, and that may happen", "later (in serum3_settle_funds) if we can guarantee that the funds were used.", "In particular a place-on-book, cancel, settle should not cost fees."]; name: "baseBorrowsWithoutFee"; type: "u64" }, { name: "quoteBorrowsWithoutFee"; type: "u64" }, { name: "marketIndex"; type: "u16" }, { docs: ["Store the base/quote token index, so health computations don't need", "to get passed the static SerumMarket to find which tokens a market", "uses and look up the correct oracles."]; name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Track something like the highest open bid / lowest open ask, in native/native units.", "", "Tracking it exactly isn't possible since we don't see fills. So instead track", "the min/max of the _placed_ bids and asks.", "", "The value is reset in serum3_place_order when a new order is placed without an", "existing one on the book.", "", "0 is a special \"unset\" state."]; name: "highestPlacedBidInv"; type: "f64" }, { name: "lowestPlacedAsk"; type: "f64" }, { docs: ["An overestimate of the amount of tokens that might flow out of the open orders account.", "", "The bank still considers these amounts user deposits (see Bank::potential_serum_tokens)", "and that value needs to be updated in conjunction with these numbers.", "", "This estimation is based on the amount of tokens in the open orders account", "(see update_bank_potential_tokens() in serum3_place_order and settle)"]; name: "potentialBaseTokens"; type: "u64" }, { name: "potentialQuoteTokens"; type: "u64" }, { docs: ["Track lowest bid/highest ask, same way as for highest bid/lowest ask.", "", "0 is a special \"unset\" state."]; name: "lowestPlacedBidInv"; type: "f64" }, { name: "highestPlacedAsk"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 16] } }]; kind: "struct" } }, { name: "PerpPosition"; type: { fields: [{ name: "marketIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Index of the current settle pnl limit window"]; name: "settlePnlLimitWindow"; type: "u32" }, { docs: ["Amount of realized trade pnl and unrealized pnl that was already settled this window.", "", "Will be negative when negative pnl was settled.", "", "Note that this will be adjusted for bookkeeping reasons when the realized_trade settle", "limitchanges and is not useable for actually tracking how much pnl was settled", "on balance."]; name: "settlePnlLimitSettledInCurrentWindowNative"; type: "i64" }, { docs: ["Active position size, measured in base lots"]; name: "basePositionLots"; type: "i64" }, { docs: ["Active position in oracle quote native. At the same time this is 1:1 a settle_token native amount.", "", "Example: Say there's a perp market on the BTC/USD price using SOL for settlement. The user buys", "one long contract for $20k, then base = 1, quote = -20k. The price goes to $21k. Now their", "unsettled pnl is (1 * 21k - 20k) __SOL__ = 1000 SOL. This is because the perp contract arbitrarily", "decides that each unit of price difference creates 1 SOL worth of settlement.", "(yes, causing 1 SOL of settlement for each $1 price change implies a lot of extra leverage; likely", "there should be an extra configurable scaling factor before we use this for cases like that)"]; name: "quotePositionNative"; type: { defined: "I80F48" } }, { docs: ["Tracks what the position is to calculate average entry & break even price"]; name: "quoteRunningNative"; type: "i64" }, { docs: ["Already settled long funding"]; name: "longSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Already settled short funding"]; name: "shortSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { docs: ["Amount of base lots on the EventQueue waiting to be processed"]; name: "takerBaseLots"; type: "i64" }, { docs: ["Amount of quote lots on the EventQueue waiting to be processed"]; name: "takerQuoteLots"; type: "i64" }, { docs: ["Cumulative long funding in quote native units.", "If the user paid $1 in funding for a long position, this would be 1e6.", "Beware of the sign!", "", "(Display only)"]; name: "cumulativeLongFunding"; type: "f64" }, { docs: ["Cumulative short funding in quote native units", "If the user paid $1 in funding for a short position, this would be -1e6.", "", "(Display only)"]; name: "cumulativeShortFunding"; type: "f64" }, { docs: ["Cumulative maker volume in quote native units", "", "(Display only)"]; name: "makerVolume"; type: "u64" }, { docs: ["Cumulative taker volume in quote native units", "", "(Display only)"]; name: "takerVolume"; type: "u64" }, { docs: ["Cumulative number of quote native units transfered from the perp position", "to the settle token spot position.", "", "For example, if the user settled $1 of positive pnl into their USDC spot", "position, this would be 1e6.", "", "(Display only)"]; name: "perpSpotTransfers"; type: "i64" }, { docs: ["The native average entry price for the base lots of the current position.", "Reset to 0 when the base position reaches or crosses 0."]; name: "avgEntryPricePerBaseLot"; type: "f64" }, { docs: ["Deprecated field: Amount of pnl that was realized by bringing the base position closer to 0."]; name: "deprecatedRealizedTradePnlNative"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled once.", "", "- The value is signed: a negative number means negative pnl can be settled.", "- A settlement in the right direction will decrease this amount.", "", "Typically added for fees, funding and liquidation."]; name: "oneshotSettlePnlAllowance"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled in each settle window.", "", "- Unsigned, the settlement can happen in both directions. Value is >= 0.", "- Previously stored a similar value that was signed, so in migration cases", "this value can be negative and should be .abs()ed.", "- If this value exceeds the current stable-upnl, it should be decreased,", "see apply_recurring_settle_pnl_allowance_constraint()", "", "When the base position is reduced, the settle limit contribution from the reduced", "base position is materialized into this value. When the base position increases,", "some of the allowance is taken away.", "", "This also gets increased when a liquidator takes over pnl."]; name: "recurringSettlePnlAllowance"; type: "i64" }, { docs: ["Trade pnl, fees, funding that were added over the current position's lifetime.", "", "Reset when the position changes sign or goes to zero.", "Not decreased by settling.", "", "This is tracked for display purposes: this value plus the difference between entry", "price and current price of the base position is the overall pnl."]; name: "realizedPnlForPositionNative"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { name: "PerpOpenOrder"; type: { fields: [{ name: "sideAndTree"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 1] } }, { name: "market"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { name: "clientId"; type: "u64" }, { name: "id"; type: "u128" }, { name: "quantity"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 56] } }]; kind: "struct" } }, { name: "MangoAccountFixed"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { name: "beingLiquidated"; type: "u8" }, { name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { name: "buybackFeesAccruedCurrent"; type: "u64" }, { name: "buybackFeesAccruedPrevious"; type: "u64" }, { name: "buybackFeesExpiryTimestamp"; type: "u64" }, { name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "confFilter"; type: { defined: "I80F48" } }, { name: "maxStalenessSlots"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { name: "OracleConfigParams"; type: { fields: [{ name: "confFilter"; type: "f32" }, { name: "maxStalenessSlots"; type: { option: "u32" } }]; kind: "struct" } }, { docs: ["InnerNodes and LeafNodes compose the binary tree of orders.", "", "Each InnerNode has exactly two children, which are either InnerNodes themselves,", "or LeafNodes. The children share the top `prefix_len` bits of `key`. The left", "child has a 0 in the next bit, and the right a 1."]; name: "InnerNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { docs: ["number of highest `key` bits that all children share", "e.g. if it's 2, the two highest bits of `key` will be the same on all children"]; name: "prefixLen"; type: "u32" }, { docs: ["only the top `prefix_len` bits of `key` are relevant"]; name: "key"; type: "u128" }, { docs: ["indexes into `BookSide::nodes`"]; name: "children"; type: { array: ["u32", 2] } }, { docs: ["The earliest expiry timestamp for the left and right subtrees.", "", "Needed to be able to find and remove expired orders without having to", "iterate through the whole bookside."]; name: "childEarliestExpiry"; type: { array: ["u64", 2] } }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { docs: ["LeafNodes represent an order in the binary tree"]; name: "LeafNode"; type: { fields: [{ docs: ["NodeTag"]; name: "tag"; type: "u8" }, { docs: ["Index into the owning MangoAccount's PerpOpenOrders"]; name: "ownerSlot"; type: "u8" }, { docs: ["PostOrderType, this was added for TradingView move order"]; name: "orderType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { docs: ["Time in seconds after `timestamp` at which the order expires.", "A value of 0 means no expiry."]; name: "timeInForce"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 2] } }, { docs: ["The binary tree key, see new_node_key()"]; name: "key"; type: "u128" }, { docs: ["Address of the owning MangoAccount"]; name: "owner"; type: "publicKey" }, { docs: ["Number of base lots to buy or sell, always >=1"]; name: "quantity"; type: "i64" }, { docs: ["The time the order was placed"]; name: "timestamp"; type: "u64" }, { docs: ["If the effective price of an oracle pegged order exceeds this limit,", "it will be considered invalid and may be removed.", "", "Only applicable in the oracle_pegged OrderTree"]; name: "pegLimit"; type: "i64" }, { docs: ["User defined id for this order, used in FillEvents"]; name: "clientOrderId"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 32] } }]; kind: "struct" } }, { name: "AnyNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "data"; type: { array: ["u8", 119] } }]; kind: "struct" } }, { name: "OrderTreeRoot"; type: { fields: [{ name: "maybeNode"; type: "u32" }, { name: "leafCount"; type: "u32" }]; kind: "struct" } }, { docs: ["A binary tree on AnyNode::key()", "", "The key encodes the price in the top 64 bits."]; name: "OrderTreeNodes"; type: { fields: [{ name: "orderTreeType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { name: "bumpIndex"; type: "u32" }, { name: "freeListLen"; type: "u32" }, { name: "freeListHead"; type: "u32" }, { name: "reserved"; type: { array: ["u8", 512] } }, { name: "nodes"; type: { array: [{ defined: "AnyNode" }, 1024] } }]; kind: "struct" } }, { name: "EventQueueHeader"; type: { fields: [{ name: "head"; type: "u32" }, { name: "count"; type: "u32" }, { name: "seqNum"; type: "u64" }]; kind: "struct" } }, { name: "AnyEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 207] } }]; kind: "struct" } }, { name: "FillEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "takerSide"; type: "u8" }, { name: "makerOut"; type: "u8" }, { name: "makerSlot"; type: "u8" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "maker"; type: "publicKey" }, { name: "padding2"; type: { array: ["u8", 32] } }, { name: "makerTimestamp"; type: "u64" }, { name: "taker"; type: "publicKey" }, { name: "padding3"; type: { array: ["u8", 16] } }, { name: "takerClientOrderId"; type: "u64" }, { name: "makerOrderId"; type: "u128" }, { name: "price"; type: "i64" }, { name: "quantity"; type: "i64" }, { name: "makerClientOrderId"; type: "u64" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 8] } }]; kind: "struct" } }, { name: "OutEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "side"; type: "u8" }, { name: "ownerSlot"; type: "u8" }, { name: "padding0"; type: { array: ["u8", 5] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "owner"; type: "publicKey" }, { name: "quantity"; type: "i64" }, { name: "orderId"; type: "u128" }, { name: "padding1"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { docs: ["Maintains a \"stable_price\" based on the oracle price.", "", "The stable price follows the oracle price, but its relative rate of", "change is limited (to `stable_growth_limit`) and futher reduced if", "the oracle price is far from the `delay_price`.", "", "Conceptually the `delay_price` is itself a time delayed", "(`24 * delay_interval_seconds`, assume 24h) and relative rate of change limited", "function of the oracle price. It is implemented as averaging the oracle", "price over every `delay_interval_seconds` (assume 1h) and then applying the", "`delay_growth_limit` between intervals."]; name: "StablePriceModel"; type: { fields: [{ docs: ["Current stable price to use in health"]; name: "stablePrice"; type: "f64" }, { name: "lastUpdateTimestamp"; type: "u64" }, { docs: ["Stored delay_price for each delay_interval.", "If we want the delay_price to be 24h delayed, we would store one for each hour.", "This is used in a cyclical way: We use the maximally-delayed value at delay_interval_index", "and once enough time passes to move to the next delay interval, that gets overwritten and", "we use the next one."]; name: "delayPrices"; type: { array: ["f64", 24] } }, { docs: ["The delay price is based on an average over each delay_interval. The contributions", "to the average are summed up here."]; name: "delayAccumulatorPrice"; type: "f64" }, { docs: ["Accumulating the total time for the above average."]; name: "delayAccumulatorTime"; type: "u32" }, { docs: ["Length of a delay_interval"]; name: "delayIntervalSeconds"; type: "u32" }, { docs: ["Maximal relative difference between two delay_price in consecutive intervals."]; name: "delayGrowthLimit"; type: "f32" }, { docs: ["Maximal per-second relative difference of the stable price.", "It gets further reduced if stable and delay price disagree."]; name: "stableGrowthLimit"; type: "f32" }, { docs: ["The delay_interval_index that update() was last called on."]; name: "lastDelayIntervalIndex"; type: "u8" }, { docs: ["If set to 1, the stable price will reset on the next non-zero price it sees."]; name: "resetOnNonzeroPrice"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { name: "reserved"; type: { array: ["u8", 48] } }]; kind: "struct" } }, { name: "TokenConditionalSwap"; type: { fields: [{ name: "id"; type: "u64" }, { docs: ["maximum amount of native tokens to buy or sell"]; name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { docs: ["how many native tokens were already bought/sold"]; name: "bought"; type: "u64" }, { name: "sold"; type: "u64" }, { docs: ["timestamp until which the conditional swap is valid"]; name: "expiryTimestamp"; type: "u64" }, { docs: ["The lower or starting price:", "- For FixedPremium or PremiumAuctions, it's the lower end of the price range:", "the tcs can only be triggered if the oracle price exceeds this value.", "- For LinearAuctions it's the starting price that's offered at start_timestamp.", "", "The price is always in \"sell_token per buy_token\" units, which can be computed", "by dividing the buy token price by the sell token price.", "", "For FixedPremium or PremiumAuctions:", "", "The price must exceed this threshold to allow execution.", "", "This threshold is compared to the \"sell_token per buy_token\" oracle price.", "If that price is >= lower_limit and <= upper_limit the tcs may be executable.", "", "Example: Stop loss to get out of a SOL long: The user bought SOL at 20 USDC/SOL", "and wants to stop loss at 18 USDC/SOL. They'd set buy_token=USDC, sell_token=SOL", "so the reference price is in SOL/USDC units. Set price_lower_limit=toNative(1/18)", "and price_upper_limit=toNative(1/10). Also set allow_borrows=false.", "", "Example: Want to buy SOL with USDC if the price falls below 22 USDC/SOL.", "buy_token=SOL, sell_token=USDC, reference price is in USDC/SOL units. Set", "price_upper_limit=toNative(22), price_lower_limit=0."]; name: "priceLowerLimit"; type: "f64" }, { docs: ["Parallel to price_lower_limit, but an upper limit / auction end price."]; name: "priceUpperLimit"; type: "f64" }, { docs: ["The premium to pay over oracle price to incentivize execution."]; name: "pricePremiumRate"; type: "f64" }, { docs: ["The taker receives only premium_price * (1 - taker_fee_rate)"]; name: "takerFeeRate"; type: "f32" }, { docs: ["The maker has to pay premium_price * (1 + maker_fee_rate)"]; name: "makerFeeRate"; type: "f32" }, { docs: ["indexes of tokens for the swap"]; name: "buyTokenIndex"; type: "u16" }, { name: "sellTokenIndex"; type: "u16" }, { docs: ["If this struct is in use. (tcs are stored in a static-length array)"]; name: "isConfigured"; type: "u8" }, { docs: ["may token purchases create deposits? (often users just want to get out of a borrow)"]; name: "allowCreatingDeposits"; type: "u8" }, { docs: ["may token selling create borrows? (often users just want to get out of a long)"]; name: "allowCreatingBorrows"; type: "u8" }, { docs: ["The stored prices are always \"sell token per buy token\", but if the user", "used \"buy token per sell token\" when creating the tcs order, we should continue", "to show them prices in that way.", "", "Stores a TokenConditionalSwapDisplayPriceStyle enum value"]; name: "displayPriceStyle"; type: "u8" }, { docs: ["The intention the user had when placing this order, display-only", "", "Stores a TokenConditionalSwapIntention enum value"]; name: "intention"; type: "u8" }, { docs: ["Stores a TokenConditionalSwapType enum value"]; name: "tcsType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { docs: ["In seconds since epoch. 0 means not-started.", "", "FixedPremium: Time of first trigger call. No other effect.", "PremiumAuction: Time of start or first trigger call. Can continue to trigger once started.", "LinearAuction: Set during creation, auction starts with price_lower_limit at this timestamp."]; name: "startTimestamp"; type: "u64" }, { docs: ["Duration of the auction mechanism", "", "FixedPremium: ignored", "PremiumAuction: time after start that the premium needs to scale to price_premium_rate", "LinearAuction: time after start to go from price_lower_limit to price_upper_limit"]; name: "durationSeconds"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { docs: ["Nothing in Rust shall use these types. They only exist so that the Anchor IDL", "knows about them and typescript can deserialize it."]; name: "TokenIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "Serum3MarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "PerpMarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "I80F48"; type: { fields: [{ name: "val"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanType"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "Swap" }, { name: "SwapWithoutFee" }] } }, { docs: ["Copy paste a bunch of enums so that we could AnchorSerialize & AnchorDeserialize them"]; name: "Serum3SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Serum3OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }] } }, { name: "Serum3Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["There are three types of health:", "- initial health (\"init\"): users can only open new positions if it's >= 0", "- maintenance health (\"maint\"): users get liquidated if it's < 0", "- liquidation end health: once liquidation started (see being_liquidated), it", "only stops once this is >= 0", "", "The ordering is", "init health <= liquidation end health <= maint health", "", "The different health types are realized by using different weights and prices:", "- init health: init weights with scaling, stable-price adjusted prices", "- liq end health: init weights without scaling, oracle prices", "- maint health: maint weights, oracle prices", ""]; name: "HealthType"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "Maint" }, { name: "LiquidationEnd" }] } }, { name: "LoanOriginationFeeInstruction"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "LiqTokenBankruptcy" }, { name: "LiqTokenWithToken" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3SettleFunds" }, { name: "TokenWithdraw" }, { name: "TokenConditionalSwapTrigger" }] } }, { docs: ["Enum for lookup into ix gate", "note:", "total ix files 56,", "ix files included 48,", "ix files not included 8,", "- Benchmark,", "- ComputeAccountData,", "- GroupCreate", "- GroupEdit", "- IxGateSet,", "- PerpZeroOut,", "- PerpEditMarket,", "- TokenEdit,"]; name: "IxGate"; type: { kind: "enum"; variants: [{ name: "AccountClose" }, { name: "AccountCreate" }, { name: "AccountEdit" }, { name: "AccountExpand" }, { name: "AccountToggleFreeze" }, { name: "AltExtend" }, { name: "AltSet" }, { name: "FlashLoan" }, { name: "GroupClose" }, { name: "GroupCreate" }, { name: "HealthRegion" }, { name: "PerpCancelAllOrders" }, { name: "PerpCancelAllOrdersBySide" }, { name: "PerpCancelOrder" }, { name: "PerpCancelOrderByClientOrderId" }, { name: "PerpCloseMarket" }, { name: "PerpConsumeEvents" }, { name: "PerpCreateMarket" }, { name: "PerpDeactivatePosition" }, { name: "PerpLiqBaseOrPositivePnl" }, { name: "PerpLiqForceCancelOrders" }, { name: "PerpLiqNegativePnlOrBankruptcy" }, { name: "PerpPlaceOrder" }, { name: "PerpSettleFees" }, { name: "PerpSettlePnl" }, { name: "PerpUpdateFunding" }, { name: "Serum3CancelAllOrders" }, { name: "Serum3CancelOrder" }, { name: "Serum3CloseOpenOrders" }, { name: "Serum3CreateOpenOrders" }, { name: "Serum3DeregisterMarket" }, { name: "Serum3EditMarket" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3RegisterMarket" }, { name: "Serum3SettleFunds" }, { name: "StubOracleClose" }, { name: "StubOracleCreate" }, { name: "StubOracleSet" }, { name: "TokenAddBank" }, { name: "TokenDeposit" }, { name: "TokenDeregister" }, { name: "TokenLiqBankruptcy" }, { name: "TokenLiqWithToken" }, { name: "TokenRegister" }, { name: "TokenRegisterTrustless" }, { name: "TokenUpdateIndexAndRate" }, { name: "TokenWithdraw" }, { name: "AccountBuybackFeesWithMngo" }, { name: "TokenForceCloseBorrowsWithToken" }, { name: "PerpForceClosePosition" }, { name: "GroupWithdrawInsuranceFund" }, { name: "TokenConditionalSwapCreate" }, { name: "TokenConditionalSwapTrigger" }, { name: "TokenConditionalSwapCancel" }, { name: "OpenbookV2CancelOrder" }, { name: "OpenbookV2CloseOpenOrders" }, { name: "OpenbookV2CreateOpenOrders" }, { name: "OpenbookV2DeregisterMarket" }, { name: "OpenbookV2EditMarket" }, { name: "OpenbookV2LiqForceCancelOrders" }, { name: "OpenbookV2PlaceOrder" }, { name: "OpenbookV2PlaceTakeOrder" }, { name: "OpenbookV2RegisterMarket" }, { name: "OpenbookV2SettleFunds" }, { name: "AdminTokenWithdrawFees" }, { name: "AdminPerpWithdrawFees" }, { name: "AccountSizeMigration" }, { name: "TokenConditionalSwapStart" }, { name: "TokenConditionalSwapCreatePremiumAuction" }, { name: "TokenConditionalSwapCreateLinearAuction" }, { name: "Serum3PlaceOrderV2" }] } }, { name: "CheckLiquidatable"; type: { kind: "enum"; variants: [{ name: "NotLiquidatable" }, { name: "Liquidatable" }, { name: "BecameNotLiquidatable" }] } }, { name: "OracleType"; type: { kind: "enum"; variants: [{ name: "Pyth" }, { name: "Stub" }, { name: "SwitchboardV1" }, { name: "SwitchboardV2" }, { name: "OrcaCLMM" }] } }, { name: "OrderState"; type: { kind: "enum"; variants: [{ name: "Valid" }, { name: "Invalid" }, { name: "Skipped" }] } }, { name: "BookSideOrderTree"; type: { kind: "enum"; variants: [{ name: "Fixed" }, { name: "OraclePegged" }] } }, { name: "NodeTag"; type: { kind: "enum"; variants: [{ name: "Uninitialized" }, { name: "InnerNode" }, { name: "LeafNode" }, { name: "FreeNode" }, { name: "LastFreeNode" }] } }, { name: "PlaceOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "PostOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "PostOnly" }, { name: "PostOnlySlide" }] } }, { docs: ["Self trade behavior controls how taker orders interact with resting limit orders of the same account.", "This setting has no influence on placing a resting or oracle pegged limit order that does not match", "immediately, instead it's the responsibility of the user to correctly configure his taker orders."]; name: "SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["SideAndOrderTree is a storage optimization, so we don't need two bytes for the data"]; name: "SideAndOrderTree"; type: { kind: "enum"; variants: [{ name: "BidFixed" }, { name: "AskFixed" }, { name: "BidOraclePegged" }, { name: "AskOraclePegged" }] } }, { name: "OrderParams"; type: { kind: "enum"; variants: [{ name: "Market" }, { fields: [{ name: "price_lots"; type: "i64" }]; name: "ImmediateOrCancel" }, { fields: [{ name: "price_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }]; name: "Fixed" }, { fields: [{ name: "price_offset_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }, { name: "peg_limit"; type: "i64" }, { name: "max_oracle_staleness_slots"; type: "i32" }]; name: "OraclePegged" }] } }, { name: "OrderTreeType"; type: { kind: "enum"; variants: [{ name: "Bids" }, { name: "Asks" }] } }, { name: "EventType"; type: { kind: "enum"; variants: [{ name: "Fill" }, { name: "Out" }, { name: "Liquidate" }] } }, { name: "TokenConditionalSwapDisplayPriceStyle"; type: { kind: "enum"; variants: [{ name: "SellTokenPerBuyToken" }, { name: "BuyTokenPerSellToken" }] } }, { name: "TokenConditionalSwapIntention"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "StopLoss" }, { name: "TakeProfit" }] } }, { name: "TokenConditionalSwapType"; type: { kind: "enum"; variants: [{ name: "FixedPremium" }, { name: "PremiumAuction" }, { name: "LinearAuction" }] } }]; version: "0.22.0" }

                    Type declaration

                    • accounts: [{ name: "bank"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 16] } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "oracle"; type: "publicKey" }, { name: "oracleConfig"; type: { defined: "OracleConfig" } }, { name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["the index used to scale the value of an IndexedPosition", "TODO: should always be >= 0, add checks?"]; name: "depositIndex"; type: { defined: "I80F48" } }, { name: "borrowIndex"; type: { defined: "I80F48" } }, { docs: ["deposits/borrows for this bank", "", "Note that these may become negative. It's perfectly fine for users to borrow one one bank", "(increasing indexed_borrows there) and paying back on another (possibly decreasing indexed_borrows", "below zero).", "", "The vault amount is not deducable from these values.", "", "These become meaningful when summed over all banks (like in update_index_and_rate)."]; name: "indexedDeposits"; type: { defined: "I80F48" } }, { name: "indexedBorrows"; type: { defined: "I80F48" } }, { name: "indexLastUpdated"; type: "u64" }, { name: "bankRateLastUpdated"; type: "u64" }, { name: "avgUtilization"; type: { defined: "I80F48" } }, { name: "adjustmentFactor"; type: { defined: "I80F48" } }, { docs: ["The unscaled borrow interest curve is defined as continuous piecewise linear with the points:", "", "- 0% util: zero_util_rate", "- util0% util: rate0", "- util1% util: rate1", "- 100% util: max_rate", "", "The final rate is this unscaled curve multiplied by interest_curve_scaling."]; name: "util0"; type: { defined: "I80F48" } }, { name: "rate0"; type: { defined: "I80F48" } }, { name: "util1"; type: { defined: "I80F48" } }, { name: "rate1"; type: { defined: "I80F48" } }, { docs: ["the 100% utilization rate", "", "This isn't the max_rate, since this still gets scaled by interest_curve_scaling,", "which is >=1."]; name: "maxRate"; type: { defined: "I80F48" } }, { docs: ["Fees collected over the lifetime of the bank", "", "See fees_withdrawn for how much of the fees was withdrawn.", "See collected_liquidation_fees for the (included) subtotal for liquidation related fees."]; name: "collectedFeesNative"; type: { defined: "I80F48" } }, { name: "loanOriginationFeeRate"; type: { defined: "I80F48" } }, { name: "loanFeeRate"; type: { defined: "I80F48" } }, { name: "maintAssetWeight"; type: { defined: "I80F48" } }, { name: "initAssetWeight"; type: { defined: "I80F48" } }, { name: "maintLiabWeight"; type: { defined: "I80F48" } }, { name: "initLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Liquidation fee that goes to the liqor.", "", "Liquidation always involves two tokens, and the sum of the two configured fees is used.", "", "A fraction of the price, like 0.05 for a 5% fee during liquidation.", "", "See also platform_liquidation_fee."]; name: "liquidationFee"; type: { defined: "I80F48" } }, { name: "dust"; type: { defined: "I80F48" } }, { name: "flashLoanTokenAccountInitial"; type: "u64" }, { name: "flashLoanApprovedAmount"; type: "u64" }, { name: "tokenIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "mintDecimals"; type: "u8" }, { name: "bankNum"; type: "u32" }, { docs: ["The maximum utilization allowed when borrowing is 1-this value", "WARNING: Outdated name, kept for IDL compatibility"]; name: "minVaultToDepositsRatio"; type: "f64" }, { docs: ["Size in seconds of a net borrows window"]; name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { docs: ["Timestamp at which the last net borrows window started"]; name: "lastNetBorrowsWindowStartTs"; type: "u64" }, { docs: ["Net borrow limit per window in quote native; set to -1 to disable."]; name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { docs: ["Sum of all deposits and borrows in the last window, in native units."]; name: "netBorrowsInWindow"; type: "i64" }, { docs: ["Soft borrow limit in native quote", "", "Once the borrows on the bank exceed this quote value, init_liab_weight is scaled up.", "Set to f64::MAX to disable.", "", "See scaled_init_liab_weight()."]; name: "borrowWeightScaleStartQuote"; type: "f64" }, { docs: ["Limit for collateral of deposits in native quote", "", "Once the deposits in the bank exceed this quote value, init_asset_weight is scaled", "down to keep the total collateral value constant.", "Set to f64::MAX to disable.", "", "See scaled_init_asset_weight()."]; name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { docs: ["If set to 1, deposits cannot be liquidated when an account is liquidatable.", "That means bankrupt accounts may still have assets of this type deposited."]; name: "disableAssetLiquidation"; type: "u8" }, { name: "padding"; type: { array: ["u8", 5] } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Fees for the token conditional swap feature"]; name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { docs: ["Target utilization: If actual utilization is higher, scale up interest.", "If it's lower, scale down interest (if possible)"]; name: "interestTargetUtilization"; type: "f32" }, { docs: ["Current interest curve scaling, always >= 1.0", "", "Except when first migrating to having this field, then 0.0"]; name: "interestCurveScaling"; type: "f64" }, { docs: ["Largest amount of tokens that might be added the the bank based on", "serum open order execution."]; name: "potentialSerumTokens"; type: "u64" }, { docs: ["Start timestamp in seconds at which maint weights should start to change away", "from maint_asset_weight, maint_liab_weight towards _asset_target and _liab_target.", "If _start and _end and _duration_inv are 0, no shift is configured."]; name: "maintWeightShiftStart"; type: "u64" }, { docs: ["End timestamp in seconds until which the maint weights should reach the configured targets."]; name: "maintWeightShiftEnd"; type: "u64" }, { docs: ["Cache of the inverse of maint_weight_shift_end - maint_weight_shift_start,", "or zero if no shift is configured"]; name: "maintWeightShiftDurationInv"; type: { defined: "I80F48" } }, { docs: ["Maint asset weight to reach at _shift_end."]; name: "maintWeightShiftAssetTarget"; type: { defined: "I80F48" } }, { name: "maintWeightShiftLiabTarget"; type: { defined: "I80F48" } }, { docs: ["Oracle that may be used if the main oracle is stale or not confident enough.", "If this is Pubkey::default(), no fallback is available."]; name: "fallbackOracle"; type: "publicKey" }, { docs: ["zero means none, in token native"]; name: "depositLimit"; type: "u64" }, { docs: ["The unscaled borrow interest curve point for zero utilization.", "", "See util0, rate0, util1, rate1, max_rate"]; name: "zeroUtilRate"; type: { defined: "I80F48" } }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were collected during liquidation (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedLiquidationFees"; type: { defined: "I80F48" } }, { docs: ["Collateral fees that have been collected (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedCollateralFees"; type: { defined: "I80F48" } }, { docs: ["The daily collateral fees rate for fully utilized collateral."]; name: "collateralFeePerDay"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 1900] } }]; kind: "struct" } }, { name: "group"; type: { fields: [{ name: "creator"; type: "publicKey" }, { name: "groupNum"; type: "u32" }, { name: "admin"; type: "publicKey" }, { name: "fastListingAdmin"; type: "publicKey" }, { name: "mngoTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceMint"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }, { name: "buybackFees"; type: "u8" }, { name: "buybackFeesMngoBonusFactor"; type: "f32" }, { name: "addressLookupTables"; type: { array: ["publicKey", 20] } }, { name: "securityAdmin"; type: "publicKey" }, { name: "depositLimitQuote"; type: "u64" }, { name: "ixGate"; type: "u128" }, { name: "buybackFeesSwapMangoAccount"; type: "publicKey" }, { docs: ["Number of seconds after which fees that could be used with the fees buyback feature expire.", "", "The actual expiry is staggered such that the fees users accumulate are always", "available for at least this interval - but may be available for up to twice this time.", "", "When set to 0, there's no expiry of buyback fees."]; name: "buybackFeesExpiryInterval"; type: "u64" }, { docs: ["Fast-listings are limited per week, this is the start of the current fast-listing interval", "in seconds since epoch"]; name: "fastListingIntervalStart"; type: "u64" }, { docs: ["Number of fast listings that happened this interval"]; name: "fastListingsInInterval"; type: "u16" }, { docs: ["Number of fast listings that are allowed per interval"]; name: "allowedFastListingsPerInterval"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { docs: ["Intervals in which collateral fee is applied"]; name: "collateralFeeInterval"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 1800] } }]; kind: "struct" } }, { name: "mangoAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { docs: ["Tracks that this account should be liquidated until init_health >= 0.", "", "Normally accounts can not be liquidated while maint_health >= 0. But when an account", "reaches maint_health < 0, liquidators will call a liquidation instruction and thereby", "set this flag. Now the account may be liquidated until init_health >= 0.", "", "Many actions should be disabled while the account is being liquidated, even if", "its maint health has recovered to positive. Creating new open orders would, for example,", "confuse liquidators."]; name: "beingLiquidated"; type: "u8" }, { docs: ["The account is currently inside a health region marked by HealthRegionBegin...HealthRegionEnd.", "", "Must never be set after a transaction ends."]; name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { docs: ["Init health as calculated during HealthReginBegin, rounded up."]; name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { docs: ["Fees usable with the \"fees buyback\" feature.", "This tracks the ones that accrued in the current expiry interval."]; name: "buybackFeesAccruedCurrent"; type: "u64" }, { docs: ["Fees buyback amount from the previous expiry interval."]; name: "buybackFeesAccruedPrevious"; type: "u64" }, { docs: ["End timestamp of the current expiry interval of the buyback fees amount."]; name: "buybackFeesExpiryTimestamp"; type: "u64" }, { docs: ["Next id to use when adding a token condition swap"]; name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { docs: ["Time at which the last collateral fee was charged"]; name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }, { name: "headerVersion"; type: "u8" }, { name: "padding3"; type: { array: ["u8", 7] } }, { name: "padding4"; type: "u32" }, { name: "tokens"; type: { vec: { defined: "TokenPosition" } } }, { name: "padding5"; type: "u32" }, { name: "serum3"; type: { vec: { defined: "Serum3Orders" } } }, { name: "padding6"; type: "u32" }, { name: "perps"; type: { vec: { defined: "PerpPosition" } } }, { name: "padding7"; type: "u32" }, { name: "perpOpenOrders"; type: { vec: { defined: "PerpOpenOrder" } } }, { name: "padding8"; type: "u32" }, { name: "tokenConditionalSwaps"; type: { vec: { defined: "TokenConditionalSwap" } } }, { name: "reservedDynamic"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "mintInfo"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "tokenIndex"; type: "u16" }, { name: "groupInsuranceFund"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }, { name: "mint"; type: "publicKey" }, { name: "banks"; type: { array: ["publicKey", 6] } }, { name: "vaults"; type: { array: ["publicKey", 6] } }, { name: "oracle"; type: "publicKey" }, { name: "registrationTime"; type: "u64" }, { name: "fallbackOracle"; type: "publicKey" }, { name: "reserved"; type: { array: ["u8", 2528] } }]; kind: "struct" } }, { name: "openbookV2Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "openbookV2Program"; type: "publicKey" }, { name: "openbookV2MarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 5] } }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 512] } }]; kind: "struct" } }, { name: "openbookV2MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }, { name: "stubOracle"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "mint"; type: "publicKey" }, { name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateTs"; type: "i64" }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 104] } }]; kind: "struct" } }, { name: "bookSide"; type: { fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" } }, { name: "eventQueue"; type: { fields: [{ name: "header"; type: { defined: "EventQueueHeader" } }, { name: "buf"; type: { array: [{ defined: "AnyEvent" }, 488] } }, { name: "reserved"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "perpMarket"; type: { fields: [{ name: "group"; type: "publicKey" }, { docs: ["Token index that settlements happen in.", "", "Currently required to be 0, USDC. In the future settlement", "may be allowed to happen in other tokens."]; name: "settleTokenIndex"; type: "u16" }, { docs: ["Index of this perp market. Other data, like the MangoAccount's PerpPosition", "reference this market via this index. Unique for this group's perp markets."]; name: "perpMarketIndex"; type: "u16" }, { docs: ["Field used to contain the trusted_market flag and is now unused."]; name: "blocked1"; type: "u8" }, { docs: ["Is this market covered by the group insurance fund?"]; name: "groupInsuranceFund"; type: "u8" }, { docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { docs: ["Name. Trailing zero bytes are ignored."]; name: "name"; type: { array: ["u8", 16] } }, { docs: ["Address of the BookSide account for bids"]; name: "bids"; type: "publicKey" }, { docs: ["Address of the BookSide account for asks"]; name: "asks"; type: "publicKey" }, { docs: ["Address of the EventQueue account"]; name: "eventQueue"; type: "publicKey" }, { docs: ["Oracle account address"]; name: "oracle"; type: "publicKey" }, { docs: ["Oracle configuration"]; name: "oracleConfig"; type: { defined: "OracleConfig" } }, { docs: ["Maintains a stable price based on the oracle price that is less volatile."]; name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["Number of quote native in a quote lot. Must be a power of 10.", "", "Primarily useful for increasing the tick size on the market: A lot price", "of 1 becomes a native price of quote_lot_size/base_lot_size becomes a", "ui price of quote_lot_size*base_decimals/base_lot_size/quote_decimals."]; name: "quoteLotSize"; type: "i64" }, { docs: ["Number of base native in a base lot. Must be a power of 10.", "", "Example: If base decimals for the underlying asset is 6, base lot size", "is 100 and and base position lots is 10_000 then base position native is", "1_000_000 and base position ui is 1."]; name: "baseLotSize"; type: "i64" }, { docs: ["These weights apply to the base position. The quote position has", "no explicit weight (but may be covered by the overall pnl asset weight)."]; name: "maintBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "initBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "maintBaseLiabWeight"; type: { defined: "I80F48" } }, { name: "initBaseLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Number of base lots currently active in the market. Always >= 0.", "", "Since this counts positive base lots and negative base lots, the more relevant", "number of open base lot pairs is half this value."]; name: "openInterest"; type: "i64" }, { docs: ["Total number of orders seen"]; name: "seqNum"; type: "u64" }, { docs: ["Timestamp in seconds that the market was registered at."]; name: "registrationTime"; type: "u64" }, { docs: ["Minimal funding rate per day, must be <= 0."]; name: "minFunding"; type: { defined: "I80F48" } }, { docs: ["Maximal funding rate per day, must be >= 0."]; name: "maxFunding"; type: { defined: "I80F48" } }, { docs: ["For funding, get the impact price this many base lots deep into the book."]; name: "impactQuantity"; type: "i64" }, { docs: ["Current long funding value. Increasing it means that every long base lot", "needs to pay that amount of quote native in funding.", "", "PerpPosition uses and tracks it settle funding. Updated by the perp", "keeper instruction."]; name: "longFunding"; type: { defined: "I80F48" } }, { docs: ["See long_funding."]; name: "shortFunding"; type: { defined: "I80F48" } }, { docs: ["timestamp that funding was last updated in"]; name: "fundingLastUpdated"; type: "u64" }, { docs: ["Fees", "Fee for base position liquidation"]; name: "baseLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Fee when matching maker orders. May be negative."]; name: "makerFee"; type: { defined: "I80F48" } }, { docs: ["Fee for taker orders, may not be negative."]; name: "takerFee"; type: { defined: "I80F48" } }, { docs: ["Fees accrued in native quote currency", "these are increased when new fees are paid and decreased when perp_settle_fees is called"]; name: "feesAccrued"; type: { defined: "I80F48" } }, { docs: ["Fees settled in native quote currency", "these are increased when perp_settle_fees is called, and never decreased"]; name: "feesSettled"; type: { defined: "I80F48" } }, { docs: ["Fee (in quote native) to charge for ioc orders"]; name: "feePenalty"; type: "f32" }, { docs: ["In native units of settlement token, given to each settle call above the", "settle_fee_amount_threshold if settling at least 1% of perp base pos value."]; name: "settleFeeFlat"; type: "f32" }, { docs: ["Pnl settlement amount needed to be eligible for the flat fee."]; name: "settleFeeAmountThreshold"; type: "f32" }, { docs: ["Fraction of pnl to pay out as fee if +pnl account has low health.", "(limited to 2x settle_fee_flat)"]; name: "settleFeeFractionLowHealth"; type: "f32" }, { docs: ["Controls the strictness of the settle limit.", "Set to a negative value to disable the limit.", "", "This factor applies to the settle limit in two ways", "- for the unrealized pnl settle limit, the factor is multiplied with the stable perp base value", "(i.e. limit_factor * base_native * stable_price)", "- when increasing the realized pnl settle limit (stored per PerpPosition), the factor is", "multiplied with the stable value of the perp pnl being realized", "(i.e. limit_factor * reduced_native * stable_price)", "", "See also PerpPosition::settle_pnl_limit_realized_trade"]; name: "settlePnlLimitFactor"; type: "f32" }, { name: "padding3"; type: { array: ["u8", 4] } }, { docs: ["Window size in seconds for the perp settlement limit"]; name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { docs: ["If true, users may no longer increase their market exposure. Only actions", "that reduce their position are still allowed."]; name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding4"; type: { array: ["u8", 6] } }, { docs: ["Weights for full perp market health, if positive"]; name: "maintOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "initOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "positivePnlLiquidationFee"; type: { defined: "I80F48" } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were accrued during liquidation (in native tokens)", "", "These fees are also added to fees_accrued, this is just for bookkeeping the total", "liquidation fees that happened. So never decreases (different to fees_accrued)."]; name: "accruedLiquidationFees"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 1848] } }]; kind: "struct" } }, { name: "serum3Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "serumProgram"; type: "publicKey" }, { name: "serumMarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 1] } }, { docs: ["Limit orders must be <= oracle * (1+band) and >= oracle / (1+band)", "", "Zero value is the default due to migration and disables the limit,", "same as f32::MAX."]; name: "oraclePriceBand"; type: "f32" }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "serum3MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }]
                    • errors: [{ code: 6000; msg: ""; name: "SomeError" }, { code: 6001; msg: ""; name: "NotImplementedError" }, { code: 6002; msg: "checked math error"; name: "MathError" }, { code: 6003; msg: ""; name: "UnexpectedOracle" }, { code: 6004; msg: "oracle type cannot be determined"; name: "UnknownOracleType" }, { code: 6005; msg: ""; name: "InvalidFlashLoanTargetCpiProgram" }, { code: 6006; msg: "health must be positive"; name: "HealthMustBePositive" }, { code: 6007; msg: "health must be positive or not decrease"; name: "HealthMustBePositiveOrIncrease" }, { code: 6008; msg: "health must be negative"; name: "HealthMustBeNegative" }, { code: 6009; msg: "the account is bankrupt"; name: "IsBankrupt" }, { code: 6010; msg: "the account is not bankrupt"; name: "IsNotBankrupt" }, { code: 6011; msg: "no free token position index"; name: "NoFreeTokenPositionIndex" }, { code: 6012; msg: "no free serum3 open orders index"; name: "NoFreeSerum3OpenOrdersIndex" }, { code: 6013; msg: "no free perp position index"; name: "NoFreePerpPositionIndex" }, { code: 6014; msg: "serum3 open orders exist already"; name: "Serum3OpenOrdersExistAlready" }, { code: 6015; msg: "bank vault has insufficent funds"; name: "InsufficentBankVaultFunds" }, { code: 6016; msg: "account is currently being liquidated"; name: "BeingLiquidated" }, { code: 6017; msg: "invalid bank"; name: "InvalidBank" }, { code: 6018; msg: "account profitability is mismatched"; name: "ProfitabilityMismatch" }, { code: 6019; msg: "cannot settle with self"; name: "CannotSettleWithSelf" }, { code: 6020; msg: "perp position does not exist"; name: "PerpPositionDoesNotExist" }, { code: 6021; msg: "max settle amount must be greater than zero"; name: "MaxSettleAmountMustBeGreaterThanZero" }, { code: 6022; msg: "the perp position has open orders or unprocessed fill events"; name: "HasOpenPerpOrders" }, { code: 6023; msg: "an oracle does not reach the confidence threshold"; name: "OracleConfidence" }, { code: 6024; msg: "an oracle is stale"; name: "OracleStale" }, { code: 6025; msg: "settlement amount must always be positive"; name: "SettlementAmountMustBePositive" }, { code: 6026; msg: "bank utilization has reached limit"; name: "BankBorrowLimitReached" }, { code: 6027; msg: "bank net borrows has reached limit - this is an intermittent error - the limit will reset regularly"; name: "BankNetBorrowsLimitReached" }, { code: 6028; msg: "token position does not exist"; name: "TokenPositionDoesNotExist" }, { code: 6029; msg: "token deposits into accounts that are being liquidated must bring their health above the init threshold"; name: "DepositsIntoLiquidatingMustRecover" }, { code: 6030; msg: "token is in reduce only mode"; name: "TokenInReduceOnlyMode" }, { code: 6031; msg: "market is in reduce only mode"; name: "MarketInReduceOnlyMode" }, { code: 6032; msg: "group is halted"; name: "GroupIsHalted" }, { code: 6033; msg: "the perp position has non-zero base lots"; name: "PerpHasBaseLots" }, { code: 6034; msg: "there are open or unsettled serum3 orders"; name: "HasOpenOrUnsettledSerum3Orders" }, { code: 6035; msg: "has liquidatable token position"; name: "HasLiquidatableTokenPosition" }, { code: 6036; msg: "has liquidatable perp base position"; name: "HasLiquidatablePerpBasePosition" }, { code: 6037; msg: "has liquidatable positive perp pnl"; name: "HasLiquidatablePositivePerpPnl" }, { code: 6038; msg: "account is frozen"; name: "AccountIsFrozen" }, { code: 6039; msg: "Init Asset Weight can't be negative"; name: "InitAssetWeightCantBeNegative" }, { code: 6040; msg: "has open perp taker fills"; name: "HasOpenPerpTakerFills" }, { code: 6041; msg: "deposit crosses the current group deposit limit"; name: "DepositLimit" }, { code: 6042; msg: "instruction is disabled"; name: "IxIsDisabled" }, { code: 6043; msg: "no liquidatable perp base position"; name: "NoLiquidatablePerpBasePosition" }, { code: 6044; msg: "perp order id not found on the orderbook"; name: "PerpOrderIdNotFound" }, { code: 6045; msg: "HealthRegions allow only specific instructions between Begin and End"; name: "HealthRegionBadInnerInstruction" }, { code: 6046; msg: "token is in force close"; name: "TokenInForceClose" }, { code: 6047; msg: "incorrect number of health accounts"; name: "InvalidHealthAccountCount" }, { code: 6048; msg: "would self trade"; name: "WouldSelfTrade" }, { code: 6049; msg: "token conditional swap oracle price is not in execution range"; name: "TokenConditionalSwapPriceNotInRange" }, { code: 6050; msg: "token conditional swap is expired"; name: "TokenConditionalSwapExpired" }, { code: 6051; msg: "token conditional swap is not available yet"; name: "TokenConditionalSwapNotStarted" }, { code: 6052; msg: "token conditional swap was already started"; name: "TokenConditionalSwapAlreadyStarted" }, { code: 6053; msg: "token conditional swap it not set"; name: "TokenConditionalSwapNotSet" }, { code: 6054; msg: "token conditional swap trigger did not reach min_buy_token"; name: "TokenConditionalSwapMinBuyTokenNotReached" }, { code: 6055; msg: "token conditional swap cannot pay incentive"; name: "TokenConditionalSwapCantPayIncentive" }, { code: 6056; msg: "token conditional swap taker price is too low"; name: "TokenConditionalSwapTakerPriceTooLow" }, { code: 6057; msg: "token conditional swap index and id don't match"; name: "TokenConditionalSwapIndexIdMismatch" }, { code: 6058; msg: "token conditional swap volume is too small compared to the cost of starting it"; name: "TokenConditionalSwapTooSmallForStartIncentive" }, { code: 6059; msg: "token conditional swap type cannot be started"; name: "TokenConditionalSwapTypeNotStartable" }, { code: 6060; msg: "a bank in the health account list should be writable but is not"; name: "HealthAccountBankNotWritable" }, { code: 6061; msg: "the market does not allow limit orders too far from the current oracle value"; name: "Serum3PriceBandExceeded" }, { code: 6062; msg: "deposit crosses the token's deposit limit"; name: "BankDepositLimit" }, { code: 6063; msg: "delegates can only withdraw to the owner's associated token account"; name: "DelegateWithdrawOnlyToOwnerAta" }, { code: 6064; msg: "delegates can only withdraw if they close the token position"; name: "DelegateWithdrawMustClosePosition" }, { code: 6065; msg: "delegates can only withdraw small amounts"; name: "DelegateWithdrawSmall" }, { code: 6066; msg: "The provided CLMM oracle is not valid"; name: "InvalidCLMMOracle" }, { code: 6067; msg: "invalid usdc/usd feed provided for the CLMM oracle"; name: "InvalidFeedForCLMMOracle" }, { code: 6068; msg: "Pyth USDC/USD or SOL/USD feed not found (required by CLMM oracle)"; name: "MissingFeedForCLMMOracle" }, { code: 6069; msg: "the asset does not allow liquidation"; name: "TokenAssetLiquidationDisabled" }]
                    • events: [{ fields: [{ index: false; name: "initHealth"; type: { defined: "I80F48" } }, { index: false; name: "maintHealth"; type: { defined: "I80F48" } }, { index: false; name: "equity"; type: { defined: "Equity" } }]; name: "MangoAccountData" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "basePosition"; type: "i64" }, { index: false; name: "quotePosition"; type: "i128" }, { index: false; name: "longSettledFunding"; type: "i128" }, { index: false; name: "shortSettledFunding"; type: "i128" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }]; name: "PerpBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "indexedPosition"; type: "i128" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }]; name: "TokenBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetail" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV2" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV3" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "WithdrawLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "DepositLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerOrderId"; type: "u128" }, { index: false; name: "makerFee"; type: "i128" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerOrderId"; type: "u128" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "i128" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }, { index: false; name: "makerClosedPnl"; type: "f64" }, { index: false; name: "takerClosedPnl"; type: "f64" }]; name: "FillLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "oracleConfidence"; type: "i128" }, { index: false; name: "oracleType"; type: { defined: "OracleType" } }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }, { index: false; name: "avgUtilization"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "collectedFees"; type: "i128" }, { index: false; name: "loanFeeRate"; type: "i128" }, { index: false; name: "totalBorrows"; type: "i128" }, { index: false; name: "totalDeposits"; type: "i128" }, { index: false; name: "borrowRate"; type: "i128" }, { index: false; name: "depositRate"; type: "i128" }]; name: "UpdateIndexLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }]; name: "UpdateRateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "util0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "util1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }, { index: false; name: "curveScaling"; type: "f64" }, { index: false; name: "targetUtilization"; type: "f32" }]; name: "UpdateRateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }]; name: "WithdrawLoanOriginationFeeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanAmount"; type: "i128" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }, { index: false; name: "price"; type: { option: "i128" } }]; name: "WithdrawLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "initialLiabNative"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "insuranceTokenIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLiabDepositIndex"; type: "i128" }, { index: false; name: "endingLiabDepositIndex"; type: "i128" }]; name: "TokenLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "cumulativeDepositInterest"; type: "f64" }, { index: false; name: "cumulativeBorrowInterest"; type: "f64" }]; name: "DeactivateTokenPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "cumulativeLongFunding"; type: "f64" }, { index: false; name: "cumulativeShortFunding"; type: "f64" }, { index: false; name: "makerVolume"; type: "u64" }, { index: false; name: "takerVolume"; type: "u64" }, { index: false; name: "perpSpotTransfers"; type: "i64" }]; name: "DeactivatePerpPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "fallbackOracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarket"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "baseDecimals"; type: "u8" }, { index: false; name: "baseLotSize"; type: "i64" }, { index: false; name: "quoteLotSize"; type: "i64" }, { index: false; name: "oracle"; type: "publicKey" }]; name: "PerpMarketMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "serumMarket"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "serumProgram"; type: "publicKey" }, { index: false; name: "serumProgramExternal"; type: "publicKey" }]; name: "Serum3RegisterMarketLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransferLiqee"; type: "i64" }, { index: false; name: "quoteTransferLiqee"; type: "i128" }, { index: false; name: "quoteTransferLiqor"; type: "i128" }, { index: false; name: "quotePlatformFee"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLongFunding"; type: "i128" }, { index: false; name: "startingShortFunding"; type: "i128" }, { index: false; name: "endingLongFunding"; type: "i128" }, { index: false; name: "endingShortFunding"; type: "i128" }]; name: "PerpLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpLiqNegativePnlOrBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccountA"; type: "publicKey" }, { index: false; name: "mangoAccountB"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }, { index: false; name: "settler"; type: "publicKey" }, { index: false; name: "fee"; type: "i128" }]; name: "PerpSettlePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpSettleFeesLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "buybackFees"; type: "i128" }, { index: false; name: "buybackMngo"; type: "i128" }, { index: false; name: "mngoBuybackPrice"; type: "i128" }, { index: false; name: "oraclePrice"; type: "i128" }]; name: "AccountBuybackFeesWithMngoLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "seqNum"; type: "u64" }]; name: "FilledPerpOrderLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "totalBaseLotsTaken"; type: "i64" }, { index: false; name: "totalBaseLotsDecremented"; type: "i64" }, { index: false; name: "totalQuoteLotsTaken"; type: "i64" }, { index: false; name: "totalQuoteLotsDecremented"; type: "i64" }, { index: false; name: "takerFeesPaid"; type: "i128" }, { index: false; name: "feePenalty"; type: "i128" }]; name: "PerpTakerTradeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "accountA"; type: "publicKey" }, { index: false; name: "accountB"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpForceClosePositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }]; name: "TokenConditionalSwapCreateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapCreateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }, { index: false; name: "durationSeconds"; type: "u64" }]; name: "TokenConditionalSwapCreateLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }]; name: "TokenConditionalSwapTriggerLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapTriggerLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }]; name: "TokenConditionalSwapTriggerLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }]; name: "TokenConditionalSwapCancelLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "caller"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "incentiveTokenIndex"; type: "u16" }, { index: false; name: "incentiveAmount"; type: "u64" }]; name: "TokenConditionalSwapStartLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "assetUsageFraction"; type: "i128" }, { index: false; name: "fee"; type: "i128" }]; name: "TokenCollateralFeeLog" }]
                    • instructions: [{ accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminTokenWithdrawFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminPerpWithdrawFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Group" }, { kind: "account"; path: "creator"; type: "publicKey" }, { kind: "arg"; path: "group_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "creator" }, { isMut: false; isSigner: false; name: "insuranceMint" }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "InsuranceVault" }, { kind: "account"; path: "group"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "groupNum"; type: "u32" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }]; name: "groupCreate" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "adminOpt"; type: { option: "publicKey" } }, { name: "fastListingAdminOpt"; type: { option: "publicKey" } }, { name: "securityAdminOpt"; type: { option: "publicKey" } }, { name: "testingOpt"; type: { option: "u8" } }, { name: "versionOpt"; type: { option: "u8" } }, { name: "depositLimitQuoteOpt"; type: { option: "u64" } }, { name: "buybackFeesOpt"; type: { option: "bool" } }, { name: "buybackFeesBonusFactorOpt"; type: { option: "f32" } }, { name: "buybackFeesSwapMangoAccountOpt"; type: { option: "publicKey" } }, { name: "mngoTokenIndexOpt"; type: { option: "u16" } }, { name: "buybackFeesExpiryIntervalOpt"; type: { option: "u64" } }, { name: "allowedFastListingsPerIntervalOpt"; type: { option: "u16" } }, { name: "collateralFeeIntervalOpt"; type: { option: "u64" } }]; name: "groupEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault", "admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "destination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "groupWithdrawInsuranceFund" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "ixGate"; type: "u128" }]; name: "ixGateSet" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin", "insurance_vault"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "groupClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "interestRateParams"; type: { defined: "InterestRateParams" } }, { name: "loanFeeRate"; type: "f32" }, { name: "loanOriginationFeeRate"; type: "f32" }, { name: "maintAssetWeight"; type: "f32" }, { name: "initAssetWeight"; type: "f32" }, { name: "maintLiabWeight"; type: "f32" }, { name: "initLiabWeight"; type: "f32" }, { name: "liquidationFee"; type: "f32" }, { name: "stablePriceDelayIntervalSeconds"; type: "u32" }, { name: "stablePriceDelayGrowthLimit"; type: "f32" }, { name: "stablePriceGrowthLimit"; type: "f32" }, { name: "minVaultToDepositsRatio"; type: "f64" }, { name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { name: "borrowWeightScaleStartQuote"; type: "f64" }, { name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { name: "interestCurveScaling"; type: "f32" }, { name: "interestTargetUtilization"; type: "f32" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "depositLimit"; type: "u64" }, { name: "zeroUtilRate"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }, { name: "disableAssetLiquidation"; type: "bool" }, { name: "collateralFeePerDay"; type: "f32" }]; name: "tokenRegister" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }]; name: "tokenRegisterTrustless" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }, { docs: ["The fallback oracle account is optional and only used when set_fallback_oracle is true.", ""]; isMut: false; isSigner: false; name: "fallbackOracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "interestRateParamsOpt"; type: { option: { defined: "InterestRateParams" } } }, { name: "loanFeeRateOpt"; type: { option: "f32" } }, { name: "loanOriginationFeeRateOpt"; type: { option: "f32" } }, { name: "maintAssetWeightOpt"; type: { option: "f32" } }, { name: "initAssetWeightOpt"; type: { option: "f32" } }, { name: "maintLiabWeightOpt"; type: { option: "f32" } }, { name: "initLiabWeightOpt"; type: { option: "f32" } }, { name: "liquidationFeeOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "minVaultToDepositsRatioOpt"; type: { option: "f64" } }, { name: "netBorrowLimitPerWindowQuoteOpt"; type: { option: "i64" } }, { name: "netBorrowLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "borrowWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "depositWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "resetStablePrice"; type: "bool" }, { name: "resetNetBorrowLimit"; type: "bool" }, { name: "reduceOnlyOpt"; type: { option: "u8" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "tokenConditionalSwapTakerFeeRateOpt"; type: { option: "f32" } }, { name: "tokenConditionalSwapMakerFeeRateOpt"; type: { option: "f32" } }, { name: "flashLoanSwapFeeRateOpt"; type: { option: "f32" } }, { name: "interestCurveScalingOpt"; type: { option: "f32" } }, { name: "interestTargetUtilizationOpt"; type: { option: "f32" } }, { name: "maintWeightShiftStartOpt"; type: { option: "u64" } }, { name: "maintWeightShiftEndOpt"; type: { option: "u64" } }, { name: "maintWeightShiftAssetTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftLiabTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftAbort"; type: "bool" }, { name: "setFallbackOracle"; type: "bool" }, { name: "depositLimitOpt"; type: { option: "u64" } }, { name: "zeroUtilRateOpt"; type: { option: "f32" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }, { name: "disableAssetLiquidationOpt"; type: { option: "bool" } }, { name: "collateralFeePerDayOpt"; type: { option: "f32" } }]; name: "tokenEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: false; isSigner: false; name: "existingBank"; relations: ["group", "mint"] }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group", "mint"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "bankNum"; type: "u32" }]; name: "tokenAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "dustVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "tokenDeregister" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "mintInfo"; relations: ["oracle", "group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "instructions" }]; args: []; name: "tokenUpdateIndexAndRate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }]; name: "accountExpand" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }]; name: "accountExpandV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "accountSizeMigration" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }]; args: [{ name: "nameOpt"; type: { option: "string" } }, { name: "delegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateExpiryOpt"; type: { option: "u64" } }]; name: "accountEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "freeze"; type: "bool" }]; name: "accountToggleFreeze" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "forceClose"; type: "bool" }]; name: "accountClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "daoAccount"; relations: ["group"] }, { isMut: true; isSigner: false; name: "mngoBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "mngoOracle" }, { isMut: true; isSigner: false; name: "feesBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "feesOracle" }]; args: [{ name: "maxBuybackUsd"; type: "u64" }]; name: "accountBuybackFeesWithMngo" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: true; name: "oracle" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "stubOracleClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }]; name: "stubOracleSetTest" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDepositIntoExisting" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "allowBorrow"; type: "bool" }]; name: "tokenWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmounts"; type: { vec: "u64" } }]; name: "flashLoanBegin" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: true; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "inputMint" }, { isMut: false; isSigner: false; name: "outputMint" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "associatedTokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmount"; type: "u64" }]; docs: ["A version of flash_loan_begin that's specialized for swaps and needs fewer", "bytes in the transaction"]; name: "flashLoanSwapBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "numLoans"; type: "u8" }, { name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEndV2" }, { accounts: [{ docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }, { isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "healthRegionBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }]; args: []; name: "healthRegionEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { docs: ["group admin or fast listing admin, checked at #1"]; isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "serumMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "serum_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oraclePriceBand"; type: "f32" }]; docs: ["", "Serum", ""]; name: "serum3RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "oraclePriceBandOpt"; type: { option: "f32" } }]; name: "serum3EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "serumMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "serum3DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3OO" }, { kind: "account"; path: "account"; type: "publicKey" }, { kind: "account"; path: "serum_market"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: []; name: "serum3CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "serum3CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "serum3PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; docs: ["requires the receiver_bank in the health account list to be writable"]; name: "serum3PlaceOrderV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "orderId"; type: "u128" }]; name: "serum3CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "serum3CancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Deprecated instruction that used to settles all free funds from the OpenOrders account", "into the MangoAccount.", "", "Any serum \"referrer rebates\" (ui fees) are considered Mango fees."]; name: "serum3SettleFunds" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; name: "v1" }, { accounts: [{ isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }]; name: "v2" }]; args: [{ name: "feesToDao"; type: "bool" }]; docs: ["Like Serum3SettleFunds, but `fees_to_dao` determines if referrer rebates are considered fees", "or are credited to the MangoAccount."]; name: "serum3SettleFundsV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: "u64" }]; name: "tokenForceCloseBorrowsWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "perpMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "PerpMarket" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "perp_market_index"; type: "u16" }] } }, { docs: ["Accounts are initialised by client,", "anchor discriminator is set first when ix exits,"]; isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "perpMarketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "baseDecimals"; type: "u8" }, { name: "quoteLotSize"; type: "i64" }, { name: "baseLotSize"; type: "i64" }, { name: "maintBaseAssetWeight"; type: "f32" }, { name: "initBaseAssetWeight"; type: "f32" }, { name: "maintBaseLiabWeight"; type: "f32" }, { name: "initBaseLiabWeight"; type: "f32" }, { name: "maintOverallAssetWeight"; type: "f32" }, { name: "initOverallAssetWeight"; type: "f32" }, { name: "baseLiquidationFee"; type: "f32" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "minFunding"; type: "f32" }, { name: "maxFunding"; type: "f32" }, { name: "impactQuantity"; type: "i64" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "feePenalty"; type: "f32" }, { name: "settleFeeFlat"; type: "f32" }, { name: "settleFeeAmountThreshold"; type: "f32" }, { name: "settleFeeFractionLowHealth"; type: "f32" }, { name: "settleTokenIndex"; type: "u16" }, { name: "settlePnlLimitFactor"; type: "f32" }, { name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { name: "positivePnlLiquidationFee"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }]; docs: ["", "Perps", ""]; name: "perpCreateMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "baseDecimalsOpt"; type: { option: "u8" } }, { name: "maintBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "initBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "maintBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "initBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "maintOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "initOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "baseLiquidationFeeOpt"; type: { option: "f32" } }, { name: "makerFeeOpt"; type: { option: "f32" } }, { name: "takerFeeOpt"; type: { option: "f32" } }, { name: "minFundingOpt"; type: { option: "f32" } }, { name: "maxFundingOpt"; type: { option: "f32" } }, { name: "impactQuantityOpt"; type: { option: "i64" } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "feePenaltyOpt"; type: { option: "f32" } }, { name: "settleFeeFlatOpt"; type: { option: "f32" } }, { name: "settleFeeAmountThresholdOpt"; type: { option: "f32" } }, { name: "settleFeeFractionLowHealthOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "settlePnlLimitFactorOpt"; type: { option: "f32" } }, { name: "settlePnlLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "resetStablePrice"; type: "bool" }, { name: "positivePnlLiquidationFeeOpt"; type: { option: "f32" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }]; name: "perpEditMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "perpCloseMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group"] }]; args: []; name: "perpDeactivatePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrder"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrderV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPegged"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPeggedV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "orderId"; type: "u128" }]; name: "perpCancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "perpCancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpCancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "sideOption"; type: { option: { defined: "Side" } } }, { name: "limit"; type: "u8" }]; name: "perpCancelAllOrdersBySide" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "event_queue"] }, { isMut: true; isSigner: false; name: "eventQueue" }]; args: [{ name: "limit"; type: "u64" }]; name: "perpConsumeEvents" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpUpdateFunding" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "settler"; relations: ["group"] }, { isMut: false; isSigner: true; name: "settlerOwner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: []; name: "perpSettlePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpForceClosePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxSettleAmount"; type: "u64" }]; name: "perpSettleFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxBaseTransfer"; type: "i64" }, { name: "maxPnlTransfer"; type: "u64" }]; name: "perpLiqBaseOrPositivePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpLiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "insuranceBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "insuranceBankVault" }, { isMut: false; isSigner: false; name: "insuranceOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcyV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }]; name: "tokenConditionalSwapCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }]; name: "tokenConditionalSwapCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "maxPricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreatePremiumAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceStart"; type: "f64" }, { name: "priceEnd"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "startTimestamp"; type: "u64" }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreateLinearAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { docs: ["The bank's token_index is checked at #1"]; isMut: true; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapCancel" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }]; name: "tokenConditionalSwapTrigger" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }, { name: "minBuyToken"; type: "u64" }, { name: "minTakerPrice"; type: "f32" }]; name: "tokenConditionalSwapTriggerV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapStart" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "tokenChargeCollateralFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }]; name: "altSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: true; name: "payer" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }, { name: "newAddresses"; type: { vec: "publicKey" } }]; name: "altExtend" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }]; args: []; docs: ["Warning, this instruction is for testing purposes only!"]; name: "computeAccountData" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openbookV2Market"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }]; docs: ["", "OpenbookV2", ""]; name: "openbookV2RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }]; name: "openbookV2EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "openbookV2Market"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "openbookV2DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { programId: { kind: "account"; path: "openbook_v2_program"; type: "publicKey" }; seeds: [{ kind: "const"; type: "string"; value: "OpenOrders" }, { kind: "account"; path: "openbook_v2_market"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "accountNum"; type: "u32" }]; name: "openbookV2CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "openbookV2CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "orderType"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceTakerOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "side"; type: "u8" }, { name: "orderId"; type: "u128" }]; name: "openbookV2CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "feesToDao"; type: "bool" }]; name: "openbookV2SettleFunds" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "dummy" }]; args: []; docs: ["", "benchmark", ""]; name: "benchmark" }]
                    • name: "mango_v4"
                    • types: [{ name: "InterestRateParams"; type: { fields: [{ name: "util0"; type: "f32" }, { name: "rate0"; type: "f32" }, { name: "util1"; type: "f32" }, { name: "rate1"; type: "f32" }, { name: "maxRate"; type: "f32" }, { name: "adjustmentFactor"; type: "f32" }]; kind: "struct" } }, { name: "Equity"; type: { fields: [{ name: "tokens"; type: { vec: { defined: "TokenEquity" } } }, { name: "perps"; type: { vec: { defined: "PerpEquity" } } }]; kind: "struct" } }, { name: "TokenEquity"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "PerpEquity"; type: { fields: [{ name: "perpMarketIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "FlashLoanTokenDetail"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "changeAmount"; type: "i128" }, { name: "loan"; type: "i128" }, { name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV2"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Deposit fee paid for positive change_amount.", "", "Not factored into change_amount."]; name: "depositFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV3"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Swap fee paid on the in token of a swap.", "", "Not factored into change_amount."]; name: "swapFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "TokenPosition"; type: { fields: [{ docs: ["The deposit_index (if positive) or borrow_index (if negative) scaled position"]; name: "indexedPosition"; type: { defined: "I80F48" } }, { docs: ["index into Group.tokens"]; name: "tokenIndex"; type: "u16" }, { docs: ["incremented when a market requires this position to stay alive"]; name: "inUseCount"; type: "u16" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "previousIndex"; type: { defined: "I80F48" } }, { name: "cumulativeDepositInterest"; type: "f64" }, { name: "cumulativeBorrowInterest"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "Serum3Orders"; type: { fields: [{ name: "openOrders"; type: "publicKey" }, { docs: ["Tracks the amount of borrows that have flowed into the serum open orders account.", "These borrows did not have the loan origination fee applied, and that may happen", "later (in serum3_settle_funds) if we can guarantee that the funds were used.", "In particular a place-on-book, cancel, settle should not cost fees."]; name: "baseBorrowsWithoutFee"; type: "u64" }, { name: "quoteBorrowsWithoutFee"; type: "u64" }, { name: "marketIndex"; type: "u16" }, { docs: ["Store the base/quote token index, so health computations don't need", "to get passed the static SerumMarket to find which tokens a market", "uses and look up the correct oracles."]; name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Track something like the highest open bid / lowest open ask, in native/native units.", "", "Tracking it exactly isn't possible since we don't see fills. So instead track", "the min/max of the _placed_ bids and asks.", "", "The value is reset in serum3_place_order when a new order is placed without an", "existing one on the book.", "", "0 is a special \"unset\" state."]; name: "highestPlacedBidInv"; type: "f64" }, { name: "lowestPlacedAsk"; type: "f64" }, { docs: ["An overestimate of the amount of tokens that might flow out of the open orders account.", "", "The bank still considers these amounts user deposits (see Bank::potential_serum_tokens)", "and that value needs to be updated in conjunction with these numbers.", "", "This estimation is based on the amount of tokens in the open orders account", "(see update_bank_potential_tokens() in serum3_place_order and settle)"]; name: "potentialBaseTokens"; type: "u64" }, { name: "potentialQuoteTokens"; type: "u64" }, { docs: ["Track lowest bid/highest ask, same way as for highest bid/lowest ask.", "", "0 is a special \"unset\" state."]; name: "lowestPlacedBidInv"; type: "f64" }, { name: "highestPlacedAsk"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 16] } }]; kind: "struct" } }, { name: "PerpPosition"; type: { fields: [{ name: "marketIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Index of the current settle pnl limit window"]; name: "settlePnlLimitWindow"; type: "u32" }, { docs: ["Amount of realized trade pnl and unrealized pnl that was already settled this window.", "", "Will be negative when negative pnl was settled.", "", "Note that this will be adjusted for bookkeeping reasons when the realized_trade settle", "limitchanges and is not useable for actually tracking how much pnl was settled", "on balance."]; name: "settlePnlLimitSettledInCurrentWindowNative"; type: "i64" }, { docs: ["Active position size, measured in base lots"]; name: "basePositionLots"; type: "i64" }, { docs: ["Active position in oracle quote native. At the same time this is 1:1 a settle_token native amount.", "", "Example: Say there's a perp market on the BTC/USD price using SOL for settlement. The user buys", "one long contract for $20k, then base = 1, quote = -20k. The price goes to $21k. Now their", "unsettled pnl is (1 * 21k - 20k) __SOL__ = 1000 SOL. This is because the perp contract arbitrarily", "decides that each unit of price difference creates 1 SOL worth of settlement.", "(yes, causing 1 SOL of settlement for each $1 price change implies a lot of extra leverage; likely", "there should be an extra configurable scaling factor before we use this for cases like that)"]; name: "quotePositionNative"; type: { defined: "I80F48" } }, { docs: ["Tracks what the position is to calculate average entry & break even price"]; name: "quoteRunningNative"; type: "i64" }, { docs: ["Already settled long funding"]; name: "longSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Already settled short funding"]; name: "shortSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { docs: ["Amount of base lots on the EventQueue waiting to be processed"]; name: "takerBaseLots"; type: "i64" }, { docs: ["Amount of quote lots on the EventQueue waiting to be processed"]; name: "takerQuoteLots"; type: "i64" }, { docs: ["Cumulative long funding in quote native units.", "If the user paid $1 in funding for a long position, this would be 1e6.", "Beware of the sign!", "", "(Display only)"]; name: "cumulativeLongFunding"; type: "f64" }, { docs: ["Cumulative short funding in quote native units", "If the user paid $1 in funding for a short position, this would be -1e6.", "", "(Display only)"]; name: "cumulativeShortFunding"; type: "f64" }, { docs: ["Cumulative maker volume in quote native units", "", "(Display only)"]; name: "makerVolume"; type: "u64" }, { docs: ["Cumulative taker volume in quote native units", "", "(Display only)"]; name: "takerVolume"; type: "u64" }, { docs: ["Cumulative number of quote native units transfered from the perp position", "to the settle token spot position.", "", "For example, if the user settled $1 of positive pnl into their USDC spot", "position, this would be 1e6.", "", "(Display only)"]; name: "perpSpotTransfers"; type: "i64" }, { docs: ["The native average entry price for the base lots of the current position.", "Reset to 0 when the base position reaches or crosses 0."]; name: "avgEntryPricePerBaseLot"; type: "f64" }, { docs: ["Deprecated field: Amount of pnl that was realized by bringing the base position closer to 0."]; name: "deprecatedRealizedTradePnlNative"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled once.", "", "- The value is signed: a negative number means negative pnl can be settled.", "- A settlement in the right direction will decrease this amount.", "", "Typically added for fees, funding and liquidation."]; name: "oneshotSettlePnlAllowance"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled in each settle window.", "", "- Unsigned, the settlement can happen in both directions. Value is >= 0.", "- Previously stored a similar value that was signed, so in migration cases", "this value can be negative and should be .abs()ed.", "- If this value exceeds the current stable-upnl, it should be decreased,", "see apply_recurring_settle_pnl_allowance_constraint()", "", "When the base position is reduced, the settle limit contribution from the reduced", "base position is materialized into this value. When the base position increases,", "some of the allowance is taken away.", "", "This also gets increased when a liquidator takes over pnl."]; name: "recurringSettlePnlAllowance"; type: "i64" }, { docs: ["Trade pnl, fees, funding that were added over the current position's lifetime.", "", "Reset when the position changes sign or goes to zero.", "Not decreased by settling.", "", "This is tracked for display purposes: this value plus the difference between entry", "price and current price of the base position is the overall pnl."]; name: "realizedPnlForPositionNative"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { name: "PerpOpenOrder"; type: { fields: [{ name: "sideAndTree"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 1] } }, { name: "market"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { name: "clientId"; type: "u64" }, { name: "id"; type: "u128" }, { name: "quantity"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 56] } }]; kind: "struct" } }, { name: "MangoAccountFixed"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { name: "beingLiquidated"; type: "u8" }, { name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { name: "buybackFeesAccruedCurrent"; type: "u64" }, { name: "buybackFeesAccruedPrevious"; type: "u64" }, { name: "buybackFeesExpiryTimestamp"; type: "u64" }, { name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "confFilter"; type: { defined: "I80F48" } }, { name: "maxStalenessSlots"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { name: "OracleConfigParams"; type: { fields: [{ name: "confFilter"; type: "f32" }, { name: "maxStalenessSlots"; type: { option: "u32" } }]; kind: "struct" } }, { docs: ["InnerNodes and LeafNodes compose the binary tree of orders.", "", "Each InnerNode has exactly two children, which are either InnerNodes themselves,", "or LeafNodes. The children share the top `prefix_len` bits of `key`. The left", "child has a 0 in the next bit, and the right a 1."]; name: "InnerNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { docs: ["number of highest `key` bits that all children share", "e.g. if it's 2, the two highest bits of `key` will be the same on all children"]; name: "prefixLen"; type: "u32" }, { docs: ["only the top `prefix_len` bits of `key` are relevant"]; name: "key"; type: "u128" }, { docs: ["indexes into `BookSide::nodes`"]; name: "children"; type: { array: ["u32", 2] } }, { docs: ["The earliest expiry timestamp for the left and right subtrees.", "", "Needed to be able to find and remove expired orders without having to", "iterate through the whole bookside."]; name: "childEarliestExpiry"; type: { array: ["u64", 2] } }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { docs: ["LeafNodes represent an order in the binary tree"]; name: "LeafNode"; type: { fields: [{ docs: ["NodeTag"]; name: "tag"; type: "u8" }, { docs: ["Index into the owning MangoAccount's PerpOpenOrders"]; name: "ownerSlot"; type: "u8" }, { docs: ["PostOrderType, this was added for TradingView move order"]; name: "orderType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { docs: ["Time in seconds after `timestamp` at which the order expires.", "A value of 0 means no expiry."]; name: "timeInForce"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 2] } }, { docs: ["The binary tree key, see new_node_key()"]; name: "key"; type: "u128" }, { docs: ["Address of the owning MangoAccount"]; name: "owner"; type: "publicKey" }, { docs: ["Number of base lots to buy or sell, always >=1"]; name: "quantity"; type: "i64" }, { docs: ["The time the order was placed"]; name: "timestamp"; type: "u64" }, { docs: ["If the effective price of an oracle pegged order exceeds this limit,", "it will be considered invalid and may be removed.", "", "Only applicable in the oracle_pegged OrderTree"]; name: "pegLimit"; type: "i64" }, { docs: ["User defined id for this order, used in FillEvents"]; name: "clientOrderId"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 32] } }]; kind: "struct" } }, { name: "AnyNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "data"; type: { array: ["u8", 119] } }]; kind: "struct" } }, { name: "OrderTreeRoot"; type: { fields: [{ name: "maybeNode"; type: "u32" }, { name: "leafCount"; type: "u32" }]; kind: "struct" } }, { docs: ["A binary tree on AnyNode::key()", "", "The key encodes the price in the top 64 bits."]; name: "OrderTreeNodes"; type: { fields: [{ name: "orderTreeType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { name: "bumpIndex"; type: "u32" }, { name: "freeListLen"; type: "u32" }, { name: "freeListHead"; type: "u32" }, { name: "reserved"; type: { array: ["u8", 512] } }, { name: "nodes"; type: { array: [{ defined: "AnyNode" }, 1024] } }]; kind: "struct" } }, { name: "EventQueueHeader"; type: { fields: [{ name: "head"; type: "u32" }, { name: "count"; type: "u32" }, { name: "seqNum"; type: "u64" }]; kind: "struct" } }, { name: "AnyEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 207] } }]; kind: "struct" } }, { name: "FillEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "takerSide"; type: "u8" }, { name: "makerOut"; type: "u8" }, { name: "makerSlot"; type: "u8" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "maker"; type: "publicKey" }, { name: "padding2"; type: { array: ["u8", 32] } }, { name: "makerTimestamp"; type: "u64" }, { name: "taker"; type: "publicKey" }, { name: "padding3"; type: { array: ["u8", 16] } }, { name: "takerClientOrderId"; type: "u64" }, { name: "makerOrderId"; type: "u128" }, { name: "price"; type: "i64" }, { name: "quantity"; type: "i64" }, { name: "makerClientOrderId"; type: "u64" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 8] } }]; kind: "struct" } }, { name: "OutEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "side"; type: "u8" }, { name: "ownerSlot"; type: "u8" }, { name: "padding0"; type: { array: ["u8", 5] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "owner"; type: "publicKey" }, { name: "quantity"; type: "i64" }, { name: "orderId"; type: "u128" }, { name: "padding1"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { docs: ["Maintains a \"stable_price\" based on the oracle price.", "", "The stable price follows the oracle price, but its relative rate of", "change is limited (to `stable_growth_limit`) and futher reduced if", "the oracle price is far from the `delay_price`.", "", "Conceptually the `delay_price` is itself a time delayed", "(`24 * delay_interval_seconds`, assume 24h) and relative rate of change limited", "function of the oracle price. It is implemented as averaging the oracle", "price over every `delay_interval_seconds` (assume 1h) and then applying the", "`delay_growth_limit` between intervals."]; name: "StablePriceModel"; type: { fields: [{ docs: ["Current stable price to use in health"]; name: "stablePrice"; type: "f64" }, { name: "lastUpdateTimestamp"; type: "u64" }, { docs: ["Stored delay_price for each delay_interval.", "If we want the delay_price to be 24h delayed, we would store one for each hour.", "This is used in a cyclical way: We use the maximally-delayed value at delay_interval_index", "and once enough time passes to move to the next delay interval, that gets overwritten and", "we use the next one."]; name: "delayPrices"; type: { array: ["f64", 24] } }, { docs: ["The delay price is based on an average over each delay_interval. The contributions", "to the average are summed up here."]; name: "delayAccumulatorPrice"; type: "f64" }, { docs: ["Accumulating the total time for the above average."]; name: "delayAccumulatorTime"; type: "u32" }, { docs: ["Length of a delay_interval"]; name: "delayIntervalSeconds"; type: "u32" }, { docs: ["Maximal relative difference between two delay_price in consecutive intervals."]; name: "delayGrowthLimit"; type: "f32" }, { docs: ["Maximal per-second relative difference of the stable price.", "It gets further reduced if stable and delay price disagree."]; name: "stableGrowthLimit"; type: "f32" }, { docs: ["The delay_interval_index that update() was last called on."]; name: "lastDelayIntervalIndex"; type: "u8" }, { docs: ["If set to 1, the stable price will reset on the next non-zero price it sees."]; name: "resetOnNonzeroPrice"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { name: "reserved"; type: { array: ["u8", 48] } }]; kind: "struct" } }, { name: "TokenConditionalSwap"; type: { fields: [{ name: "id"; type: "u64" }, { docs: ["maximum amount of native tokens to buy or sell"]; name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { docs: ["how many native tokens were already bought/sold"]; name: "bought"; type: "u64" }, { name: "sold"; type: "u64" }, { docs: ["timestamp until which the conditional swap is valid"]; name: "expiryTimestamp"; type: "u64" }, { docs: ["The lower or starting price:", "- For FixedPremium or PremiumAuctions, it's the lower end of the price range:", "the tcs can only be triggered if the oracle price exceeds this value.", "- For LinearAuctions it's the starting price that's offered at start_timestamp.", "", "The price is always in \"sell_token per buy_token\" units, which can be computed", "by dividing the buy token price by the sell token price.", "", "For FixedPremium or PremiumAuctions:", "", "The price must exceed this threshold to allow execution.", "", "This threshold is compared to the \"sell_token per buy_token\" oracle price.", "If that price is >= lower_limit and <= upper_limit the tcs may be executable.", "", "Example: Stop loss to get out of a SOL long: The user bought SOL at 20 USDC/SOL", "and wants to stop loss at 18 USDC/SOL. They'd set buy_token=USDC, sell_token=SOL", "so the reference price is in SOL/USDC units. Set price_lower_limit=toNative(1/18)", "and price_upper_limit=toNative(1/10). Also set allow_borrows=false.", "", "Example: Want to buy SOL with USDC if the price falls below 22 USDC/SOL.", "buy_token=SOL, sell_token=USDC, reference price is in USDC/SOL units. Set", "price_upper_limit=toNative(22), price_lower_limit=0."]; name: "priceLowerLimit"; type: "f64" }, { docs: ["Parallel to price_lower_limit, but an upper limit / auction end price."]; name: "priceUpperLimit"; type: "f64" }, { docs: ["The premium to pay over oracle price to incentivize execution."]; name: "pricePremiumRate"; type: "f64" }, { docs: ["The taker receives only premium_price * (1 - taker_fee_rate)"]; name: "takerFeeRate"; type: "f32" }, { docs: ["The maker has to pay premium_price * (1 + maker_fee_rate)"]; name: "makerFeeRate"; type: "f32" }, { docs: ["indexes of tokens for the swap"]; name: "buyTokenIndex"; type: "u16" }, { name: "sellTokenIndex"; type: "u16" }, { docs: ["If this struct is in use. (tcs are stored in a static-length array)"]; name: "isConfigured"; type: "u8" }, { docs: ["may token purchases create deposits? (often users just want to get out of a borrow)"]; name: "allowCreatingDeposits"; type: "u8" }, { docs: ["may token selling create borrows? (often users just want to get out of a long)"]; name: "allowCreatingBorrows"; type: "u8" }, { docs: ["The stored prices are always \"sell token per buy token\", but if the user", "used \"buy token per sell token\" when creating the tcs order, we should continue", "to show them prices in that way.", "", "Stores a TokenConditionalSwapDisplayPriceStyle enum value"]; name: "displayPriceStyle"; type: "u8" }, { docs: ["The intention the user had when placing this order, display-only", "", "Stores a TokenConditionalSwapIntention enum value"]; name: "intention"; type: "u8" }, { docs: ["Stores a TokenConditionalSwapType enum value"]; name: "tcsType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { docs: ["In seconds since epoch. 0 means not-started.", "", "FixedPremium: Time of first trigger call. No other effect.", "PremiumAuction: Time of start or first trigger call. Can continue to trigger once started.", "LinearAuction: Set during creation, auction starts with price_lower_limit at this timestamp."]; name: "startTimestamp"; type: "u64" }, { docs: ["Duration of the auction mechanism", "", "FixedPremium: ignored", "PremiumAuction: time after start that the premium needs to scale to price_premium_rate", "LinearAuction: time after start to go from price_lower_limit to price_upper_limit"]; name: "durationSeconds"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { docs: ["Nothing in Rust shall use these types. They only exist so that the Anchor IDL", "knows about them and typescript can deserialize it."]; name: "TokenIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "Serum3MarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "PerpMarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "I80F48"; type: { fields: [{ name: "val"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanType"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "Swap" }, { name: "SwapWithoutFee" }] } }, { docs: ["Copy paste a bunch of enums so that we could AnchorSerialize & AnchorDeserialize them"]; name: "Serum3SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Serum3OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }] } }, { name: "Serum3Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["There are three types of health:", "- initial health (\"init\"): users can only open new positions if it's >= 0", "- maintenance health (\"maint\"): users get liquidated if it's < 0", "- liquidation end health: once liquidation started (see being_liquidated), it", "only stops once this is >= 0", "", "The ordering is", "init health <= liquidation end health <= maint health", "", "The different health types are realized by using different weights and prices:", "- init health: init weights with scaling, stable-price adjusted prices", "- liq end health: init weights without scaling, oracle prices", "- maint health: maint weights, oracle prices", ""]; name: "HealthType"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "Maint" }, { name: "LiquidationEnd" }] } }, { name: "LoanOriginationFeeInstruction"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "LiqTokenBankruptcy" }, { name: "LiqTokenWithToken" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3SettleFunds" }, { name: "TokenWithdraw" }, { name: "TokenConditionalSwapTrigger" }] } }, { docs: ["Enum for lookup into ix gate", "note:", "total ix files 56,", "ix files included 48,", "ix files not included 8,", "- Benchmark,", "- ComputeAccountData,", "- GroupCreate", "- GroupEdit", "- IxGateSet,", "- PerpZeroOut,", "- PerpEditMarket,", "- TokenEdit,"]; name: "IxGate"; type: { kind: "enum"; variants: [{ name: "AccountClose" }, { name: "AccountCreate" }, { name: "AccountEdit" }, { name: "AccountExpand" }, { name: "AccountToggleFreeze" }, { name: "AltExtend" }, { name: "AltSet" }, { name: "FlashLoan" }, { name: "GroupClose" }, { name: "GroupCreate" }, { name: "HealthRegion" }, { name: "PerpCancelAllOrders" }, { name: "PerpCancelAllOrdersBySide" }, { name: "PerpCancelOrder" }, { name: "PerpCancelOrderByClientOrderId" }, { name: "PerpCloseMarket" }, { name: "PerpConsumeEvents" }, { name: "PerpCreateMarket" }, { name: "PerpDeactivatePosition" }, { name: "PerpLiqBaseOrPositivePnl" }, { name: "PerpLiqForceCancelOrders" }, { name: "PerpLiqNegativePnlOrBankruptcy" }, { name: "PerpPlaceOrder" }, { name: "PerpSettleFees" }, { name: "PerpSettlePnl" }, { name: "PerpUpdateFunding" }, { name: "Serum3CancelAllOrders" }, { name: "Serum3CancelOrder" }, { name: "Serum3CloseOpenOrders" }, { name: "Serum3CreateOpenOrders" }, { name: "Serum3DeregisterMarket" }, { name: "Serum3EditMarket" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3RegisterMarket" }, { name: "Serum3SettleFunds" }, { name: "StubOracleClose" }, { name: "StubOracleCreate" }, { name: "StubOracleSet" }, { name: "TokenAddBank" }, { name: "TokenDeposit" }, { name: "TokenDeregister" }, { name: "TokenLiqBankruptcy" }, { name: "TokenLiqWithToken" }, { name: "TokenRegister" }, { name: "TokenRegisterTrustless" }, { name: "TokenUpdateIndexAndRate" }, { name: "TokenWithdraw" }, { name: "AccountBuybackFeesWithMngo" }, { name: "TokenForceCloseBorrowsWithToken" }, { name: "PerpForceClosePosition" }, { name: "GroupWithdrawInsuranceFund" }, { name: "TokenConditionalSwapCreate" }, { name: "TokenConditionalSwapTrigger" }, { name: "TokenConditionalSwapCancel" }, { name: "OpenbookV2CancelOrder" }, { name: "OpenbookV2CloseOpenOrders" }, { name: "OpenbookV2CreateOpenOrders" }, { name: "OpenbookV2DeregisterMarket" }, { name: "OpenbookV2EditMarket" }, { name: "OpenbookV2LiqForceCancelOrders" }, { name: "OpenbookV2PlaceOrder" }, { name: "OpenbookV2PlaceTakeOrder" }, { name: "OpenbookV2RegisterMarket" }, { name: "OpenbookV2SettleFunds" }, { name: "AdminTokenWithdrawFees" }, { name: "AdminPerpWithdrawFees" }, { name: "AccountSizeMigration" }, { name: "TokenConditionalSwapStart" }, { name: "TokenConditionalSwapCreatePremiumAuction" }, { name: "TokenConditionalSwapCreateLinearAuction" }, { name: "Serum3PlaceOrderV2" }] } }, { name: "CheckLiquidatable"; type: { kind: "enum"; variants: [{ name: "NotLiquidatable" }, { name: "Liquidatable" }, { name: "BecameNotLiquidatable" }] } }, { name: "OracleType"; type: { kind: "enum"; variants: [{ name: "Pyth" }, { name: "Stub" }, { name: "SwitchboardV1" }, { name: "SwitchboardV2" }, { name: "OrcaCLMM" }] } }, { name: "OrderState"; type: { kind: "enum"; variants: [{ name: "Valid" }, { name: "Invalid" }, { name: "Skipped" }] } }, { name: "BookSideOrderTree"; type: { kind: "enum"; variants: [{ name: "Fixed" }, { name: "OraclePegged" }] } }, { name: "NodeTag"; type: { kind: "enum"; variants: [{ name: "Uninitialized" }, { name: "InnerNode" }, { name: "LeafNode" }, { name: "FreeNode" }, { name: "LastFreeNode" }] } }, { name: "PlaceOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "PostOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "PostOnly" }, { name: "PostOnlySlide" }] } }, { docs: ["Self trade behavior controls how taker orders interact with resting limit orders of the same account.", "This setting has no influence on placing a resting or oracle pegged limit order that does not match", "immediately, instead it's the responsibility of the user to correctly configure his taker orders."]; name: "SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["SideAndOrderTree is a storage optimization, so we don't need two bytes for the data"]; name: "SideAndOrderTree"; type: { kind: "enum"; variants: [{ name: "BidFixed" }, { name: "AskFixed" }, { name: "BidOraclePegged" }, { name: "AskOraclePegged" }] } }, { name: "OrderParams"; type: { kind: "enum"; variants: [{ name: "Market" }, { fields: [{ name: "price_lots"; type: "i64" }]; name: "ImmediateOrCancel" }, { fields: [{ name: "price_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }]; name: "Fixed" }, { fields: [{ name: "price_offset_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }, { name: "peg_limit"; type: "i64" }, { name: "max_oracle_staleness_slots"; type: "i32" }]; name: "OraclePegged" }] } }, { name: "OrderTreeType"; type: { kind: "enum"; variants: [{ name: "Bids" }, { name: "Asks" }] } }, { name: "EventType"; type: { kind: "enum"; variants: [{ name: "Fill" }, { name: "Out" }, { name: "Liquidate" }] } }, { name: "TokenConditionalSwapDisplayPriceStyle"; type: { kind: "enum"; variants: [{ name: "SellTokenPerBuyToken" }, { name: "BuyTokenPerSellToken" }] } }, { name: "TokenConditionalSwapIntention"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "StopLoss" }, { name: "TakeProfit" }] } }, { name: "TokenConditionalSwapType"; type: { kind: "enum"; variants: [{ name: "FixedPremium" }, { name: "PremiumAuction" }, { name: "LinearAuction" }] } }]
                    • version: "0.22.0"
                    Modify<T, R>: Omit<T, keyof R> & R

                    Type parameters

                    • T

                    • R

                    OracleConfig: { confFilter: I80F48; maxStalenessSlots: BN }

                    Type declaration

                    • confFilter: I80F48
                    • maxStalenessSlots: BN
                    OracleConfigDto: { confFilter: I80F48Dto; maxStalenessSlots: BN }

                    Type declaration

                    ParsedFillEvent: Modify<FillEvent, { price: number; quantity: number }>
                    PerpMarketIndex: number & As<"perp-market-index">
                    PerpOrderSide: { bid: Record<string, never> } | { ask: Record<string, never> }
                    PerpOrderType: { limit: Record<string, never> } | { immediateOrCancel: Record<string, never> } | { postOnly: Record<string, never> } | { market: Record<string, never> } | { postOnlySlide: Record<string, never> }
                    PerpSelfTradeBehavior: { decrementTake: Record<string, never> } | { cancelProvide: Record<string, never> } | { abortTransaction: Record<string, never> }
                    PlatformFee: { feeAccount: string; feeBps: number }

                    Type declaration

                    • feeAccount: string
                    • feeBps: number
                    PriceImpact: { avg_price_impact_percent: number; max_price_impact_percent: number; min_price_impact_percent: number; p90: number; p95: number; side: "bid" | "ask"; symbol: string; target_amount: number }

                    Type declaration

                    • avg_price_impact_percent: number
                    • max_price_impact_percent: number
                    • min_price_impact_percent: number
                    • p90: number
                    • p95: number
                    • side: "bid" | "ask"
                    • symbol: string
                    • target_amount: number
                    QuoteMintToReferrer: Map<TokenMintAddress, string>
                    Routes: { bestRoute: RouteInfo | null; routes: RouteInfo[] }

                    Type declaration

                    SendTransactionOpts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>
                    Serum3OrderType: { limit: Record<string, never> } | { immediateOrCancel: Record<string, never> } | { postOnly: Record<string, never> }
                    Serum3SelfTradeBehavior: { decrementTake: Record<string, never> } | { cancelProvide: Record<string, never> } | { abortTransaction: Record<string, never> }
                    Serum3Side: { bid: Record<string, never> } | { ask: Record<string, never> }
                    StablePriceModel: { delayAccumulatorPrice: number; delayAccumulatorTime: number; delayGrowthLimit: number; delayIntervalSeconds: number; delayPrices: number[]; lastDelayIntervalIndex: number; lastUpdateTimestamp: BN; stableGrowthLimit: number; stablePrice: number }

                    Type declaration

                    • delayAccumulatorPrice: number
                    • delayAccumulatorTime: number
                    • delayGrowthLimit: number
                    • delayIntervalSeconds: number
                    • delayPrices: number[]
                    • lastDelayIntervalIndex: number
                    • lastUpdateTimestamp: BN
                    • stableGrowthLimit: number
                    • stablePrice: number
                    Token: { address: string; chainId: number; decimals: number; extensions: { coingeckoId?: string }; logoURI: string; name: string; symbol: string; tags: string[] }

                    Type declaration

                    • address: string
                    • chainId: number
                    • decimals: number
                    • extensions: { coingeckoId?: string }
                      • Optional coingeckoId?: string
                    • logoURI: string
                    • name: string
                    • symbol: string
                    • tags: string[]
                    TokenConditionalSwapDisplayPriceStyle: { sellTokenPerBuyToken: Record<string, never> } | { buyTokenPerSellToken: Record<string, never> }
                    TokenConditionalSwapIntention: { unknown: Record<string, never> } | { stopLoss: Record<string, never> } | { takeProfit: Record<string, never> }
                    TokenIndex: number & As<"token-index">
                    TokenMintAddress: string

                    Variables

                    COMPUTE_BUDGET_PROGRAM_ID: PublicKey = ...
                    I64_MAX_BN: BN = ...
                    IDL: MangoV4 = ...
                    JUPITER: { V3: PublicKey; V4: PublicKey; V6: PublicKey } = ...

                    Type declaration

                    • V3: PublicKey
                    • V4: PublicKey
                    • V6: PublicKey
                    MANGO_ROUTER_API_URL: "https://api.mngo.cloud/router/v1" = 'https://api.mngo.cloud/router/v1'
                    MANGO_V4_ID: { devnet: PublicKey; mainnet-beta: PublicKey; testnet: PublicKey } = ...

                    Type declaration

                    • devnet: PublicKey
                    • mainnet-beta: PublicKey
                    • testnet: PublicKey
                    MANGO_V4_MAIN_GROUP: PublicKey = ...
                    MAX_RECENT_PRIORITY_FEE_ACCOUNTS: 128 = 128
                    NullPerpEditParams: PerpEditParams = ...
                    NullTokenEditParams: TokenEditParams = ...
                    OPENBOOK_PROGRAM_ID: { devnet: PublicKey; mainnet-beta: PublicKey } = ...

                    Type declaration

                    • devnet: PublicKey
                    • mainnet-beta: PublicKey
                    QUOTE_DECIMALS: 6 = 6
                    TrueIxGateParams: IxGateParams = ...
                    U64_MAX_BN: BN = ...
                    USDC_MINT: PublicKey = ...

                    Functions

                    • RUST_I64_MAX(): BN
                    • RUST_I64_MIN(): BN
                    • RUST_U64_MAX(): BN
                    • bpsToDecimal(bps: number): number
                    • buildFetch(): Promise<(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>>
                    • buildIxGate(p: IxGateParams): BN
                    • buildVersionedTx(provider: AnchorProvider, ix: TransactionInstruction[], additionalSigners?: Signer[], alts?: AddressLookupTableAccount[]): Promise<VersionedTransaction>
                    • Parameters

                      • provider: AnchorProvider
                      • ix: TransactionInstruction[]
                      • additionalSigners: Signer[] = []
                      • alts: AddressLookupTableAccount[] = []

                      Returns Promise<VersionedTransaction>

                    • computePriceImpactOnJup(pis: PriceImpact[], usdcAmount: number, tokenName: string): number
                    • +@blockworks-foundation/mango-v4
                      Options
                      All
                      • Public
                      • Public/Protected
                      • All
                      Menu

                      @blockworks-foundation/mango-v4

                      Index

                      Namespaces

                      Enumerations

                      Classes

                      Interfaces

                      Type aliases

                      Variables

                      Functions

                      Type aliases

                      AccountInfoMap: Map<string, AccountInfo<Buffer> | null>
                      AmmLabel: "Aldrin" | "Crema" | "Cropper" | "Cykura" | "DeltaFi" | "GooseFX" | "Invariant" | "Lifinity" | "Lifinity V2" | "Marinade" | "Mercurial" | "Meteora" | "Raydium" | "Raydium CLMM" | "Saber" | "Serum" | "Orca" | "Step" | "Penguin" | "Saros" | "Stepn" | "Orca (Whirlpools)" | "Sencha" | "Saber (Decimals)" | "Dradex" | "Balansol" | "Openbook" | "Unknown"
                      BookSideType: { bids: Record<string, never> } | { asks: Record<string, never> }
                      FlashLoanType: { unknown: Record<string, never> } | { swap: Record<string, never> } | { swapWithoutFee: Record<string, never> }
                      MangoV4: { accounts: [{ name: "bank"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 16] } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "oracle"; type: "publicKey" }, { name: "oracleConfig"; type: { defined: "OracleConfig" } }, { name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["the index used to scale the value of an IndexedPosition", "TODO: should always be >= 0, add checks?"]; name: "depositIndex"; type: { defined: "I80F48" } }, { name: "borrowIndex"; type: { defined: "I80F48" } }, { docs: ["deposits/borrows for this bank", "", "Note that these may become negative. It's perfectly fine for users to borrow one one bank", "(increasing indexed_borrows there) and paying back on another (possibly decreasing indexed_borrows", "below zero).", "", "The vault amount is not deducable from these values.", "", "These become meaningful when summed over all banks (like in update_index_and_rate)."]; name: "indexedDeposits"; type: { defined: "I80F48" } }, { name: "indexedBorrows"; type: { defined: "I80F48" } }, { name: "indexLastUpdated"; type: "u64" }, { name: "bankRateLastUpdated"; type: "u64" }, { name: "avgUtilization"; type: { defined: "I80F48" } }, { name: "adjustmentFactor"; type: { defined: "I80F48" } }, { docs: ["The unscaled borrow interest curve is defined as continuous piecewise linear with the points:", "", "- 0% util: zero_util_rate", "- util0% util: rate0", "- util1% util: rate1", "- 100% util: max_rate", "", "The final rate is this unscaled curve multiplied by interest_curve_scaling."]; name: "util0"; type: { defined: "I80F48" } }, { name: "rate0"; type: { defined: "I80F48" } }, { name: "util1"; type: { defined: "I80F48" } }, { name: "rate1"; type: { defined: "I80F48" } }, { docs: ["the 100% utilization rate", "", "This isn't the max_rate, since this still gets scaled by interest_curve_scaling,", "which is >=1."]; name: "maxRate"; type: { defined: "I80F48" } }, { docs: ["Fees collected over the lifetime of the bank", "", "See fees_withdrawn for how much of the fees was withdrawn.", "See collected_liquidation_fees for the (included) subtotal for liquidation related fees."]; name: "collectedFeesNative"; type: { defined: "I80F48" } }, { name: "loanOriginationFeeRate"; type: { defined: "I80F48" } }, { name: "loanFeeRate"; type: { defined: "I80F48" } }, { name: "maintAssetWeight"; type: { defined: "I80F48" } }, { name: "initAssetWeight"; type: { defined: "I80F48" } }, { name: "maintLiabWeight"; type: { defined: "I80F48" } }, { name: "initLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Liquidation fee that goes to the liqor.", "", "Liquidation always involves two tokens, and the sum of the two configured fees is used.", "", "A fraction of the price, like 0.05 for a 5% fee during liquidation.", "", "See also platform_liquidation_fee."]; name: "liquidationFee"; type: { defined: "I80F48" } }, { name: "dust"; type: { defined: "I80F48" } }, { name: "flashLoanTokenAccountInitial"; type: "u64" }, { name: "flashLoanApprovedAmount"; type: "u64" }, { name: "tokenIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "mintDecimals"; type: "u8" }, { name: "bankNum"; type: "u32" }, { docs: ["The maximum utilization allowed when borrowing is 1-this value", "WARNING: Outdated name, kept for IDL compatibility"]; name: "minVaultToDepositsRatio"; type: "f64" }, { docs: ["Size in seconds of a net borrows window"]; name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { docs: ["Timestamp at which the last net borrows window started"]; name: "lastNetBorrowsWindowStartTs"; type: "u64" }, { docs: ["Net borrow limit per window in quote native; set to -1 to disable."]; name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { docs: ["Sum of all deposits and borrows in the last window, in native units."]; name: "netBorrowsInWindow"; type: "i64" }, { docs: ["Soft borrow limit in native quote", "", "Once the borrows on the bank exceed this quote value, init_liab_weight is scaled up.", "Set to f64::MAX to disable.", "", "See scaled_init_liab_weight()."]; name: "borrowWeightScaleStartQuote"; type: "f64" }, { docs: ["Limit for collateral of deposits in native quote", "", "Once the deposits in the bank exceed this quote value, init_asset_weight is scaled", "down to keep the total collateral value constant.", "Set to f64::MAX to disable.", "", "See scaled_init_asset_weight()."]; name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { docs: ["If set to 1, deposits cannot be liquidated when an account is liquidatable.", "That means bankrupt accounts may still have assets of this type deposited."]; name: "disableAssetLiquidation"; type: "u8" }, { name: "padding"; type: { array: ["u8", 5] } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Fees for the token conditional swap feature"]; name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { docs: ["Target utilization: If actual utilization is higher, scale up interest.", "If it's lower, scale down interest (if possible)"]; name: "interestTargetUtilization"; type: "f32" }, { docs: ["Current interest curve scaling, always >= 1.0", "", "Except when first migrating to having this field, then 0.0"]; name: "interestCurveScaling"; type: "f64" }, { docs: ["Largest amount of tokens that might be added the the bank based on", "serum open order execution."]; name: "potentialSerumTokens"; type: "u64" }, { docs: ["Start timestamp in seconds at which maint weights should start to change away", "from maint_asset_weight, maint_liab_weight towards _asset_target and _liab_target.", "If _start and _end and _duration_inv are 0, no shift is configured."]; name: "maintWeightShiftStart"; type: "u64" }, { docs: ["End timestamp in seconds until which the maint weights should reach the configured targets."]; name: "maintWeightShiftEnd"; type: "u64" }, { docs: ["Cache of the inverse of maint_weight_shift_end - maint_weight_shift_start,", "or zero if no shift is configured"]; name: "maintWeightShiftDurationInv"; type: { defined: "I80F48" } }, { docs: ["Maint asset weight to reach at _shift_end."]; name: "maintWeightShiftAssetTarget"; type: { defined: "I80F48" } }, { name: "maintWeightShiftLiabTarget"; type: { defined: "I80F48" } }, { docs: ["Oracle that may be used if the main oracle is stale or not confident enough.", "If this is Pubkey::default(), no fallback is available."]; name: "fallbackOracle"; type: "publicKey" }, { docs: ["zero means none, in token native"]; name: "depositLimit"; type: "u64" }, { docs: ["The unscaled borrow interest curve point for zero utilization.", "", "See util0, rate0, util1, rate1, max_rate"]; name: "zeroUtilRate"; type: { defined: "I80F48" } }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were collected during liquidation (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedLiquidationFees"; type: { defined: "I80F48" } }, { docs: ["Collateral fees that have been collected (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedCollateralFees"; type: { defined: "I80F48" } }, { docs: ["The daily collateral fees rate for fully utilized collateral."]; name: "collateralFeePerDay"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 1900] } }]; kind: "struct" } }, { name: "group"; type: { fields: [{ name: "creator"; type: "publicKey" }, { name: "groupNum"; type: "u32" }, { name: "admin"; type: "publicKey" }, { name: "fastListingAdmin"; type: "publicKey" }, { name: "mngoTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceMint"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }, { name: "buybackFees"; type: "u8" }, { name: "buybackFeesMngoBonusFactor"; type: "f32" }, { name: "addressLookupTables"; type: { array: ["publicKey", 20] } }, { name: "securityAdmin"; type: "publicKey" }, { name: "depositLimitQuote"; type: "u64" }, { name: "ixGate"; type: "u128" }, { name: "buybackFeesSwapMangoAccount"; type: "publicKey" }, { docs: ["Number of seconds after which fees that could be used with the fees buyback feature expire.", "", "The actual expiry is staggered such that the fees users accumulate are always", "available for at least this interval - but may be available for up to twice this time.", "", "When set to 0, there's no expiry of buyback fees."]; name: "buybackFeesExpiryInterval"; type: "u64" }, { docs: ["Fast-listings are limited per week, this is the start of the current fast-listing interval", "in seconds since epoch"]; name: "fastListingIntervalStart"; type: "u64" }, { docs: ["Number of fast listings that happened this interval"]; name: "fastListingsInInterval"; type: "u16" }, { docs: ["Number of fast listings that are allowed per interval"]; name: "allowedFastListingsPerInterval"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { docs: ["Intervals in which collateral fee is applied"]; name: "collateralFeeInterval"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 1800] } }]; kind: "struct" } }, { name: "mangoAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { docs: ["Tracks that this account should be liquidated until init_health >= 0.", "", "Normally accounts can not be liquidated while maint_health >= 0. But when an account", "reaches maint_health < 0, liquidators will call a liquidation instruction and thereby", "set this flag. Now the account may be liquidated until init_health >= 0.", "", "Many actions should be disabled while the account is being liquidated, even if", "its maint health has recovered to positive. Creating new open orders would, for example,", "confuse liquidators."]; name: "beingLiquidated"; type: "u8" }, { docs: ["The account is currently inside a health region marked by HealthRegionBegin...HealthRegionEnd.", "", "Must never be set after a transaction ends."]; name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { docs: ["Init health as calculated during HealthReginBegin, rounded up."]; name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { docs: ["Fees usable with the \"fees buyback\" feature.", "This tracks the ones that accrued in the current expiry interval."]; name: "buybackFeesAccruedCurrent"; type: "u64" }, { docs: ["Fees buyback amount from the previous expiry interval."]; name: "buybackFeesAccruedPrevious"; type: "u64" }, { docs: ["End timestamp of the current expiry interval of the buyback fees amount."]; name: "buybackFeesExpiryTimestamp"; type: "u64" }, { docs: ["Next id to use when adding a token condition swap"]; name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { docs: ["Time at which the last collateral fee was charged"]; name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }, { name: "headerVersion"; type: "u8" }, { name: "padding3"; type: { array: ["u8", 7] } }, { name: "padding4"; type: "u32" }, { name: "tokens"; type: { vec: { defined: "TokenPosition" } } }, { name: "padding5"; type: "u32" }, { name: "serum3"; type: { vec: { defined: "Serum3Orders" } } }, { name: "padding6"; type: "u32" }, { name: "perps"; type: { vec: { defined: "PerpPosition" } } }, { name: "padding7"; type: "u32" }, { name: "perpOpenOrders"; type: { vec: { defined: "PerpOpenOrder" } } }, { name: "padding8"; type: "u32" }, { name: "tokenConditionalSwaps"; type: { vec: { defined: "TokenConditionalSwap" } } }, { name: "reservedDynamic"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "mintInfo"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "tokenIndex"; type: "u16" }, { name: "groupInsuranceFund"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }, { name: "mint"; type: "publicKey" }, { name: "banks"; type: { array: ["publicKey", 6] } }, { name: "vaults"; type: { array: ["publicKey", 6] } }, { name: "oracle"; type: "publicKey" }, { name: "registrationTime"; type: "u64" }, { name: "fallbackOracle"; type: "publicKey" }, { name: "reserved"; type: { array: ["u8", 2528] } }]; kind: "struct" } }, { name: "openbookV2Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "openbookV2Program"; type: "publicKey" }, { name: "openbookV2MarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 5] } }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 512] } }]; kind: "struct" } }, { name: "openbookV2MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }, { name: "stubOracle"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "mint"; type: "publicKey" }, { name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateTs"; type: "i64" }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 104] } }]; kind: "struct" } }, { name: "bookSide"; type: { fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" } }, { name: "eventQueue"; type: { fields: [{ name: "header"; type: { defined: "EventQueueHeader" } }, { name: "buf"; type: { array: [{ defined: "AnyEvent" }, 488] } }, { name: "reserved"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "perpMarket"; type: { fields: [{ name: "group"; type: "publicKey" }, { docs: ["Token index that settlements happen in.", "", "Currently required to be 0, USDC. In the future settlement", "may be allowed to happen in other tokens."]; name: "settleTokenIndex"; type: "u16" }, { docs: ["Index of this perp market. Other data, like the MangoAccount's PerpPosition", "reference this market via this index. Unique for this group's perp markets."]; name: "perpMarketIndex"; type: "u16" }, { docs: ["Field used to contain the trusted_market flag and is now unused."]; name: "blocked1"; type: "u8" }, { docs: ["Is this market covered by the group insurance fund?"]; name: "groupInsuranceFund"; type: "u8" }, { docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { docs: ["Name. Trailing zero bytes are ignored."]; name: "name"; type: { array: ["u8", 16] } }, { docs: ["Address of the BookSide account for bids"]; name: "bids"; type: "publicKey" }, { docs: ["Address of the BookSide account for asks"]; name: "asks"; type: "publicKey" }, { docs: ["Address of the EventQueue account"]; name: "eventQueue"; type: "publicKey" }, { docs: ["Oracle account address"]; name: "oracle"; type: "publicKey" }, { docs: ["Oracle configuration"]; name: "oracleConfig"; type: { defined: "OracleConfig" } }, { docs: ["Maintains a stable price based on the oracle price that is less volatile."]; name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["Number of quote native in a quote lot. Must be a power of 10.", "", "Primarily useful for increasing the tick size on the market: A lot price", "of 1 becomes a native price of quote_lot_size/base_lot_size becomes a", "ui price of quote_lot_size*base_decimals/base_lot_size/quote_decimals."]; name: "quoteLotSize"; type: "i64" }, { docs: ["Number of base native in a base lot. Must be a power of 10.", "", "Example: If base decimals for the underlying asset is 6, base lot size", "is 100 and and base position lots is 10_000 then base position native is", "1_000_000 and base position ui is 1."]; name: "baseLotSize"; type: "i64" }, { docs: ["These weights apply to the base position. The quote position has", "no explicit weight (but may be covered by the overall pnl asset weight)."]; name: "maintBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "initBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "maintBaseLiabWeight"; type: { defined: "I80F48" } }, { name: "initBaseLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Number of base lots currently active in the market. Always >= 0.", "", "Since this counts positive base lots and negative base lots, the more relevant", "number of open base lot pairs is half this value."]; name: "openInterest"; type: "i64" }, { docs: ["Total number of orders seen"]; name: "seqNum"; type: "u64" }, { docs: ["Timestamp in seconds that the market was registered at."]; name: "registrationTime"; type: "u64" }, { docs: ["Minimal funding rate per day, must be <= 0."]; name: "minFunding"; type: { defined: "I80F48" } }, { docs: ["Maximal funding rate per day, must be >= 0."]; name: "maxFunding"; type: { defined: "I80F48" } }, { docs: ["For funding, get the impact price this many base lots deep into the book."]; name: "impactQuantity"; type: "i64" }, { docs: ["Current long funding value. Increasing it means that every long base lot", "needs to pay that amount of quote native in funding.", "", "PerpPosition uses and tracks it settle funding. Updated by the perp", "keeper instruction."]; name: "longFunding"; type: { defined: "I80F48" } }, { docs: ["See long_funding."]; name: "shortFunding"; type: { defined: "I80F48" } }, { docs: ["timestamp that funding was last updated in"]; name: "fundingLastUpdated"; type: "u64" }, { docs: ["Fees", "Fee for base position liquidation"]; name: "baseLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Fee when matching maker orders. May be negative."]; name: "makerFee"; type: { defined: "I80F48" } }, { docs: ["Fee for taker orders, may not be negative."]; name: "takerFee"; type: { defined: "I80F48" } }, { docs: ["Fees accrued in native quote currency", "these are increased when new fees are paid and decreased when perp_settle_fees is called"]; name: "feesAccrued"; type: { defined: "I80F48" } }, { docs: ["Fees settled in native quote currency", "these are increased when perp_settle_fees is called, and never decreased"]; name: "feesSettled"; type: { defined: "I80F48" } }, { docs: ["Fee (in quote native) to charge for ioc orders"]; name: "feePenalty"; type: "f32" }, { docs: ["In native units of settlement token, given to each settle call above the", "settle_fee_amount_threshold if settling at least 1% of perp base pos value."]; name: "settleFeeFlat"; type: "f32" }, { docs: ["Pnl settlement amount needed to be eligible for the flat fee."]; name: "settleFeeAmountThreshold"; type: "f32" }, { docs: ["Fraction of pnl to pay out as fee if +pnl account has low health.", "(limited to 2x settle_fee_flat)"]; name: "settleFeeFractionLowHealth"; type: "f32" }, { docs: ["Controls the strictness of the settle limit.", "Set to a negative value to disable the limit.", "", "This factor applies to the settle limit in two ways", "- for the unrealized pnl settle limit, the factor is multiplied with the stable perp base value", "(i.e. limit_factor * base_native * stable_price)", "- when increasing the realized pnl settle limit (stored per PerpPosition), the factor is", "multiplied with the stable value of the perp pnl being realized", "(i.e. limit_factor * reduced_native * stable_price)", "", "See also PerpPosition::settle_pnl_limit_realized_trade"]; name: "settlePnlLimitFactor"; type: "f32" }, { name: "padding3"; type: { array: ["u8", 4] } }, { docs: ["Window size in seconds for the perp settlement limit"]; name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { docs: ["If true, users may no longer increase their market exposure. Only actions", "that reduce their position are still allowed."]; name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding4"; type: { array: ["u8", 6] } }, { docs: ["Weights for full perp market health, if positive"]; name: "maintOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "initOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "positivePnlLiquidationFee"; type: { defined: "I80F48" } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were accrued during liquidation (in native tokens)", "", "These fees are also added to fees_accrued, this is just for bookkeeping the total", "liquidation fees that happened. So never decreases (different to fees_accrued)."]; name: "accruedLiquidationFees"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 1848] } }]; kind: "struct" } }, { name: "serum3Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "serumProgram"; type: "publicKey" }, { name: "serumMarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 1] } }, { docs: ["Limit orders must be <= oracle * (1+band) and >= oracle / (1+band)", "", "Zero value is the default due to migration and disables the limit,", "same as f32::MAX."]; name: "oraclePriceBand"; type: "f32" }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "serum3MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }]; errors: [{ code: 6000; msg: ""; name: "SomeError" }, { code: 6001; msg: ""; name: "NotImplementedError" }, { code: 6002; msg: "checked math error"; name: "MathError" }, { code: 6003; msg: ""; name: "UnexpectedOracle" }, { code: 6004; msg: "oracle type cannot be determined"; name: "UnknownOracleType" }, { code: 6005; msg: ""; name: "InvalidFlashLoanTargetCpiProgram" }, { code: 6006; msg: "health must be positive"; name: "HealthMustBePositive" }, { code: 6007; msg: "health must be positive or not decrease"; name: "HealthMustBePositiveOrIncrease" }, { code: 6008; msg: "health must be negative"; name: "HealthMustBeNegative" }, { code: 6009; msg: "the account is bankrupt"; name: "IsBankrupt" }, { code: 6010; msg: "the account is not bankrupt"; name: "IsNotBankrupt" }, { code: 6011; msg: "no free token position index"; name: "NoFreeTokenPositionIndex" }, { code: 6012; msg: "no free serum3 open orders index"; name: "NoFreeSerum3OpenOrdersIndex" }, { code: 6013; msg: "no free perp position index"; name: "NoFreePerpPositionIndex" }, { code: 6014; msg: "serum3 open orders exist already"; name: "Serum3OpenOrdersExistAlready" }, { code: 6015; msg: "bank vault has insufficent funds"; name: "InsufficentBankVaultFunds" }, { code: 6016; msg: "account is currently being liquidated"; name: "BeingLiquidated" }, { code: 6017; msg: "invalid bank"; name: "InvalidBank" }, { code: 6018; msg: "account profitability is mismatched"; name: "ProfitabilityMismatch" }, { code: 6019; msg: "cannot settle with self"; name: "CannotSettleWithSelf" }, { code: 6020; msg: "perp position does not exist"; name: "PerpPositionDoesNotExist" }, { code: 6021; msg: "max settle amount must be greater than zero"; name: "MaxSettleAmountMustBeGreaterThanZero" }, { code: 6022; msg: "the perp position has open orders or unprocessed fill events"; name: "HasOpenPerpOrders" }, { code: 6023; msg: "an oracle does not reach the confidence threshold"; name: "OracleConfidence" }, { code: 6024; msg: "an oracle is stale"; name: "OracleStale" }, { code: 6025; msg: "settlement amount must always be positive"; name: "SettlementAmountMustBePositive" }, { code: 6026; msg: "bank utilization has reached limit"; name: "BankBorrowLimitReached" }, { code: 6027; msg: "bank net borrows has reached limit - this is an intermittent error - the limit will reset regularly"; name: "BankNetBorrowsLimitReached" }, { code: 6028; msg: "token position does not exist"; name: "TokenPositionDoesNotExist" }, { code: 6029; msg: "token deposits into accounts that are being liquidated must bring their health above the init threshold"; name: "DepositsIntoLiquidatingMustRecover" }, { code: 6030; msg: "token is in reduce only mode"; name: "TokenInReduceOnlyMode" }, { code: 6031; msg: "market is in reduce only mode"; name: "MarketInReduceOnlyMode" }, { code: 6032; msg: "group is halted"; name: "GroupIsHalted" }, { code: 6033; msg: "the perp position has non-zero base lots"; name: "PerpHasBaseLots" }, { code: 6034; msg: "there are open or unsettled serum3 orders"; name: "HasOpenOrUnsettledSerum3Orders" }, { code: 6035; msg: "has liquidatable token position"; name: "HasLiquidatableTokenPosition" }, { code: 6036; msg: "has liquidatable perp base position"; name: "HasLiquidatablePerpBasePosition" }, { code: 6037; msg: "has liquidatable positive perp pnl"; name: "HasLiquidatablePositivePerpPnl" }, { code: 6038; msg: "account is frozen"; name: "AccountIsFrozen" }, { code: 6039; msg: "Init Asset Weight can't be negative"; name: "InitAssetWeightCantBeNegative" }, { code: 6040; msg: "has open perp taker fills"; name: "HasOpenPerpTakerFills" }, { code: 6041; msg: "deposit crosses the current group deposit limit"; name: "DepositLimit" }, { code: 6042; msg: "instruction is disabled"; name: "IxIsDisabled" }, { code: 6043; msg: "no liquidatable perp base position"; name: "NoLiquidatablePerpBasePosition" }, { code: 6044; msg: "perp order id not found on the orderbook"; name: "PerpOrderIdNotFound" }, { code: 6045; msg: "HealthRegions allow only specific instructions between Begin and End"; name: "HealthRegionBadInnerInstruction" }, { code: 6046; msg: "token is in force close"; name: "TokenInForceClose" }, { code: 6047; msg: "incorrect number of health accounts"; name: "InvalidHealthAccountCount" }, { code: 6048; msg: "would self trade"; name: "WouldSelfTrade" }, { code: 6049; msg: "token conditional swap oracle price is not in execution range"; name: "TokenConditionalSwapPriceNotInRange" }, { code: 6050; msg: "token conditional swap is expired"; name: "TokenConditionalSwapExpired" }, { code: 6051; msg: "token conditional swap is not available yet"; name: "TokenConditionalSwapNotStarted" }, { code: 6052; msg: "token conditional swap was already started"; name: "TokenConditionalSwapAlreadyStarted" }, { code: 6053; msg: "token conditional swap it not set"; name: "TokenConditionalSwapNotSet" }, { code: 6054; msg: "token conditional swap trigger did not reach min_buy_token"; name: "TokenConditionalSwapMinBuyTokenNotReached" }, { code: 6055; msg: "token conditional swap cannot pay incentive"; name: "TokenConditionalSwapCantPayIncentive" }, { code: 6056; msg: "token conditional swap taker price is too low"; name: "TokenConditionalSwapTakerPriceTooLow" }, { code: 6057; msg: "token conditional swap index and id don't match"; name: "TokenConditionalSwapIndexIdMismatch" }, { code: 6058; msg: "token conditional swap volume is too small compared to the cost of starting it"; name: "TokenConditionalSwapTooSmallForStartIncentive" }, { code: 6059; msg: "token conditional swap type cannot be started"; name: "TokenConditionalSwapTypeNotStartable" }, { code: 6060; msg: "a bank in the health account list should be writable but is not"; name: "HealthAccountBankNotWritable" }, { code: 6061; msg: "the market does not allow limit orders too far from the current oracle value"; name: "Serum3PriceBandExceeded" }, { code: 6062; msg: "deposit crosses the token's deposit limit"; name: "BankDepositLimit" }, { code: 6063; msg: "delegates can only withdraw to the owner's associated token account"; name: "DelegateWithdrawOnlyToOwnerAta" }, { code: 6064; msg: "delegates can only withdraw if they close the token position"; name: "DelegateWithdrawMustClosePosition" }, { code: 6065; msg: "delegates can only withdraw small amounts"; name: "DelegateWithdrawSmall" }, { code: 6066; msg: "The provided CLMM oracle is not valid"; name: "InvalidCLMMOracle" }, { code: 6067; msg: "invalid usdc/usd feed provided for the CLMM oracle"; name: "InvalidFeedForCLMMOracle" }, { code: 6068; msg: "Pyth USDC/USD or SOL/USD feed not found (required by CLMM oracle)"; name: "MissingFeedForCLMMOracle" }, { code: 6069; msg: "the asset does not allow liquidation"; name: "TokenAssetLiquidationDisabled" }]; events: [{ fields: [{ index: false; name: "initHealth"; type: { defined: "I80F48" } }, { index: false; name: "maintHealth"; type: { defined: "I80F48" } }, { index: false; name: "equity"; type: { defined: "Equity" } }]; name: "MangoAccountData" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "basePosition"; type: "i64" }, { index: false; name: "quotePosition"; type: "i128" }, { index: false; name: "longSettledFunding"; type: "i128" }, { index: false; name: "shortSettledFunding"; type: "i128" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }]; name: "PerpBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "indexedPosition"; type: "i128" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }]; name: "TokenBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetail" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV2" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV3" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "WithdrawLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "DepositLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerOrderId"; type: "u128" }, { index: false; name: "makerFee"; type: "i128" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerOrderId"; type: "u128" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "i128" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }, { index: false; name: "makerClosedPnl"; type: "f64" }, { index: false; name: "takerClosedPnl"; type: "f64" }]; name: "FillLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "oracleConfidence"; type: "i128" }, { index: false; name: "oracleType"; type: { defined: "OracleType" } }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }, { index: false; name: "avgUtilization"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "collectedFees"; type: "i128" }, { index: false; name: "loanFeeRate"; type: "i128" }, { index: false; name: "totalBorrows"; type: "i128" }, { index: false; name: "totalDeposits"; type: "i128" }, { index: false; name: "borrowRate"; type: "i128" }, { index: false; name: "depositRate"; type: "i128" }]; name: "UpdateIndexLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }]; name: "UpdateRateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "util0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "util1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }, { index: false; name: "curveScaling"; type: "f64" }, { index: false; name: "targetUtilization"; type: "f32" }]; name: "UpdateRateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }]; name: "WithdrawLoanOriginationFeeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanAmount"; type: "i128" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }, { index: false; name: "price"; type: { option: "i128" } }]; name: "WithdrawLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "initialLiabNative"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "insuranceTokenIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLiabDepositIndex"; type: "i128" }, { index: false; name: "endingLiabDepositIndex"; type: "i128" }]; name: "TokenLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "cumulativeDepositInterest"; type: "f64" }, { index: false; name: "cumulativeBorrowInterest"; type: "f64" }]; name: "DeactivateTokenPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "cumulativeLongFunding"; type: "f64" }, { index: false; name: "cumulativeShortFunding"; type: "f64" }, { index: false; name: "makerVolume"; type: "u64" }, { index: false; name: "takerVolume"; type: "u64" }, { index: false; name: "perpSpotTransfers"; type: "i64" }]; name: "DeactivatePerpPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "fallbackOracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarket"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "baseDecimals"; type: "u8" }, { index: false; name: "baseLotSize"; type: "i64" }, { index: false; name: "quoteLotSize"; type: "i64" }, { index: false; name: "oracle"; type: "publicKey" }]; name: "PerpMarketMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "serumMarket"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "serumProgram"; type: "publicKey" }, { index: false; name: "serumProgramExternal"; type: "publicKey" }]; name: "Serum3RegisterMarketLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransferLiqee"; type: "i64" }, { index: false; name: "quoteTransferLiqee"; type: "i128" }, { index: false; name: "quoteTransferLiqor"; type: "i128" }, { index: false; name: "quotePlatformFee"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLongFunding"; type: "i128" }, { index: false; name: "startingShortFunding"; type: "i128" }, { index: false; name: "endingLongFunding"; type: "i128" }, { index: false; name: "endingShortFunding"; type: "i128" }]; name: "PerpLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpLiqNegativePnlOrBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccountA"; type: "publicKey" }, { index: false; name: "mangoAccountB"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }, { index: false; name: "settler"; type: "publicKey" }, { index: false; name: "fee"; type: "i128" }]; name: "PerpSettlePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpSettleFeesLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "buybackFees"; type: "i128" }, { index: false; name: "buybackMngo"; type: "i128" }, { index: false; name: "mngoBuybackPrice"; type: "i128" }, { index: false; name: "oraclePrice"; type: "i128" }]; name: "AccountBuybackFeesWithMngoLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "seqNum"; type: "u64" }]; name: "FilledPerpOrderLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "totalBaseLotsTaken"; type: "i64" }, { index: false; name: "totalBaseLotsDecremented"; type: "i64" }, { index: false; name: "totalQuoteLotsTaken"; type: "i64" }, { index: false; name: "totalQuoteLotsDecremented"; type: "i64" }, { index: false; name: "takerFeesPaid"; type: "i128" }, { index: false; name: "feePenalty"; type: "i128" }]; name: "PerpTakerTradeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "accountA"; type: "publicKey" }, { index: false; name: "accountB"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpForceClosePositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }]; name: "TokenConditionalSwapCreateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapCreateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }, { index: false; name: "durationSeconds"; type: "u64" }]; name: "TokenConditionalSwapCreateLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }]; name: "TokenConditionalSwapTriggerLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapTriggerLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }]; name: "TokenConditionalSwapTriggerLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }]; name: "TokenConditionalSwapCancelLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "caller"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "incentiveTokenIndex"; type: "u16" }, { index: false; name: "incentiveAmount"; type: "u64" }]; name: "TokenConditionalSwapStartLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "assetUsageFraction"; type: "i128" }, { index: false; name: "fee"; type: "i128" }]; name: "TokenCollateralFeeLog" }]; instructions: [{ accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminTokenWithdrawFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminPerpWithdrawFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Group" }, { kind: "account"; path: "creator"; type: "publicKey" }, { kind: "arg"; path: "group_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "creator" }, { isMut: false; isSigner: false; name: "insuranceMint" }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "InsuranceVault" }, { kind: "account"; path: "group"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "groupNum"; type: "u32" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }]; name: "groupCreate" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "adminOpt"; type: { option: "publicKey" } }, { name: "fastListingAdminOpt"; type: { option: "publicKey" } }, { name: "securityAdminOpt"; type: { option: "publicKey" } }, { name: "testingOpt"; type: { option: "u8" } }, { name: "versionOpt"; type: { option: "u8" } }, { name: "depositLimitQuoteOpt"; type: { option: "u64" } }, { name: "buybackFeesOpt"; type: { option: "bool" } }, { name: "buybackFeesBonusFactorOpt"; type: { option: "f32" } }, { name: "buybackFeesSwapMangoAccountOpt"; type: { option: "publicKey" } }, { name: "mngoTokenIndexOpt"; type: { option: "u16" } }, { name: "buybackFeesExpiryIntervalOpt"; type: { option: "u64" } }, { name: "allowedFastListingsPerIntervalOpt"; type: { option: "u16" } }, { name: "collateralFeeIntervalOpt"; type: { option: "u64" } }]; name: "groupEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault", "admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "destination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "groupWithdrawInsuranceFund" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "ixGate"; type: "u128" }]; name: "ixGateSet" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin", "insurance_vault"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "groupClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "interestRateParams"; type: { defined: "InterestRateParams" } }, { name: "loanFeeRate"; type: "f32" }, { name: "loanOriginationFeeRate"; type: "f32" }, { name: "maintAssetWeight"; type: "f32" }, { name: "initAssetWeight"; type: "f32" }, { name: "maintLiabWeight"; type: "f32" }, { name: "initLiabWeight"; type: "f32" }, { name: "liquidationFee"; type: "f32" }, { name: "stablePriceDelayIntervalSeconds"; type: "u32" }, { name: "stablePriceDelayGrowthLimit"; type: "f32" }, { name: "stablePriceGrowthLimit"; type: "f32" }, { name: "minVaultToDepositsRatio"; type: "f64" }, { name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { name: "borrowWeightScaleStartQuote"; type: "f64" }, { name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { name: "interestCurveScaling"; type: "f32" }, { name: "interestTargetUtilization"; type: "f32" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "depositLimit"; type: "u64" }, { name: "zeroUtilRate"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }, { name: "disableAssetLiquidation"; type: "bool" }, { name: "collateralFeePerDay"; type: "f32" }]; name: "tokenRegister" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }]; name: "tokenRegisterTrustless" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }, { docs: ["The fallback oracle account is optional and only used when set_fallback_oracle is true.", ""]; isMut: false; isSigner: false; name: "fallbackOracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "interestRateParamsOpt"; type: { option: { defined: "InterestRateParams" } } }, { name: "loanFeeRateOpt"; type: { option: "f32" } }, { name: "loanOriginationFeeRateOpt"; type: { option: "f32" } }, { name: "maintAssetWeightOpt"; type: { option: "f32" } }, { name: "initAssetWeightOpt"; type: { option: "f32" } }, { name: "maintLiabWeightOpt"; type: { option: "f32" } }, { name: "initLiabWeightOpt"; type: { option: "f32" } }, { name: "liquidationFeeOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "minVaultToDepositsRatioOpt"; type: { option: "f64" } }, { name: "netBorrowLimitPerWindowQuoteOpt"; type: { option: "i64" } }, { name: "netBorrowLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "borrowWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "depositWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "resetStablePrice"; type: "bool" }, { name: "resetNetBorrowLimit"; type: "bool" }, { name: "reduceOnlyOpt"; type: { option: "u8" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "tokenConditionalSwapTakerFeeRateOpt"; type: { option: "f32" } }, { name: "tokenConditionalSwapMakerFeeRateOpt"; type: { option: "f32" } }, { name: "flashLoanSwapFeeRateOpt"; type: { option: "f32" } }, { name: "interestCurveScalingOpt"; type: { option: "f32" } }, { name: "interestTargetUtilizationOpt"; type: { option: "f32" } }, { name: "maintWeightShiftStartOpt"; type: { option: "u64" } }, { name: "maintWeightShiftEndOpt"; type: { option: "u64" } }, { name: "maintWeightShiftAssetTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftLiabTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftAbort"; type: "bool" }, { name: "setFallbackOracle"; type: "bool" }, { name: "depositLimitOpt"; type: { option: "u64" } }, { name: "zeroUtilRateOpt"; type: { option: "f32" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }, { name: "disableAssetLiquidationOpt"; type: { option: "bool" } }, { name: "collateralFeePerDayOpt"; type: { option: "f32" } }]; name: "tokenEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: false; isSigner: false; name: "existingBank"; relations: ["group", "mint"] }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group", "mint"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "bankNum"; type: "u32" }]; name: "tokenAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "dustVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "tokenDeregister" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "mintInfo"; relations: ["oracle", "group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "instructions" }]; args: []; name: "tokenUpdateIndexAndRate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }]; name: "accountExpand" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }]; name: "accountExpandV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "accountSizeMigration" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }]; args: [{ name: "nameOpt"; type: { option: "string" } }, { name: "delegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateExpiryOpt"; type: { option: "u64" } }]; name: "accountEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "freeze"; type: "bool" }]; name: "accountToggleFreeze" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "forceClose"; type: "bool" }]; name: "accountClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "daoAccount"; relations: ["group"] }, { isMut: true; isSigner: false; name: "mngoBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "mngoOracle" }, { isMut: true; isSigner: false; name: "feesBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "feesOracle" }]; args: [{ name: "maxBuybackUsd"; type: "u64" }]; name: "accountBuybackFeesWithMngo" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: true; name: "oracle" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "stubOracleClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }]; name: "stubOracleSetTest" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDepositIntoExisting" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "allowBorrow"; type: "bool" }]; name: "tokenWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmounts"; type: { vec: "u64" } }]; name: "flashLoanBegin" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: true; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "inputMint" }, { isMut: false; isSigner: false; name: "outputMint" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "associatedTokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmount"; type: "u64" }]; docs: ["A version of flash_loan_begin that's specialized for swaps and needs fewer", "bytes in the transaction"]; name: "flashLoanSwapBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "numLoans"; type: "u8" }, { name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEndV2" }, { accounts: [{ docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }, { isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "healthRegionBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }]; args: []; name: "healthRegionEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { docs: ["group admin or fast listing admin, checked at #1"]; isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "serumMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "serum_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oraclePriceBand"; type: "f32" }]; docs: ["", "Serum", ""]; name: "serum3RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "oraclePriceBandOpt"; type: { option: "f32" } }]; name: "serum3EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "serumMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "serum3DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3OO" }, { kind: "account"; path: "account"; type: "publicKey" }, { kind: "account"; path: "serum_market"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: []; name: "serum3CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "serum3CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "serum3PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; docs: ["requires the receiver_bank in the health account list to be writable"]; name: "serum3PlaceOrderV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "orderId"; type: "u128" }]; name: "serum3CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "serum3CancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Deprecated instruction that used to settles all free funds from the OpenOrders account", "into the MangoAccount.", "", "Any serum \"referrer rebates\" (ui fees) are considered Mango fees."]; name: "serum3SettleFunds" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; name: "v1" }, { accounts: [{ isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }]; name: "v2" }]; args: [{ name: "feesToDao"; type: "bool" }]; docs: ["Like Serum3SettleFunds, but `fees_to_dao` determines if referrer rebates are considered fees", "or are credited to the MangoAccount."]; name: "serum3SettleFundsV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: "u64" }]; name: "tokenForceCloseBorrowsWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "perpMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "PerpMarket" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "perp_market_index"; type: "u16" }] } }, { docs: ["Accounts are initialised by client,", "anchor discriminator is set first when ix exits,"]; isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "perpMarketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "baseDecimals"; type: "u8" }, { name: "quoteLotSize"; type: "i64" }, { name: "baseLotSize"; type: "i64" }, { name: "maintBaseAssetWeight"; type: "f32" }, { name: "initBaseAssetWeight"; type: "f32" }, { name: "maintBaseLiabWeight"; type: "f32" }, { name: "initBaseLiabWeight"; type: "f32" }, { name: "maintOverallAssetWeight"; type: "f32" }, { name: "initOverallAssetWeight"; type: "f32" }, { name: "baseLiquidationFee"; type: "f32" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "minFunding"; type: "f32" }, { name: "maxFunding"; type: "f32" }, { name: "impactQuantity"; type: "i64" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "feePenalty"; type: "f32" }, { name: "settleFeeFlat"; type: "f32" }, { name: "settleFeeAmountThreshold"; type: "f32" }, { name: "settleFeeFractionLowHealth"; type: "f32" }, { name: "settleTokenIndex"; type: "u16" }, { name: "settlePnlLimitFactor"; type: "f32" }, { name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { name: "positivePnlLiquidationFee"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }]; docs: ["", "Perps", ""]; name: "perpCreateMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "baseDecimalsOpt"; type: { option: "u8" } }, { name: "maintBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "initBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "maintBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "initBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "maintOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "initOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "baseLiquidationFeeOpt"; type: { option: "f32" } }, { name: "makerFeeOpt"; type: { option: "f32" } }, { name: "takerFeeOpt"; type: { option: "f32" } }, { name: "minFundingOpt"; type: { option: "f32" } }, { name: "maxFundingOpt"; type: { option: "f32" } }, { name: "impactQuantityOpt"; type: { option: "i64" } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "feePenaltyOpt"; type: { option: "f32" } }, { name: "settleFeeFlatOpt"; type: { option: "f32" } }, { name: "settleFeeAmountThresholdOpt"; type: { option: "f32" } }, { name: "settleFeeFractionLowHealthOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "settlePnlLimitFactorOpt"; type: { option: "f32" } }, { name: "settlePnlLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "resetStablePrice"; type: "bool" }, { name: "positivePnlLiquidationFeeOpt"; type: { option: "f32" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }]; name: "perpEditMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "perpCloseMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group"] }]; args: []; name: "perpDeactivatePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrder"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrderV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPegged"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPeggedV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "orderId"; type: "u128" }]; name: "perpCancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "perpCancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpCancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "sideOption"; type: { option: { defined: "Side" } } }, { name: "limit"; type: "u8" }]; name: "perpCancelAllOrdersBySide" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "event_queue"] }, { isMut: true; isSigner: false; name: "eventQueue" }]; args: [{ name: "limit"; type: "u64" }]; name: "perpConsumeEvents" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpUpdateFunding" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "settler"; relations: ["group"] }, { isMut: false; isSigner: true; name: "settlerOwner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: []; name: "perpSettlePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpForceClosePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxSettleAmount"; type: "u64" }]; name: "perpSettleFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxBaseTransfer"; type: "i64" }, { name: "maxPnlTransfer"; type: "u64" }]; name: "perpLiqBaseOrPositivePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpLiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "insuranceBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "insuranceBankVault" }, { isMut: false; isSigner: false; name: "insuranceOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcyV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }]; name: "tokenConditionalSwapCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }]; name: "tokenConditionalSwapCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "maxPricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreatePremiumAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceStart"; type: "f64" }, { name: "priceEnd"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "startTimestamp"; type: "u64" }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreateLinearAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { docs: ["The bank's token_index is checked at #1"]; isMut: true; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapCancel" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }]; name: "tokenConditionalSwapTrigger" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }, { name: "minBuyToken"; type: "u64" }, { name: "minTakerPrice"; type: "f32" }]; name: "tokenConditionalSwapTriggerV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapStart" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "tokenChargeCollateralFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }]; name: "altSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: true; name: "payer" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }, { name: "newAddresses"; type: { vec: "publicKey" } }]; name: "altExtend" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }]; args: []; docs: ["Warning, this instruction is for testing purposes only!"]; name: "computeAccountData" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openbookV2Market"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }]; docs: ["", "OpenbookV2", ""]; name: "openbookV2RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }]; name: "openbookV2EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "openbookV2Market"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "openbookV2DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { programId: { kind: "account"; path: "openbook_v2_program"; type: "publicKey" }; seeds: [{ kind: "const"; type: "string"; value: "OpenOrders" }, { kind: "account"; path: "openbook_v2_market"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "accountNum"; type: "u32" }]; name: "openbookV2CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "openbookV2CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "orderType"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceTakerOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "side"; type: "u8" }, { name: "orderId"; type: "u128" }]; name: "openbookV2CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "feesToDao"; type: "bool" }]; name: "openbookV2SettleFunds" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "dummy" }]; args: []; docs: ["", "benchmark", ""]; name: "benchmark" }]; name: "mango_v4"; types: [{ name: "InterestRateParams"; type: { fields: [{ name: "util0"; type: "f32" }, { name: "rate0"; type: "f32" }, { name: "util1"; type: "f32" }, { name: "rate1"; type: "f32" }, { name: "maxRate"; type: "f32" }, { name: "adjustmentFactor"; type: "f32" }]; kind: "struct" } }, { name: "Equity"; type: { fields: [{ name: "tokens"; type: { vec: { defined: "TokenEquity" } } }, { name: "perps"; type: { vec: { defined: "PerpEquity" } } }]; kind: "struct" } }, { name: "TokenEquity"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "PerpEquity"; type: { fields: [{ name: "perpMarketIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "FlashLoanTokenDetail"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "changeAmount"; type: "i128" }, { name: "loan"; type: "i128" }, { name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV2"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Deposit fee paid for positive change_amount.", "", "Not factored into change_amount."]; name: "depositFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV3"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Swap fee paid on the in token of a swap.", "", "Not factored into change_amount."]; name: "swapFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "TokenPosition"; type: { fields: [{ docs: ["The deposit_index (if positive) or borrow_index (if negative) scaled position"]; name: "indexedPosition"; type: { defined: "I80F48" } }, { docs: ["index into Group.tokens"]; name: "tokenIndex"; type: "u16" }, { docs: ["incremented when a market requires this position to stay alive"]; name: "inUseCount"; type: "u16" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "previousIndex"; type: { defined: "I80F48" } }, { name: "cumulativeDepositInterest"; type: "f64" }, { name: "cumulativeBorrowInterest"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "Serum3Orders"; type: { fields: [{ name: "openOrders"; type: "publicKey" }, { docs: ["Tracks the amount of borrows that have flowed into the serum open orders account.", "These borrows did not have the loan origination fee applied, and that may happen", "later (in serum3_settle_funds) if we can guarantee that the funds were used.", "In particular a place-on-book, cancel, settle should not cost fees."]; name: "baseBorrowsWithoutFee"; type: "u64" }, { name: "quoteBorrowsWithoutFee"; type: "u64" }, { name: "marketIndex"; type: "u16" }, { docs: ["Store the base/quote token index, so health computations don't need", "to get passed the static SerumMarket to find which tokens a market", "uses and look up the correct oracles."]; name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Track something like the highest open bid / lowest open ask, in native/native units.", "", "Tracking it exactly isn't possible since we don't see fills. So instead track", "the min/max of the _placed_ bids and asks.", "", "The value is reset in serum3_place_order when a new order is placed without an", "existing one on the book.", "", "0 is a special \"unset\" state."]; name: "highestPlacedBidInv"; type: "f64" }, { name: "lowestPlacedAsk"; type: "f64" }, { docs: ["An overestimate of the amount of tokens that might flow out of the open orders account.", "", "The bank still considers these amounts user deposits (see Bank::potential_serum_tokens)", "and that value needs to be updated in conjunction with these numbers.", "", "This estimation is based on the amount of tokens in the open orders account", "(see update_bank_potential_tokens() in serum3_place_order and settle)"]; name: "potentialBaseTokens"; type: "u64" }, { name: "potentialQuoteTokens"; type: "u64" }, { docs: ["Track lowest bid/highest ask, same way as for highest bid/lowest ask.", "", "0 is a special \"unset\" state."]; name: "lowestPlacedBidInv"; type: "f64" }, { name: "highestPlacedAsk"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 16] } }]; kind: "struct" } }, { name: "PerpPosition"; type: { fields: [{ name: "marketIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Index of the current settle pnl limit window"]; name: "settlePnlLimitWindow"; type: "u32" }, { docs: ["Amount of realized trade pnl and unrealized pnl that was already settled this window.", "", "Will be negative when negative pnl was settled.", "", "Note that this will be adjusted for bookkeeping reasons when the realized_trade settle", "limitchanges and is not useable for actually tracking how much pnl was settled", "on balance."]; name: "settlePnlLimitSettledInCurrentWindowNative"; type: "i64" }, { docs: ["Active position size, measured in base lots"]; name: "basePositionLots"; type: "i64" }, { docs: ["Active position in oracle quote native. At the same time this is 1:1 a settle_token native amount.", "", "Example: Say there's a perp market on the BTC/USD price using SOL for settlement. The user buys", "one long contract for $20k, then base = 1, quote = -20k. The price goes to $21k. Now their", "unsettled pnl is (1 * 21k - 20k) __SOL__ = 1000 SOL. This is because the perp contract arbitrarily", "decides that each unit of price difference creates 1 SOL worth of settlement.", "(yes, causing 1 SOL of settlement for each $1 price change implies a lot of extra leverage; likely", "there should be an extra configurable scaling factor before we use this for cases like that)"]; name: "quotePositionNative"; type: { defined: "I80F48" } }, { docs: ["Tracks what the position is to calculate average entry & break even price"]; name: "quoteRunningNative"; type: "i64" }, { docs: ["Already settled long funding"]; name: "longSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Already settled short funding"]; name: "shortSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { docs: ["Amount of base lots on the EventQueue waiting to be processed"]; name: "takerBaseLots"; type: "i64" }, { docs: ["Amount of quote lots on the EventQueue waiting to be processed"]; name: "takerQuoteLots"; type: "i64" }, { docs: ["Cumulative long funding in quote native units.", "If the user paid $1 in funding for a long position, this would be 1e6.", "Beware of the sign!", "", "(Display only)"]; name: "cumulativeLongFunding"; type: "f64" }, { docs: ["Cumulative short funding in quote native units", "If the user paid $1 in funding for a short position, this would be -1e6.", "", "(Display only)"]; name: "cumulativeShortFunding"; type: "f64" }, { docs: ["Cumulative maker volume in quote native units", "", "(Display only)"]; name: "makerVolume"; type: "u64" }, { docs: ["Cumulative taker volume in quote native units", "", "(Display only)"]; name: "takerVolume"; type: "u64" }, { docs: ["Cumulative number of quote native units transfered from the perp position", "to the settle token spot position.", "", "For example, if the user settled $1 of positive pnl into their USDC spot", "position, this would be 1e6.", "", "(Display only)"]; name: "perpSpotTransfers"; type: "i64" }, { docs: ["The native average entry price for the base lots of the current position.", "Reset to 0 when the base position reaches or crosses 0."]; name: "avgEntryPricePerBaseLot"; type: "f64" }, { docs: ["Deprecated field: Amount of pnl that was realized by bringing the base position closer to 0."]; name: "deprecatedRealizedTradePnlNative"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled once.", "", "- The value is signed: a negative number means negative pnl can be settled.", "- A settlement in the right direction will decrease this amount.", "", "Typically added for fees, funding and liquidation."]; name: "oneshotSettlePnlAllowance"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled in each settle window.", "", "- Unsigned, the settlement can happen in both directions. Value is >= 0.", "- Previously stored a similar value that was signed, so in migration cases", "this value can be negative and should be .abs()ed.", "- If this value exceeds the current stable-upnl, it should be decreased,", "see apply_recurring_settle_pnl_allowance_constraint()", "", "When the base position is reduced, the settle limit contribution from the reduced", "base position is materialized into this value. When the base position increases,", "some of the allowance is taken away.", "", "This also gets increased when a liquidator takes over pnl."]; name: "recurringSettlePnlAllowance"; type: "i64" }, { docs: ["Trade pnl, fees, funding that were added over the current position's lifetime.", "", "Reset when the position changes sign or goes to zero.", "Not decreased by settling.", "", "This is tracked for display purposes: this value plus the difference between entry", "price and current price of the base position is the overall pnl."]; name: "realizedPnlForPositionNative"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { name: "PerpOpenOrder"; type: { fields: [{ name: "sideAndTree"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 1] } }, { name: "market"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { name: "clientId"; type: "u64" }, { name: "id"; type: "u128" }, { name: "quantity"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 56] } }]; kind: "struct" } }, { name: "MangoAccountFixed"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { name: "beingLiquidated"; type: "u8" }, { name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { name: "buybackFeesAccruedCurrent"; type: "u64" }, { name: "buybackFeesAccruedPrevious"; type: "u64" }, { name: "buybackFeesExpiryTimestamp"; type: "u64" }, { name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "confFilter"; type: { defined: "I80F48" } }, { name: "maxStalenessSlots"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { name: "OracleConfigParams"; type: { fields: [{ name: "confFilter"; type: "f32" }, { name: "maxStalenessSlots"; type: { option: "u32" } }]; kind: "struct" } }, { docs: ["InnerNodes and LeafNodes compose the binary tree of orders.", "", "Each InnerNode has exactly two children, which are either InnerNodes themselves,", "or LeafNodes. The children share the top `prefix_len` bits of `key`. The left", "child has a 0 in the next bit, and the right a 1."]; name: "InnerNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { docs: ["number of highest `key` bits that all children share", "e.g. if it's 2, the two highest bits of `key` will be the same on all children"]; name: "prefixLen"; type: "u32" }, { docs: ["only the top `prefix_len` bits of `key` are relevant"]; name: "key"; type: "u128" }, { docs: ["indexes into `BookSide::nodes`"]; name: "children"; type: { array: ["u32", 2] } }, { docs: ["The earliest expiry timestamp for the left and right subtrees.", "", "Needed to be able to find and remove expired orders without having to", "iterate through the whole bookside."]; name: "childEarliestExpiry"; type: { array: ["u64", 2] } }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { docs: ["LeafNodes represent an order in the binary tree"]; name: "LeafNode"; type: { fields: [{ docs: ["NodeTag"]; name: "tag"; type: "u8" }, { docs: ["Index into the owning MangoAccount's PerpOpenOrders"]; name: "ownerSlot"; type: "u8" }, { docs: ["PostOrderType, this was added for TradingView move order"]; name: "orderType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { docs: ["Time in seconds after `timestamp` at which the order expires.", "A value of 0 means no expiry."]; name: "timeInForce"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 2] } }, { docs: ["The binary tree key, see new_node_key()"]; name: "key"; type: "u128" }, { docs: ["Address of the owning MangoAccount"]; name: "owner"; type: "publicKey" }, { docs: ["Number of base lots to buy or sell, always >=1"]; name: "quantity"; type: "i64" }, { docs: ["The time the order was placed"]; name: "timestamp"; type: "u64" }, { docs: ["If the effective price of an oracle pegged order exceeds this limit,", "it will be considered invalid and may be removed.", "", "Only applicable in the oracle_pegged OrderTree"]; name: "pegLimit"; type: "i64" }, { docs: ["User defined id for this order, used in FillEvents"]; name: "clientOrderId"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 32] } }]; kind: "struct" } }, { name: "AnyNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "data"; type: { array: ["u8", 119] } }]; kind: "struct" } }, { name: "OrderTreeRoot"; type: { fields: [{ name: "maybeNode"; type: "u32" }, { name: "leafCount"; type: "u32" }]; kind: "struct" } }, { docs: ["A binary tree on AnyNode::key()", "", "The key encodes the price in the top 64 bits."]; name: "OrderTreeNodes"; type: { fields: [{ name: "orderTreeType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { name: "bumpIndex"; type: "u32" }, { name: "freeListLen"; type: "u32" }, { name: "freeListHead"; type: "u32" }, { name: "reserved"; type: { array: ["u8", 512] } }, { name: "nodes"; type: { array: [{ defined: "AnyNode" }, 1024] } }]; kind: "struct" } }, { name: "EventQueueHeader"; type: { fields: [{ name: "head"; type: "u32" }, { name: "count"; type: "u32" }, { name: "seqNum"; type: "u64" }]; kind: "struct" } }, { name: "AnyEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 207] } }]; kind: "struct" } }, { name: "FillEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "takerSide"; type: "u8" }, { name: "makerOut"; type: "u8" }, { name: "makerSlot"; type: "u8" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "maker"; type: "publicKey" }, { name: "padding2"; type: { array: ["u8", 32] } }, { name: "makerTimestamp"; type: "u64" }, { name: "taker"; type: "publicKey" }, { name: "padding3"; type: { array: ["u8", 16] } }, { name: "takerClientOrderId"; type: "u64" }, { name: "makerOrderId"; type: "u128" }, { name: "price"; type: "i64" }, { name: "quantity"; type: "i64" }, { name: "makerClientOrderId"; type: "u64" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 8] } }]; kind: "struct" } }, { name: "OutEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "side"; type: "u8" }, { name: "ownerSlot"; type: "u8" }, { name: "padding0"; type: { array: ["u8", 5] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "owner"; type: "publicKey" }, { name: "quantity"; type: "i64" }, { name: "orderId"; type: "u128" }, { name: "padding1"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { docs: ["Maintains a \"stable_price\" based on the oracle price.", "", "The stable price follows the oracle price, but its relative rate of", "change is limited (to `stable_growth_limit`) and futher reduced if", "the oracle price is far from the `delay_price`.", "", "Conceptually the `delay_price` is itself a time delayed", "(`24 * delay_interval_seconds`, assume 24h) and relative rate of change limited", "function of the oracle price. It is implemented as averaging the oracle", "price over every `delay_interval_seconds` (assume 1h) and then applying the", "`delay_growth_limit` between intervals."]; name: "StablePriceModel"; type: { fields: [{ docs: ["Current stable price to use in health"]; name: "stablePrice"; type: "f64" }, { name: "lastUpdateTimestamp"; type: "u64" }, { docs: ["Stored delay_price for each delay_interval.", "If we want the delay_price to be 24h delayed, we would store one for each hour.", "This is used in a cyclical way: We use the maximally-delayed value at delay_interval_index", "and once enough time passes to move to the next delay interval, that gets overwritten and", "we use the next one."]; name: "delayPrices"; type: { array: ["f64", 24] } }, { docs: ["The delay price is based on an average over each delay_interval. The contributions", "to the average are summed up here."]; name: "delayAccumulatorPrice"; type: "f64" }, { docs: ["Accumulating the total time for the above average."]; name: "delayAccumulatorTime"; type: "u32" }, { docs: ["Length of a delay_interval"]; name: "delayIntervalSeconds"; type: "u32" }, { docs: ["Maximal relative difference between two delay_price in consecutive intervals."]; name: "delayGrowthLimit"; type: "f32" }, { docs: ["Maximal per-second relative difference of the stable price.", "It gets further reduced if stable and delay price disagree."]; name: "stableGrowthLimit"; type: "f32" }, { docs: ["The delay_interval_index that update() was last called on."]; name: "lastDelayIntervalIndex"; type: "u8" }, { docs: ["If set to 1, the stable price will reset on the next non-zero price it sees."]; name: "resetOnNonzeroPrice"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { name: "reserved"; type: { array: ["u8", 48] } }]; kind: "struct" } }, { name: "TokenConditionalSwap"; type: { fields: [{ name: "id"; type: "u64" }, { docs: ["maximum amount of native tokens to buy or sell"]; name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { docs: ["how many native tokens were already bought/sold"]; name: "bought"; type: "u64" }, { name: "sold"; type: "u64" }, { docs: ["timestamp until which the conditional swap is valid"]; name: "expiryTimestamp"; type: "u64" }, { docs: ["The lower or starting price:", "- For FixedPremium or PremiumAuctions, it's the lower end of the price range:", "the tcs can only be triggered if the oracle price exceeds this value.", "- For LinearAuctions it's the starting price that's offered at start_timestamp.", "", "The price is always in \"sell_token per buy_token\" units, which can be computed", "by dividing the buy token price by the sell token price.", "", "For FixedPremium or PremiumAuctions:", "", "The price must exceed this threshold to allow execution.", "", "This threshold is compared to the \"sell_token per buy_token\" oracle price.", "If that price is >= lower_limit and <= upper_limit the tcs may be executable.", "", "Example: Stop loss to get out of a SOL long: The user bought SOL at 20 USDC/SOL", "and wants to stop loss at 18 USDC/SOL. They'd set buy_token=USDC, sell_token=SOL", "so the reference price is in SOL/USDC units. Set price_lower_limit=toNative(1/18)", "and price_upper_limit=toNative(1/10). Also set allow_borrows=false.", "", "Example: Want to buy SOL with USDC if the price falls below 22 USDC/SOL.", "buy_token=SOL, sell_token=USDC, reference price is in USDC/SOL units. Set", "price_upper_limit=toNative(22), price_lower_limit=0."]; name: "priceLowerLimit"; type: "f64" }, { docs: ["Parallel to price_lower_limit, but an upper limit / auction end price."]; name: "priceUpperLimit"; type: "f64" }, { docs: ["The premium to pay over oracle price to incentivize execution."]; name: "pricePremiumRate"; type: "f64" }, { docs: ["The taker receives only premium_price * (1 - taker_fee_rate)"]; name: "takerFeeRate"; type: "f32" }, { docs: ["The maker has to pay premium_price * (1 + maker_fee_rate)"]; name: "makerFeeRate"; type: "f32" }, { docs: ["indexes of tokens for the swap"]; name: "buyTokenIndex"; type: "u16" }, { name: "sellTokenIndex"; type: "u16" }, { docs: ["If this struct is in use. (tcs are stored in a static-length array)"]; name: "isConfigured"; type: "u8" }, { docs: ["may token purchases create deposits? (often users just want to get out of a borrow)"]; name: "allowCreatingDeposits"; type: "u8" }, { docs: ["may token selling create borrows? (often users just want to get out of a long)"]; name: "allowCreatingBorrows"; type: "u8" }, { docs: ["The stored prices are always \"sell token per buy token\", but if the user", "used \"buy token per sell token\" when creating the tcs order, we should continue", "to show them prices in that way.", "", "Stores a TokenConditionalSwapDisplayPriceStyle enum value"]; name: "displayPriceStyle"; type: "u8" }, { docs: ["The intention the user had when placing this order, display-only", "", "Stores a TokenConditionalSwapIntention enum value"]; name: "intention"; type: "u8" }, { docs: ["Stores a TokenConditionalSwapType enum value"]; name: "tcsType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { docs: ["In seconds since epoch. 0 means not-started.", "", "FixedPremium: Time of first trigger call. No other effect.", "PremiumAuction: Time of start or first trigger call. Can continue to trigger once started.", "LinearAuction: Set during creation, auction starts with price_lower_limit at this timestamp."]; name: "startTimestamp"; type: "u64" }, { docs: ["Duration of the auction mechanism", "", "FixedPremium: ignored", "PremiumAuction: time after start that the premium needs to scale to price_premium_rate", "LinearAuction: time after start to go from price_lower_limit to price_upper_limit"]; name: "durationSeconds"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { docs: ["Nothing in Rust shall use these types. They only exist so that the Anchor IDL", "knows about them and typescript can deserialize it."]; name: "TokenIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "Serum3MarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "PerpMarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "I80F48"; type: { fields: [{ name: "val"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanType"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "Swap" }, { name: "SwapWithoutFee" }] } }, { docs: ["Copy paste a bunch of enums so that we could AnchorSerialize & AnchorDeserialize them"]; name: "Serum3SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Serum3OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }] } }, { name: "Serum3Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["There are three types of health:", "- initial health (\"init\"): users can only open new positions if it's >= 0", "- maintenance health (\"maint\"): users get liquidated if it's < 0", "- liquidation end health: once liquidation started (see being_liquidated), it", "only stops once this is >= 0", "", "The ordering is", "init health <= liquidation end health <= maint health", "", "The different health types are realized by using different weights and prices:", "- init health: init weights with scaling, stable-price adjusted prices", "- liq end health: init weights without scaling, oracle prices", "- maint health: maint weights, oracle prices", ""]; name: "HealthType"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "Maint" }, { name: "LiquidationEnd" }] } }, { name: "LoanOriginationFeeInstruction"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "LiqTokenBankruptcy" }, { name: "LiqTokenWithToken" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3SettleFunds" }, { name: "TokenWithdraw" }, { name: "TokenConditionalSwapTrigger" }] } }, { docs: ["Enum for lookup into ix gate", "note:", "total ix files 56,", "ix files included 48,", "ix files not included 8,", "- Benchmark,", "- ComputeAccountData,", "- GroupCreate", "- GroupEdit", "- IxGateSet,", "- PerpZeroOut,", "- PerpEditMarket,", "- TokenEdit,"]; name: "IxGate"; type: { kind: "enum"; variants: [{ name: "AccountClose" }, { name: "AccountCreate" }, { name: "AccountEdit" }, { name: "AccountExpand" }, { name: "AccountToggleFreeze" }, { name: "AltExtend" }, { name: "AltSet" }, { name: "FlashLoan" }, { name: "GroupClose" }, { name: "GroupCreate" }, { name: "HealthRegion" }, { name: "PerpCancelAllOrders" }, { name: "PerpCancelAllOrdersBySide" }, { name: "PerpCancelOrder" }, { name: "PerpCancelOrderByClientOrderId" }, { name: "PerpCloseMarket" }, { name: "PerpConsumeEvents" }, { name: "PerpCreateMarket" }, { name: "PerpDeactivatePosition" }, { name: "PerpLiqBaseOrPositivePnl" }, { name: "PerpLiqForceCancelOrders" }, { name: "PerpLiqNegativePnlOrBankruptcy" }, { name: "PerpPlaceOrder" }, { name: "PerpSettleFees" }, { name: "PerpSettlePnl" }, { name: "PerpUpdateFunding" }, { name: "Serum3CancelAllOrders" }, { name: "Serum3CancelOrder" }, { name: "Serum3CloseOpenOrders" }, { name: "Serum3CreateOpenOrders" }, { name: "Serum3DeregisterMarket" }, { name: "Serum3EditMarket" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3RegisterMarket" }, { name: "Serum3SettleFunds" }, { name: "StubOracleClose" }, { name: "StubOracleCreate" }, { name: "StubOracleSet" }, { name: "TokenAddBank" }, { name: "TokenDeposit" }, { name: "TokenDeregister" }, { name: "TokenLiqBankruptcy" }, { name: "TokenLiqWithToken" }, { name: "TokenRegister" }, { name: "TokenRegisterTrustless" }, { name: "TokenUpdateIndexAndRate" }, { name: "TokenWithdraw" }, { name: "AccountBuybackFeesWithMngo" }, { name: "TokenForceCloseBorrowsWithToken" }, { name: "PerpForceClosePosition" }, { name: "GroupWithdrawInsuranceFund" }, { name: "TokenConditionalSwapCreate" }, { name: "TokenConditionalSwapTrigger" }, { name: "TokenConditionalSwapCancel" }, { name: "OpenbookV2CancelOrder" }, { name: "OpenbookV2CloseOpenOrders" }, { name: "OpenbookV2CreateOpenOrders" }, { name: "OpenbookV2DeregisterMarket" }, { name: "OpenbookV2EditMarket" }, { name: "OpenbookV2LiqForceCancelOrders" }, { name: "OpenbookV2PlaceOrder" }, { name: "OpenbookV2PlaceTakeOrder" }, { name: "OpenbookV2RegisterMarket" }, { name: "OpenbookV2SettleFunds" }, { name: "AdminTokenWithdrawFees" }, { name: "AdminPerpWithdrawFees" }, { name: "AccountSizeMigration" }, { name: "TokenConditionalSwapStart" }, { name: "TokenConditionalSwapCreatePremiumAuction" }, { name: "TokenConditionalSwapCreateLinearAuction" }, { name: "Serum3PlaceOrderV2" }] } }, { name: "CheckLiquidatable"; type: { kind: "enum"; variants: [{ name: "NotLiquidatable" }, { name: "Liquidatable" }, { name: "BecameNotLiquidatable" }] } }, { name: "OracleType"; type: { kind: "enum"; variants: [{ name: "Pyth" }, { name: "Stub" }, { name: "SwitchboardV1" }, { name: "SwitchboardV2" }, { name: "OrcaCLMM" }] } }, { name: "OrderState"; type: { kind: "enum"; variants: [{ name: "Valid" }, { name: "Invalid" }, { name: "Skipped" }] } }, { name: "BookSideOrderTree"; type: { kind: "enum"; variants: [{ name: "Fixed" }, { name: "OraclePegged" }] } }, { name: "NodeTag"; type: { kind: "enum"; variants: [{ name: "Uninitialized" }, { name: "InnerNode" }, { name: "LeafNode" }, { name: "FreeNode" }, { name: "LastFreeNode" }] } }, { name: "PlaceOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "PostOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "PostOnly" }, { name: "PostOnlySlide" }] } }, { docs: ["Self trade behavior controls how taker orders interact with resting limit orders of the same account.", "This setting has no influence on placing a resting or oracle pegged limit order that does not match", "immediately, instead it's the responsibility of the user to correctly configure his taker orders."]; name: "SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["SideAndOrderTree is a storage optimization, so we don't need two bytes for the data"]; name: "SideAndOrderTree"; type: { kind: "enum"; variants: [{ name: "BidFixed" }, { name: "AskFixed" }, { name: "BidOraclePegged" }, { name: "AskOraclePegged" }] } }, { name: "OrderParams"; type: { kind: "enum"; variants: [{ name: "Market" }, { fields: [{ name: "price_lots"; type: "i64" }]; name: "ImmediateOrCancel" }, { fields: [{ name: "price_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }]; name: "Fixed" }, { fields: [{ name: "price_offset_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }, { name: "peg_limit"; type: "i64" }, { name: "max_oracle_staleness_slots"; type: "i32" }]; name: "OraclePegged" }] } }, { name: "OrderTreeType"; type: { kind: "enum"; variants: [{ name: "Bids" }, { name: "Asks" }] } }, { name: "EventType"; type: { kind: "enum"; variants: [{ name: "Fill" }, { name: "Out" }, { name: "Liquidate" }] } }, { name: "TokenConditionalSwapDisplayPriceStyle"; type: { kind: "enum"; variants: [{ name: "SellTokenPerBuyToken" }, { name: "BuyTokenPerSellToken" }] } }, { name: "TokenConditionalSwapIntention"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "StopLoss" }, { name: "TakeProfit" }] } }, { name: "TokenConditionalSwapType"; type: { kind: "enum"; variants: [{ name: "FixedPremium" }, { name: "PremiumAuction" }, { name: "LinearAuction" }] } }]; version: "0.22.0" }

                      Type declaration

                      • accounts: [{ name: "bank"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 16] } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "oracle"; type: "publicKey" }, { name: "oracleConfig"; type: { defined: "OracleConfig" } }, { name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["the index used to scale the value of an IndexedPosition", "TODO: should always be >= 0, add checks?"]; name: "depositIndex"; type: { defined: "I80F48" } }, { name: "borrowIndex"; type: { defined: "I80F48" } }, { docs: ["deposits/borrows for this bank", "", "Note that these may become negative. It's perfectly fine for users to borrow one one bank", "(increasing indexed_borrows there) and paying back on another (possibly decreasing indexed_borrows", "below zero).", "", "The vault amount is not deducable from these values.", "", "These become meaningful when summed over all banks (like in update_index_and_rate)."]; name: "indexedDeposits"; type: { defined: "I80F48" } }, { name: "indexedBorrows"; type: { defined: "I80F48" } }, { name: "indexLastUpdated"; type: "u64" }, { name: "bankRateLastUpdated"; type: "u64" }, { name: "avgUtilization"; type: { defined: "I80F48" } }, { name: "adjustmentFactor"; type: { defined: "I80F48" } }, { docs: ["The unscaled borrow interest curve is defined as continuous piecewise linear with the points:", "", "- 0% util: zero_util_rate", "- util0% util: rate0", "- util1% util: rate1", "- 100% util: max_rate", "", "The final rate is this unscaled curve multiplied by interest_curve_scaling."]; name: "util0"; type: { defined: "I80F48" } }, { name: "rate0"; type: { defined: "I80F48" } }, { name: "util1"; type: { defined: "I80F48" } }, { name: "rate1"; type: { defined: "I80F48" } }, { docs: ["the 100% utilization rate", "", "This isn't the max_rate, since this still gets scaled by interest_curve_scaling,", "which is >=1."]; name: "maxRate"; type: { defined: "I80F48" } }, { docs: ["Fees collected over the lifetime of the bank", "", "See fees_withdrawn for how much of the fees was withdrawn.", "See collected_liquidation_fees for the (included) subtotal for liquidation related fees."]; name: "collectedFeesNative"; type: { defined: "I80F48" } }, { name: "loanOriginationFeeRate"; type: { defined: "I80F48" } }, { name: "loanFeeRate"; type: { defined: "I80F48" } }, { name: "maintAssetWeight"; type: { defined: "I80F48" } }, { name: "initAssetWeight"; type: { defined: "I80F48" } }, { name: "maintLiabWeight"; type: { defined: "I80F48" } }, { name: "initLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Liquidation fee that goes to the liqor.", "", "Liquidation always involves two tokens, and the sum of the two configured fees is used.", "", "A fraction of the price, like 0.05 for a 5% fee during liquidation.", "", "See also platform_liquidation_fee."]; name: "liquidationFee"; type: { defined: "I80F48" } }, { name: "dust"; type: { defined: "I80F48" } }, { name: "flashLoanTokenAccountInitial"; type: "u64" }, { name: "flashLoanApprovedAmount"; type: "u64" }, { name: "tokenIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "mintDecimals"; type: "u8" }, { name: "bankNum"; type: "u32" }, { docs: ["The maximum utilization allowed when borrowing is 1-this value", "WARNING: Outdated name, kept for IDL compatibility"]; name: "minVaultToDepositsRatio"; type: "f64" }, { docs: ["Size in seconds of a net borrows window"]; name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { docs: ["Timestamp at which the last net borrows window started"]; name: "lastNetBorrowsWindowStartTs"; type: "u64" }, { docs: ["Net borrow limit per window in quote native; set to -1 to disable."]; name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { docs: ["Sum of all deposits and borrows in the last window, in native units."]; name: "netBorrowsInWindow"; type: "i64" }, { docs: ["Soft borrow limit in native quote", "", "Once the borrows on the bank exceed this quote value, init_liab_weight is scaled up.", "Set to f64::MAX to disable.", "", "See scaled_init_liab_weight()."]; name: "borrowWeightScaleStartQuote"; type: "f64" }, { docs: ["Limit for collateral of deposits in native quote", "", "Once the deposits in the bank exceed this quote value, init_asset_weight is scaled", "down to keep the total collateral value constant.", "Set to f64::MAX to disable.", "", "See scaled_init_asset_weight()."]; name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { docs: ["If set to 1, deposits cannot be liquidated when an account is liquidatable.", "That means bankrupt accounts may still have assets of this type deposited."]; name: "disableAssetLiquidation"; type: "u8" }, { name: "padding"; type: { array: ["u8", 5] } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Fees for the token conditional swap feature"]; name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { docs: ["Target utilization: If actual utilization is higher, scale up interest.", "If it's lower, scale down interest (if possible)"]; name: "interestTargetUtilization"; type: "f32" }, { docs: ["Current interest curve scaling, always >= 1.0", "", "Except when first migrating to having this field, then 0.0"]; name: "interestCurveScaling"; type: "f64" }, { docs: ["Largest amount of tokens that might be added the the bank based on", "serum open order execution."]; name: "potentialSerumTokens"; type: "u64" }, { docs: ["Start timestamp in seconds at which maint weights should start to change away", "from maint_asset_weight, maint_liab_weight towards _asset_target and _liab_target.", "If _start and _end and _duration_inv are 0, no shift is configured."]; name: "maintWeightShiftStart"; type: "u64" }, { docs: ["End timestamp in seconds until which the maint weights should reach the configured targets."]; name: "maintWeightShiftEnd"; type: "u64" }, { docs: ["Cache of the inverse of maint_weight_shift_end - maint_weight_shift_start,", "or zero if no shift is configured"]; name: "maintWeightShiftDurationInv"; type: { defined: "I80F48" } }, { docs: ["Maint asset weight to reach at _shift_end."]; name: "maintWeightShiftAssetTarget"; type: { defined: "I80F48" } }, { name: "maintWeightShiftLiabTarget"; type: { defined: "I80F48" } }, { docs: ["Oracle that may be used if the main oracle is stale or not confident enough.", "If this is Pubkey::default(), no fallback is available."]; name: "fallbackOracle"; type: "publicKey" }, { docs: ["zero means none, in token native"]; name: "depositLimit"; type: "u64" }, { docs: ["The unscaled borrow interest curve point for zero utilization.", "", "See util0, rate0, util1, rate1, max_rate"]; name: "zeroUtilRate"; type: { defined: "I80F48" } }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were collected during liquidation (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedLiquidationFees"; type: { defined: "I80F48" } }, { docs: ["Collateral fees that have been collected (in native tokens)", "", "See also collected_fees_native and fees_withdrawn."]; name: "collectedCollateralFees"; type: { defined: "I80F48" } }, { docs: ["The daily collateral fees rate for fully utilized collateral."]; name: "collateralFeePerDay"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 1900] } }]; kind: "struct" } }, { name: "group"; type: { fields: [{ name: "creator"; type: "publicKey" }, { name: "groupNum"; type: "u32" }, { name: "admin"; type: "publicKey" }, { name: "fastListingAdmin"; type: "publicKey" }, { name: "mngoTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceMint"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }, { name: "buybackFees"; type: "u8" }, { name: "buybackFeesMngoBonusFactor"; type: "f32" }, { name: "addressLookupTables"; type: { array: ["publicKey", 20] } }, { name: "securityAdmin"; type: "publicKey" }, { name: "depositLimitQuote"; type: "u64" }, { name: "ixGate"; type: "u128" }, { name: "buybackFeesSwapMangoAccount"; type: "publicKey" }, { docs: ["Number of seconds after which fees that could be used with the fees buyback feature expire.", "", "The actual expiry is staggered such that the fees users accumulate are always", "available for at least this interval - but may be available for up to twice this time.", "", "When set to 0, there's no expiry of buyback fees."]; name: "buybackFeesExpiryInterval"; type: "u64" }, { docs: ["Fast-listings are limited per week, this is the start of the current fast-listing interval", "in seconds since epoch"]; name: "fastListingIntervalStart"; type: "u64" }, { docs: ["Number of fast listings that happened this interval"]; name: "fastListingsInInterval"; type: "u16" }, { docs: ["Number of fast listings that are allowed per interval"]; name: "allowedFastListingsPerInterval"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { docs: ["Intervals in which collateral fee is applied"]; name: "collateralFeeInterval"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 1800] } }]; kind: "struct" } }, { name: "mangoAccount"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { docs: ["Tracks that this account should be liquidated until init_health >= 0.", "", "Normally accounts can not be liquidated while maint_health >= 0. But when an account", "reaches maint_health < 0, liquidators will call a liquidation instruction and thereby", "set this flag. Now the account may be liquidated until init_health >= 0.", "", "Many actions should be disabled while the account is being liquidated, even if", "its maint health has recovered to positive. Creating new open orders would, for example,", "confuse liquidators."]; name: "beingLiquidated"; type: "u8" }, { docs: ["The account is currently inside a health region marked by HealthRegionBegin...HealthRegionEnd.", "", "Must never be set after a transaction ends."]; name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { docs: ["Init health as calculated during HealthReginBegin, rounded up."]; name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { docs: ["Fees usable with the \"fees buyback\" feature.", "This tracks the ones that accrued in the current expiry interval."]; name: "buybackFeesAccruedCurrent"; type: "u64" }, { docs: ["Fees buyback amount from the previous expiry interval."]; name: "buybackFeesAccruedPrevious"; type: "u64" }, { docs: ["End timestamp of the current expiry interval of the buyback fees amount."]; name: "buybackFeesExpiryTimestamp"; type: "u64" }, { docs: ["Next id to use when adding a token condition swap"]; name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { docs: ["Time at which the last collateral fee was charged"]; name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }, { name: "headerVersion"; type: "u8" }, { name: "padding3"; type: { array: ["u8", 7] } }, { name: "padding4"; type: "u32" }, { name: "tokens"; type: { vec: { defined: "TokenPosition" } } }, { name: "padding5"; type: "u32" }, { name: "serum3"; type: { vec: { defined: "Serum3Orders" } } }, { name: "padding6"; type: "u32" }, { name: "perps"; type: { vec: { defined: "PerpPosition" } } }, { name: "padding7"; type: "u32" }, { name: "perpOpenOrders"; type: { vec: { defined: "PerpOpenOrder" } } }, { name: "padding8"; type: "u32" }, { name: "tokenConditionalSwaps"; type: { vec: { defined: "TokenConditionalSwap" } } }, { name: "reservedDynamic"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "mintInfo"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "tokenIndex"; type: "u16" }, { name: "groupInsuranceFund"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }, { name: "mint"; type: "publicKey" }, { name: "banks"; type: { array: ["publicKey", 6] } }, { name: "vaults"; type: { array: ["publicKey", 6] } }, { name: "oracle"; type: "publicKey" }, { name: "registrationTime"; type: "u64" }, { name: "fallbackOracle"; type: "publicKey" }, { name: "reserved"; type: { array: ["u8", 2528] } }]; kind: "struct" } }, { name: "openbookV2Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "openbookV2Program"; type: "publicKey" }, { name: "openbookV2MarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 5] } }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 512] } }]; kind: "struct" } }, { name: "openbookV2MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }, { name: "stubOracle"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "mint"; type: "publicKey" }, { name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateTs"; type: "i64" }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 104] } }]; kind: "struct" } }, { name: "bookSide"; type: { fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" } }, { name: "eventQueue"; type: { fields: [{ name: "header"; type: { defined: "EventQueueHeader" } }, { name: "buf"; type: { array: [{ defined: "AnyEvent" }, 488] } }, { name: "reserved"; type: { array: ["u8", 64] } }]; kind: "struct" } }, { name: "perpMarket"; type: { fields: [{ name: "group"; type: "publicKey" }, { docs: ["Token index that settlements happen in.", "", "Currently required to be 0, USDC. In the future settlement", "may be allowed to happen in other tokens."]; name: "settleTokenIndex"; type: "u16" }, { docs: ["Index of this perp market. Other data, like the MangoAccount's PerpPosition", "reference this market via this index. Unique for this group's perp markets."]; name: "perpMarketIndex"; type: "u16" }, { docs: ["Field used to contain the trusted_market flag and is now unused."]; name: "blocked1"; type: "u8" }, { docs: ["Is this market covered by the group insurance fund?"]; name: "groupInsuranceFund"; type: "u8" }, { docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { docs: ["Name. Trailing zero bytes are ignored."]; name: "name"; type: { array: ["u8", 16] } }, { docs: ["Address of the BookSide account for bids"]; name: "bids"; type: "publicKey" }, { docs: ["Address of the BookSide account for asks"]; name: "asks"; type: "publicKey" }, { docs: ["Address of the EventQueue account"]; name: "eventQueue"; type: "publicKey" }, { docs: ["Oracle account address"]; name: "oracle"; type: "publicKey" }, { docs: ["Oracle configuration"]; name: "oracleConfig"; type: { defined: "OracleConfig" } }, { docs: ["Maintains a stable price based on the oracle price that is less volatile."]; name: "stablePriceModel"; type: { defined: "StablePriceModel" } }, { docs: ["Number of quote native in a quote lot. Must be a power of 10.", "", "Primarily useful for increasing the tick size on the market: A lot price", "of 1 becomes a native price of quote_lot_size/base_lot_size becomes a", "ui price of quote_lot_size*base_decimals/base_lot_size/quote_decimals."]; name: "quoteLotSize"; type: "i64" }, { docs: ["Number of base native in a base lot. Must be a power of 10.", "", "Example: If base decimals for the underlying asset is 6, base lot size", "is 100 and and base position lots is 10_000 then base position native is", "1_000_000 and base position ui is 1."]; name: "baseLotSize"; type: "i64" }, { docs: ["These weights apply to the base position. The quote position has", "no explicit weight (but may be covered by the overall pnl asset weight)."]; name: "maintBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "initBaseAssetWeight"; type: { defined: "I80F48" } }, { name: "maintBaseLiabWeight"; type: { defined: "I80F48" } }, { name: "initBaseLiabWeight"; type: { defined: "I80F48" } }, { docs: ["Number of base lots currently active in the market. Always >= 0.", "", "Since this counts positive base lots and negative base lots, the more relevant", "number of open base lot pairs is half this value."]; name: "openInterest"; type: "i64" }, { docs: ["Total number of orders seen"]; name: "seqNum"; type: "u64" }, { docs: ["Timestamp in seconds that the market was registered at."]; name: "registrationTime"; type: "u64" }, { docs: ["Minimal funding rate per day, must be <= 0."]; name: "minFunding"; type: { defined: "I80F48" } }, { docs: ["Maximal funding rate per day, must be >= 0."]; name: "maxFunding"; type: { defined: "I80F48" } }, { docs: ["For funding, get the impact price this many base lots deep into the book."]; name: "impactQuantity"; type: "i64" }, { docs: ["Current long funding value. Increasing it means that every long base lot", "needs to pay that amount of quote native in funding.", "", "PerpPosition uses and tracks it settle funding. Updated by the perp", "keeper instruction."]; name: "longFunding"; type: { defined: "I80F48" } }, { docs: ["See long_funding."]; name: "shortFunding"; type: { defined: "I80F48" } }, { docs: ["timestamp that funding was last updated in"]; name: "fundingLastUpdated"; type: "u64" }, { docs: ["Fees", "Fee for base position liquidation"]; name: "baseLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Fee when matching maker orders. May be negative."]; name: "makerFee"; type: { defined: "I80F48" } }, { docs: ["Fee for taker orders, may not be negative."]; name: "takerFee"; type: { defined: "I80F48" } }, { docs: ["Fees accrued in native quote currency", "these are increased when new fees are paid and decreased when perp_settle_fees is called"]; name: "feesAccrued"; type: { defined: "I80F48" } }, { docs: ["Fees settled in native quote currency", "these are increased when perp_settle_fees is called, and never decreased"]; name: "feesSettled"; type: { defined: "I80F48" } }, { docs: ["Fee (in quote native) to charge for ioc orders"]; name: "feePenalty"; type: "f32" }, { docs: ["In native units of settlement token, given to each settle call above the", "settle_fee_amount_threshold if settling at least 1% of perp base pos value."]; name: "settleFeeFlat"; type: "f32" }, { docs: ["Pnl settlement amount needed to be eligible for the flat fee."]; name: "settleFeeAmountThreshold"; type: "f32" }, { docs: ["Fraction of pnl to pay out as fee if +pnl account has low health.", "(limited to 2x settle_fee_flat)"]; name: "settleFeeFractionLowHealth"; type: "f32" }, { docs: ["Controls the strictness of the settle limit.", "Set to a negative value to disable the limit.", "", "This factor applies to the settle limit in two ways", "- for the unrealized pnl settle limit, the factor is multiplied with the stable perp base value", "(i.e. limit_factor * base_native * stable_price)", "- when increasing the realized pnl settle limit (stored per PerpPosition), the factor is", "multiplied with the stable value of the perp pnl being realized", "(i.e. limit_factor * reduced_native * stable_price)", "", "See also PerpPosition::settle_pnl_limit_realized_trade"]; name: "settlePnlLimitFactor"; type: "f32" }, { name: "padding3"; type: { array: ["u8", 4] } }, { docs: ["Window size in seconds for the perp settlement limit"]; name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { docs: ["If true, users may no longer increase their market exposure. Only actions", "that reduce their position are still allowed."]; name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding4"; type: { array: ["u8", 6] } }, { docs: ["Weights for full perp market health, if positive"]; name: "maintOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "initOverallAssetWeight"; type: { defined: "I80F48" } }, { name: "positivePnlLiquidationFee"; type: { defined: "I80F48" } }, { name: "feesWithdrawn"; type: "u64" }, { docs: ["Additional to liquidation_fee, but goes to the group owner instead of the liqor"]; name: "platformLiquidationFee"; type: { defined: "I80F48" } }, { docs: ["Platform fees that were accrued during liquidation (in native tokens)", "", "These fees are also added to fees_accrued, this is just for bookkeeping the total", "liquidation fees that happened. So never decreases (different to fees_accrued)."]; name: "accruedLiquidationFees"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 1848] } }]; kind: "struct" } }, { name: "serum3Market"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "reduceOnly"; type: "u8" }, { name: "forceClose"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 2] } }, { name: "name"; type: { array: ["u8", 16] } }, { name: "serumProgram"; type: "publicKey" }, { name: "serumMarketExternal"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "bump"; type: "u8" }, { name: "padding2"; type: { array: ["u8", 1] } }, { docs: ["Limit orders must be <= oracle * (1+band) and >= oracle / (1+band)", "", "Zero value is the default due to migration and disables the limit,", "same as f32::MAX."]; name: "oraclePriceBand"; type: "f32" }, { name: "registrationTime"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "serum3MarketIndexReservation"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "marketIndex"; type: "u16" }, { name: "reserved"; type: { array: ["u8", 38] } }]; kind: "struct" } }]
                      • errors: [{ code: 6000; msg: ""; name: "SomeError" }, { code: 6001; msg: ""; name: "NotImplementedError" }, { code: 6002; msg: "checked math error"; name: "MathError" }, { code: 6003; msg: ""; name: "UnexpectedOracle" }, { code: 6004; msg: "oracle type cannot be determined"; name: "UnknownOracleType" }, { code: 6005; msg: ""; name: "InvalidFlashLoanTargetCpiProgram" }, { code: 6006; msg: "health must be positive"; name: "HealthMustBePositive" }, { code: 6007; msg: "health must be positive or not decrease"; name: "HealthMustBePositiveOrIncrease" }, { code: 6008; msg: "health must be negative"; name: "HealthMustBeNegative" }, { code: 6009; msg: "the account is bankrupt"; name: "IsBankrupt" }, { code: 6010; msg: "the account is not bankrupt"; name: "IsNotBankrupt" }, { code: 6011; msg: "no free token position index"; name: "NoFreeTokenPositionIndex" }, { code: 6012; msg: "no free serum3 open orders index"; name: "NoFreeSerum3OpenOrdersIndex" }, { code: 6013; msg: "no free perp position index"; name: "NoFreePerpPositionIndex" }, { code: 6014; msg: "serum3 open orders exist already"; name: "Serum3OpenOrdersExistAlready" }, { code: 6015; msg: "bank vault has insufficent funds"; name: "InsufficentBankVaultFunds" }, { code: 6016; msg: "account is currently being liquidated"; name: "BeingLiquidated" }, { code: 6017; msg: "invalid bank"; name: "InvalidBank" }, { code: 6018; msg: "account profitability is mismatched"; name: "ProfitabilityMismatch" }, { code: 6019; msg: "cannot settle with self"; name: "CannotSettleWithSelf" }, { code: 6020; msg: "perp position does not exist"; name: "PerpPositionDoesNotExist" }, { code: 6021; msg: "max settle amount must be greater than zero"; name: "MaxSettleAmountMustBeGreaterThanZero" }, { code: 6022; msg: "the perp position has open orders or unprocessed fill events"; name: "HasOpenPerpOrders" }, { code: 6023; msg: "an oracle does not reach the confidence threshold"; name: "OracleConfidence" }, { code: 6024; msg: "an oracle is stale"; name: "OracleStale" }, { code: 6025; msg: "settlement amount must always be positive"; name: "SettlementAmountMustBePositive" }, { code: 6026; msg: "bank utilization has reached limit"; name: "BankBorrowLimitReached" }, { code: 6027; msg: "bank net borrows has reached limit - this is an intermittent error - the limit will reset regularly"; name: "BankNetBorrowsLimitReached" }, { code: 6028; msg: "token position does not exist"; name: "TokenPositionDoesNotExist" }, { code: 6029; msg: "token deposits into accounts that are being liquidated must bring their health above the init threshold"; name: "DepositsIntoLiquidatingMustRecover" }, { code: 6030; msg: "token is in reduce only mode"; name: "TokenInReduceOnlyMode" }, { code: 6031; msg: "market is in reduce only mode"; name: "MarketInReduceOnlyMode" }, { code: 6032; msg: "group is halted"; name: "GroupIsHalted" }, { code: 6033; msg: "the perp position has non-zero base lots"; name: "PerpHasBaseLots" }, { code: 6034; msg: "there are open or unsettled serum3 orders"; name: "HasOpenOrUnsettledSerum3Orders" }, { code: 6035; msg: "has liquidatable token position"; name: "HasLiquidatableTokenPosition" }, { code: 6036; msg: "has liquidatable perp base position"; name: "HasLiquidatablePerpBasePosition" }, { code: 6037; msg: "has liquidatable positive perp pnl"; name: "HasLiquidatablePositivePerpPnl" }, { code: 6038; msg: "account is frozen"; name: "AccountIsFrozen" }, { code: 6039; msg: "Init Asset Weight can't be negative"; name: "InitAssetWeightCantBeNegative" }, { code: 6040; msg: "has open perp taker fills"; name: "HasOpenPerpTakerFills" }, { code: 6041; msg: "deposit crosses the current group deposit limit"; name: "DepositLimit" }, { code: 6042; msg: "instruction is disabled"; name: "IxIsDisabled" }, { code: 6043; msg: "no liquidatable perp base position"; name: "NoLiquidatablePerpBasePosition" }, { code: 6044; msg: "perp order id not found on the orderbook"; name: "PerpOrderIdNotFound" }, { code: 6045; msg: "HealthRegions allow only specific instructions between Begin and End"; name: "HealthRegionBadInnerInstruction" }, { code: 6046; msg: "token is in force close"; name: "TokenInForceClose" }, { code: 6047; msg: "incorrect number of health accounts"; name: "InvalidHealthAccountCount" }, { code: 6048; msg: "would self trade"; name: "WouldSelfTrade" }, { code: 6049; msg: "token conditional swap oracle price is not in execution range"; name: "TokenConditionalSwapPriceNotInRange" }, { code: 6050; msg: "token conditional swap is expired"; name: "TokenConditionalSwapExpired" }, { code: 6051; msg: "token conditional swap is not available yet"; name: "TokenConditionalSwapNotStarted" }, { code: 6052; msg: "token conditional swap was already started"; name: "TokenConditionalSwapAlreadyStarted" }, { code: 6053; msg: "token conditional swap it not set"; name: "TokenConditionalSwapNotSet" }, { code: 6054; msg: "token conditional swap trigger did not reach min_buy_token"; name: "TokenConditionalSwapMinBuyTokenNotReached" }, { code: 6055; msg: "token conditional swap cannot pay incentive"; name: "TokenConditionalSwapCantPayIncentive" }, { code: 6056; msg: "token conditional swap taker price is too low"; name: "TokenConditionalSwapTakerPriceTooLow" }, { code: 6057; msg: "token conditional swap index and id don't match"; name: "TokenConditionalSwapIndexIdMismatch" }, { code: 6058; msg: "token conditional swap volume is too small compared to the cost of starting it"; name: "TokenConditionalSwapTooSmallForStartIncentive" }, { code: 6059; msg: "token conditional swap type cannot be started"; name: "TokenConditionalSwapTypeNotStartable" }, { code: 6060; msg: "a bank in the health account list should be writable but is not"; name: "HealthAccountBankNotWritable" }, { code: 6061; msg: "the market does not allow limit orders too far from the current oracle value"; name: "Serum3PriceBandExceeded" }, { code: 6062; msg: "deposit crosses the token's deposit limit"; name: "BankDepositLimit" }, { code: 6063; msg: "delegates can only withdraw to the owner's associated token account"; name: "DelegateWithdrawOnlyToOwnerAta" }, { code: 6064; msg: "delegates can only withdraw if they close the token position"; name: "DelegateWithdrawMustClosePosition" }, { code: 6065; msg: "delegates can only withdraw small amounts"; name: "DelegateWithdrawSmall" }, { code: 6066; msg: "The provided CLMM oracle is not valid"; name: "InvalidCLMMOracle" }, { code: 6067; msg: "invalid usdc/usd feed provided for the CLMM oracle"; name: "InvalidFeedForCLMMOracle" }, { code: 6068; msg: "Pyth USDC/USD or SOL/USD feed not found (required by CLMM oracle)"; name: "MissingFeedForCLMMOracle" }, { code: 6069; msg: "the asset does not allow liquidation"; name: "TokenAssetLiquidationDisabled" }]
                      • events: [{ fields: [{ index: false; name: "initHealth"; type: { defined: "I80F48" } }, { index: false; name: "maintHealth"; type: { defined: "I80F48" } }, { index: false; name: "equity"; type: { defined: "Equity" } }]; name: "MangoAccountData" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "basePosition"; type: "i64" }, { index: false; name: "quotePosition"; type: "i128" }, { index: false; name: "longSettledFunding"; type: "i128" }, { index: false; name: "shortSettledFunding"; type: "i128" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }]; name: "PerpBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "indexedPosition"; type: "i128" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }]; name: "TokenBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetail" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV2" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenLoanDetails"; type: { vec: { defined: "FlashLoanTokenDetailV3" } } }, { index: false; name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "FlashLoanLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "WithdrawLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "signer"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "quantity"; type: "u64" }, { index: false; name: "price"; type: "i128" }]; name: "DepositLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerOrderId"; type: "u128" }, { index: false; name: "makerFee"; type: "i128" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerOrderId"; type: "u128" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "i128" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }]; name: "FillLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "makerSlot"; type: "u8" }, { index: false; name: "makerOut"; type: "bool" }, { index: false; name: "timestamp"; type: "u64" }, { index: false; name: "seqNum"; type: "u64" }, { index: false; name: "maker"; type: "publicKey" }, { index: false; name: "makerClientOrderId"; type: "u64" }, { index: false; name: "makerFee"; type: "f32" }, { index: false; name: "makerTimestamp"; type: "u64" }, { index: false; name: "taker"; type: "publicKey" }, { index: false; name: "takerClientOrderId"; type: "u64" }, { index: false; name: "takerFee"; type: "f32" }, { index: false; name: "price"; type: "i64" }, { index: false; name: "quantity"; type: "i64" }, { index: false; name: "makerClosedPnl"; type: "f64" }, { index: false; name: "takerClosedPnl"; type: "f64" }]; name: "FillLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "longFunding"; type: "i128" }, { index: false; name: "shortFunding"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "oracleSlot"; type: "u64" }, { index: false; name: "oracleConfidence"; type: "i128" }, { index: false; name: "oracleType"; type: { defined: "OracleType" } }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "feesAccrued"; type: "i128" }, { index: false; name: "feesSettled"; type: "i128" }, { index: false; name: "openInterest"; type: "i64" }, { index: false; name: "instantaneousFundingRate"; type: "i128" }]; name: "PerpUpdateFundingLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "depositIndex"; type: "i128" }, { index: false; name: "borrowIndex"; type: "i128" }, { index: false; name: "avgUtilization"; type: "i128" }, { index: false; name: "price"; type: "i128" }, { index: false; name: "stablePrice"; type: "i128" }, { index: false; name: "collectedFees"; type: "i128" }, { index: false; name: "loanFeeRate"; type: "i128" }, { index: false; name: "totalBorrows"; type: "i128" }, { index: false; name: "totalDeposits"; type: "i128" }, { index: false; name: "borrowRate"; type: "i128" }, { index: false; name: "depositRate"; type: "i128" }]; name: "UpdateIndexLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }]; name: "UpdateRateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "rate0"; type: "i128" }, { index: false; name: "util0"; type: "i128" }, { index: false; name: "rate1"; type: "i128" }, { index: false; name: "util1"; type: "i128" }, { index: false; name: "maxRate"; type: "i128" }, { index: false; name: "curveScaling"; type: "f64" }, { index: false; name: "targetUtilization"; type: "f32" }]; name: "UpdateRateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "bankruptcy"; type: "bool" }]; name: "TokenLiqWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "baseTotal"; type: "u64" }, { index: false; name: "baseFree"; type: "u64" }, { index: false; name: "quoteTotal"; type: "u64" }, { index: false; name: "quoteFree"; type: "u64" }, { index: false; name: "referrerRebatesAccrued"; type: "u64" }]; name: "Serum3OpenOrdersBalanceLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }]; name: "WithdrawLoanOriginationFeeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "loanAmount"; type: "i128" }, { index: false; name: "loanOriginationFee"; type: "i128" }, { index: false; name: "instruction"; type: { defined: "LoanOriginationFeeInstruction" } }, { index: false; name: "price"; type: { option: "i128" } }]; name: "WithdrawLoanLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "initialLiabNative"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "insuranceTokenIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLiabDepositIndex"; type: "i128" }, { index: false; name: "endingLiabDepositIndex"; type: "i128" }]; name: "TokenLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "cumulativeDepositInterest"; type: "f64" }, { index: false; name: "cumulativeBorrowInterest"; type: "f64" }]; name: "DeactivateTokenPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "cumulativeLongFunding"; type: "f64" }, { index: false; name: "cumulativeShortFunding"; type: "f64" }, { index: false; name: "makerVolume"; type: "u64" }, { index: false; name: "takerVolume"; type: "u64" }, { index: false; name: "perpSpotTransfers"; type: "i64" }]; name: "DeactivatePerpPositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mint"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "mintDecimals"; type: "u8" }, { index: false; name: "oracle"; type: "publicKey" }, { index: false; name: "fallbackOracle"; type: "publicKey" }, { index: false; name: "mintInfo"; type: "publicKey" }]; name: "TokenMetaDataLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarket"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "baseDecimals"; type: "u8" }, { index: false; name: "baseLotSize"; type: "i64" }, { index: false; name: "quoteLotSize"; type: "i64" }, { index: false; name: "oracle"; type: "publicKey" }]; name: "PerpMarketMetaDataLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "serumMarket"; type: "publicKey" }, { index: false; name: "marketIndex"; type: "u16" }, { index: false; name: "baseTokenIndex"; type: "u16" }, { index: false; name: "quoteTokenIndex"; type: "u16" }, { index: false; name: "serumProgram"; type: "publicKey" }, { index: false; name: "serumProgramExternal"; type: "publicKey" }]; name: "Serum3RegisterMarketLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "baseTransferLiqee"; type: "i64" }, { index: false; name: "quoteTransferLiqee"; type: "i128" }, { index: false; name: "quoteTransferLiqor"; type: "i128" }, { index: false; name: "quotePlatformFee"; type: "i128" }, { index: false; name: "pnlTransfer"; type: "i128" }, { index: false; name: "pnlSettleLimitTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpLiqBaseOrPositivePnlLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "insuranceTransfer"; type: "i128" }, { index: false; name: "socializedLoss"; type: "i128" }, { index: false; name: "startingLongFunding"; type: "i128" }, { index: false; name: "startingShortFunding"; type: "i128" }, { index: false; name: "endingLongFunding"; type: "i128" }, { index: false; name: "endingShortFunding"; type: "i128" }]; name: "PerpLiqBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpLiqNegativePnlOrBankruptcyLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccountA"; type: "publicKey" }, { index: false; name: "mangoAccountB"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }, { index: false; name: "settler"; type: "publicKey" }, { index: false; name: "fee"; type: "i128" }]; name: "PerpSettlePnlLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "settlement"; type: "i128" }]; name: "PerpSettleFeesLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "buybackFees"; type: "i128" }, { index: false; name: "buybackMngo"; type: "i128" }, { index: false; name: "mngoBuybackPrice"; type: "i128" }, { index: false; name: "oraclePrice"; type: "i128" }]; name: "AccountBuybackFeesWithMngoLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "seqNum"; type: "u64" }]; name: "FilledPerpOrderLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "takerSide"; type: "u8" }, { index: false; name: "totalBaseLotsTaken"; type: "i64" }, { index: false; name: "totalBaseLotsDecremented"; type: "i64" }, { index: false; name: "totalQuoteLotsTaken"; type: "i64" }, { index: false; name: "totalQuoteLotsDecremented"; type: "i64" }, { index: false; name: "takerFeesPaid"; type: "i128" }, { index: false; name: "feePenalty"; type: "i128" }]; name: "PerpTakerTradeLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "perpMarketIndex"; type: "u16" }, { index: false; name: "accountA"; type: "publicKey" }, { index: false; name: "accountB"; type: "publicKey" }, { index: false; name: "baseTransfer"; type: "i64" }, { index: false; name: "quoteTransfer"; type: "i128" }, { index: false; name: "price"; type: "i128" }]; name: "PerpForceClosePositionLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransfer"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "assetTokenIndex"; type: "u16" }, { index: false; name: "liabTokenIndex"; type: "u16" }, { index: false; name: "assetTransferFromLiqee"; type: "i128" }, { index: false; name: "assetTransferToLiqor"; type: "i128" }, { index: false; name: "assetLiquidationFee"; type: "i128" }, { index: false; name: "liabTransfer"; type: "i128" }, { index: false; name: "assetPrice"; type: "i128" }, { index: false; name: "liabPrice"; type: "i128" }, { index: false; name: "feeFactor"; type: "i128" }]; name: "TokenForceCloseBorrowsWithTokenLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }]; name: "TokenConditionalSwapCreateLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapCreateLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }, { index: false; name: "maxBuy"; type: "u64" }, { index: false; name: "maxSell"; type: "u64" }, { index: false; name: "expiryTimestamp"; type: "u64" }, { index: false; name: "priceLowerLimit"; type: "f64" }, { index: false; name: "priceUpperLimit"; type: "f64" }, { index: false; name: "pricePremiumRate"; type: "f64" }, { index: false; name: "takerFeeRate"; type: "f32" }, { index: false; name: "makerFeeRate"; type: "f32" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "allowCreatingDeposits"; type: "bool" }, { index: false; name: "allowCreatingBorrows"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }, { index: false; name: "durationSeconds"; type: "u64" }]; name: "TokenConditionalSwapCreateLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }]; name: "TokenConditionalSwapTriggerLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }]; name: "TokenConditionalSwapTriggerLogV2" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "liqee"; type: "publicKey" }, { index: false; name: "liqor"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "buyTokenIndex"; type: "u16" }, { index: false; name: "sellTokenIndex"; type: "u16" }, { index: false; name: "buyAmount"; type: "u64" }, { index: false; name: "sellAmount"; type: "u64" }, { index: false; name: "makerFee"; type: "u64" }, { index: false; name: "takerFee"; type: "u64" }, { index: false; name: "buyTokenPrice"; type: "i128" }, { index: false; name: "sellTokenPrice"; type: "i128" }, { index: false; name: "closed"; type: "bool" }, { index: false; name: "displayPriceStyle"; type: "u8" }, { index: false; name: "intention"; type: "u8" }, { index: false; name: "tcsType"; type: "u8" }, { index: false; name: "startTimestamp"; type: "u64" }]; name: "TokenConditionalSwapTriggerLogV3" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "id"; type: "u64" }]; name: "TokenConditionalSwapCancelLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "caller"; type: "publicKey" }, { index: false; name: "tokenConditionalSwapId"; type: "u64" }, { index: false; name: "incentiveTokenIndex"; type: "u16" }, { index: false; name: "incentiveAmount"; type: "u64" }]; name: "TokenConditionalSwapStartLog" }, { fields: [{ index: false; name: "mangoGroup"; type: "publicKey" }, { index: false; name: "mangoAccount"; type: "publicKey" }, { index: false; name: "tokenIndex"; type: "u16" }, { index: false; name: "assetUsageFraction"; type: "i128" }, { index: false; name: "fee"; type: "i128" }]; name: "TokenCollateralFeeLog" }]
                      • instructions: [{ accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminTokenWithdrawFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: true; name: "admin" }]; args: []; name: "adminPerpWithdrawFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Group" }, { kind: "account"; path: "creator"; type: "publicKey" }, { kind: "arg"; path: "group_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "creator" }, { isMut: false; isSigner: false; name: "insuranceMint" }, { isMut: true; isSigner: false; name: "insuranceVault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "InsuranceVault" }, { kind: "account"; path: "group"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "groupNum"; type: "u32" }, { name: "testing"; type: "u8" }, { name: "version"; type: "u8" }]; name: "groupCreate" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "adminOpt"; type: { option: "publicKey" } }, { name: "fastListingAdminOpt"; type: { option: "publicKey" } }, { name: "securityAdminOpt"; type: { option: "publicKey" } }, { name: "testingOpt"; type: { option: "u8" } }, { name: "versionOpt"; type: { option: "u8" } }, { name: "depositLimitQuoteOpt"; type: { option: "u64" } }, { name: "buybackFeesOpt"; type: { option: "bool" } }, { name: "buybackFeesBonusFactorOpt"; type: { option: "f32" } }, { name: "buybackFeesSwapMangoAccountOpt"; type: { option: "publicKey" } }, { name: "mngoTokenIndexOpt"; type: { option: "u16" } }, { name: "buybackFeesExpiryIntervalOpt"; type: { option: "u64" } }, { name: "allowedFastListingsPerIntervalOpt"; type: { option: "u16" } }, { name: "collateralFeeIntervalOpt"; type: { option: "u64" } }]; name: "groupEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault", "admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "destination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "groupWithdrawInsuranceFund" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "ixGate"; type: "u128" }]; name: "ixGateSet" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin", "insurance_vault"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "groupClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "interestRateParams"; type: { defined: "InterestRateParams" } }, { name: "loanFeeRate"; type: "f32" }, { name: "loanOriginationFeeRate"; type: "f32" }, { name: "maintAssetWeight"; type: "f32" }, { name: "initAssetWeight"; type: "f32" }, { name: "maintLiabWeight"; type: "f32" }, { name: "initLiabWeight"; type: "f32" }, { name: "liquidationFee"; type: "f32" }, { name: "stablePriceDelayIntervalSeconds"; type: "u32" }, { name: "stablePriceDelayGrowthLimit"; type: "f32" }, { name: "stablePriceGrowthLimit"; type: "f32" }, { name: "minVaultToDepositsRatio"; type: "f64" }, { name: "netBorrowLimitWindowSizeTs"; type: "u64" }, { name: "netBorrowLimitPerWindowQuote"; type: "i64" }, { name: "borrowWeightScaleStartQuote"; type: "f64" }, { name: "depositWeightScaleStartQuote"; type: "f64" }, { name: "reduceOnly"; type: "u8" }, { name: "tokenConditionalSwapTakerFeeRate"; type: "f32" }, { name: "tokenConditionalSwapMakerFeeRate"; type: "f32" }, { name: "flashLoanSwapFeeRate"; type: "f32" }, { name: "interestCurveScaling"; type: "f32" }, { name: "interestTargetUtilization"; type: "f32" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "depositLimit"; type: "u64" }, { name: "zeroUtilRate"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }, { name: "disableAssetLiquidation"; type: "bool" }, { name: "collateralFeePerDay"; type: "f32" }]; name: "tokenRegister" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "const"; type: "u32"; value: 0 }] } }, { isMut: true; isSigner: false; name: "mintInfo"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MintInfo" }, { kind: "account"; path: "group"; type: "publicKey" }, { account: "Mint"; kind: "account"; path: "mint"; type: "publicKey" }] } }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "fallbackOracle" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "name"; type: "string" }]; name: "tokenRegisterTrustless" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }, { docs: ["The fallback oracle account is optional and only used when set_fallback_oracle is true.", ""]; isMut: false; isSigner: false; name: "fallbackOracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "interestRateParamsOpt"; type: { option: { defined: "InterestRateParams" } } }, { name: "loanFeeRateOpt"; type: { option: "f32" } }, { name: "loanOriginationFeeRateOpt"; type: { option: "f32" } }, { name: "maintAssetWeightOpt"; type: { option: "f32" } }, { name: "initAssetWeightOpt"; type: { option: "f32" } }, { name: "maintLiabWeightOpt"; type: { option: "f32" } }, { name: "initLiabWeightOpt"; type: { option: "f32" } }, { name: "liquidationFeeOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "minVaultToDepositsRatioOpt"; type: { option: "f64" } }, { name: "netBorrowLimitPerWindowQuoteOpt"; type: { option: "i64" } }, { name: "netBorrowLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "borrowWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "depositWeightScaleStartQuoteOpt"; type: { option: "f64" } }, { name: "resetStablePrice"; type: "bool" }, { name: "resetNetBorrowLimit"; type: "bool" }, { name: "reduceOnlyOpt"; type: { option: "u8" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "tokenConditionalSwapTakerFeeRateOpt"; type: { option: "f32" } }, { name: "tokenConditionalSwapMakerFeeRateOpt"; type: { option: "f32" } }, { name: "flashLoanSwapFeeRateOpt"; type: { option: "f32" } }, { name: "interestCurveScalingOpt"; type: { option: "f32" } }, { name: "interestTargetUtilizationOpt"; type: { option: "f32" } }, { name: "maintWeightShiftStartOpt"; type: { option: "u64" } }, { name: "maintWeightShiftEndOpt"; type: { option: "u64" } }, { name: "maintWeightShiftAssetTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftLiabTargetOpt"; type: { option: "f32" } }, { name: "maintWeightShiftAbort"; type: "bool" }, { name: "setFallbackOracle"; type: "bool" }, { name: "depositLimitOpt"; type: { option: "u64" } }, { name: "zeroUtilRateOpt"; type: { option: "f32" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }, { name: "disableAssetLiquidationOpt"; type: { option: "bool" } }, { name: "collateralFeePerDayOpt"; type: { option: "f32" } }]; name: "tokenEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: false; isSigner: false; name: "existingBank"; relations: ["group", "mint"] }, { isMut: true; isSigner: false; name: "bank"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Bank" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "vault"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Vault" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "token_index"; type: "u16" }, { kind: "arg"; path: "bank_num"; type: "u32" }] } }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group", "mint"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "tokenIndex"; type: "u16" }, { name: "bankNum"; type: "u32" }]; name: "tokenAddBank" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "mintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "dustVault" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "tokenDeregister" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "mintInfo"; relations: ["oracle", "group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: false; isSigner: false; name: "instructions" }]; args: []; name: "tokenUpdateIndexAndRate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; pda: { seeds: [{ kind: "const"; type: "string"; value: "MangoAccount" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "owner"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "accountNum"; type: "u32" }, { name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }, { name: "name"; type: "string" }]; name: "accountCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }]; name: "accountExpand" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "tokenCount"; type: "u8" }, { name: "serum3Count"; type: "u8" }, { name: "perpCount"; type: "u8" }, { name: "perpOoCount"; type: "u8" }, { name: "tokenConditionalSwapCount"; type: "u8" }]; name: "accountExpandV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "accountSizeMigration" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }]; args: [{ name: "nameOpt"; type: { option: "string" } }, { name: "delegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateOpt"; type: { option: "publicKey" } }, { name: "temporaryDelegateExpiryOpt"; type: { option: "u64" } }]; name: "accountEdit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "freeze"; type: "bool" }]; name: "accountToggleFreeze" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group", "owner"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "forceClose"; type: "bool" }]; name: "accountClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "daoAccount"; relations: ["group"] }, { isMut: true; isSigner: false; name: "mngoBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "mngoOracle" }, { isMut: true; isSigner: false; name: "feesBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "feesOracle" }]; args: [{ name: "maxBuybackUsd"; type: "u64" }]; name: "accountBuybackFeesWithMngo" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: true; isSigner: true; name: "oracle" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "mint" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "stubOracleClose" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }]; name: "stubOracleSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "oracle"; relations: ["group"] }]; args: [{ name: "price"; type: { defined: "I80F48" } }, { name: "lastUpdateSlot"; type: "u64" }, { name: "deviation"; type: { defined: "I80F48" } }]; name: "stubOracleSetTest" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDeposit" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: true; name: "tokenAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "reduceOnly"; type: "bool" }]; name: "tokenDepositIntoExisting" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "bank"; relations: ["group", "vault", "oracle"] }, { isMut: true; isSigner: false; name: "vault" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }, { name: "allowBorrow"; type: "bool" }]; name: "tokenWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmounts"; type: { vec: "u64" } }]; name: "flashLoanBegin" }, { accounts: [{ isMut: false; isSigner: false; name: "account" }, { isMut: true; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "inputMint" }, { isMut: false; isSigner: false; name: "outputMint" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "associatedTokenProgram" }, { docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }]; args: [{ name: "loanAmount"; type: "u64" }]; docs: ["A version of flash_loan_begin that's specialized for swaps and needs fewer", "bytes in the transaction"]; name: "flashLoanSwapBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "numLoans"; type: "u8" }, { name: "flashLoanType"; type: { defined: "FlashLoanType" } }]; name: "flashLoanEndV2" }, { accounts: [{ docs: ["Instructions Sysvar for instruction introspection"]; isMut: false; isSigner: false; name: "instructions" }, { isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "healthRegionBegin" }, { accounts: [{ isMut: true; isSigner: false; name: "account" }]; args: []; name: "healthRegionEnd" }, { accounts: [{ isMut: true; isSigner: false; name: "group" }, { docs: ["group admin or fast listing admin, checked at #1"]; isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "serumMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "serum_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oraclePriceBand"; type: "f32" }]; docs: ["", "Serum", ""]; name: "serum3RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "oraclePriceBandOpt"; type: { option: "f32" } }]; name: "serum3EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "serumMarket"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "serum3DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { seeds: [{ kind: "const"; type: "string"; value: "Serum3OO" }, { kind: "account"; path: "account"; type: "publicKey" }, { kind: "account"; path: "serum_market"; type: "publicKey" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: []; name: "serum3CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: false; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "serum3CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "serum3PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: { defined: "Serum3SelfTradeBehavior" } }, { name: "orderType"; type: { defined: "Serum3OrderType" } }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; docs: ["requires the receiver_bank in the health account list to be writable"]; name: "serum3PlaceOrderV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "side"; type: { defined: "Serum3Side" } }, { name: "orderId"; type: "u128" }]; name: "serum3CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "serum3CancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; docs: ["Deprecated instruction that used to settles all free funds from the OpenOrders account", "into the MangoAccount.", "", "Any serum \"referrer rebates\" (ui fees) are considered Mango fees."]; name: "serum3SettleFunds" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; name: "v1" }, { accounts: [{ isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }]; name: "v2" }]; args: [{ name: "feesToDao"; type: "bool" }]; docs: ["Like Serum3SettleFunds, but `fees_to_dao` determines if referrer rebates are considered fees", "or are credited to the MangoAccount."]; name: "serum3SettleFundsV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "serumMarket"; relations: ["group", "serum_program", "serum_market_external"] }, { isMut: false; isSigner: false; name: "serumProgram" }, { isMut: true; isSigner: false; name: "serumMarketExternal" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "marketEventQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "serum3LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "liqTokenBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }]; args: [{ name: "assetTokenIndex"; type: "u16" }, { name: "liabTokenIndex"; type: "u16" }, { name: "maxLiabTransfer"; type: "u64" }]; name: "tokenForceCloseBorrowsWithToken" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: false; isSigner: false; name: "liabMintInfo"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: { defined: "I80F48" } }]; name: "tokenLiqBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "perpMarket"; pda: { seeds: [{ kind: "const"; type: "string"; value: "PerpMarket" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "perp_market_index"; type: "u16" }] } }, { docs: ["Accounts are initialised by client,", "anchor discriminator is set first when ix exits,"]; isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "perpMarketIndex"; type: "u16" }, { name: "name"; type: "string" }, { name: "oracleConfig"; type: { defined: "OracleConfigParams" } }, { name: "baseDecimals"; type: "u8" }, { name: "quoteLotSize"; type: "i64" }, { name: "baseLotSize"; type: "i64" }, { name: "maintBaseAssetWeight"; type: "f32" }, { name: "initBaseAssetWeight"; type: "f32" }, { name: "maintBaseLiabWeight"; type: "f32" }, { name: "initBaseLiabWeight"; type: "f32" }, { name: "maintOverallAssetWeight"; type: "f32" }, { name: "initOverallAssetWeight"; type: "f32" }, { name: "baseLiquidationFee"; type: "f32" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "minFunding"; type: "f32" }, { name: "maxFunding"; type: "f32" }, { name: "impactQuantity"; type: "i64" }, { name: "groupInsuranceFund"; type: "bool" }, { name: "feePenalty"; type: "f32" }, { name: "settleFeeFlat"; type: "f32" }, { name: "settleFeeAmountThreshold"; type: "f32" }, { name: "settleFeeFractionLowHealth"; type: "f32" }, { name: "settleTokenIndex"; type: "u16" }, { name: "settlePnlLimitFactor"; type: "f32" }, { name: "settlePnlLimitWindowSizeTs"; type: "u64" }, { name: "positivePnlLiquidationFee"; type: "f32" }, { name: "platformLiquidationFee"; type: "f32" }]; docs: ["", "Perps", ""]; name: "perpCreateMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group"] }, { docs: ["The oracle account is optional and only used when reset_stable_price is set.", ""]; isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "oracleOpt"; type: { option: "publicKey" } }, { name: "oracleConfigOpt"; type: { option: { defined: "OracleConfigParams" } } }, { name: "baseDecimalsOpt"; type: { option: "u8" } }, { name: "maintBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "initBaseAssetWeightOpt"; type: { option: "f32" } }, { name: "maintBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "initBaseLiabWeightOpt"; type: { option: "f32" } }, { name: "maintOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "initOverallAssetWeightOpt"; type: { option: "f32" } }, { name: "baseLiquidationFeeOpt"; type: { option: "f32" } }, { name: "makerFeeOpt"; type: { option: "f32" } }, { name: "takerFeeOpt"; type: { option: "f32" } }, { name: "minFundingOpt"; type: { option: "f32" } }, { name: "maxFundingOpt"; type: { option: "f32" } }, { name: "impactQuantityOpt"; type: { option: "i64" } }, { name: "groupInsuranceFundOpt"; type: { option: "bool" } }, { name: "feePenaltyOpt"; type: { option: "f32" } }, { name: "settleFeeFlatOpt"; type: { option: "f32" } }, { name: "settleFeeAmountThresholdOpt"; type: { option: "f32" } }, { name: "settleFeeFractionLowHealthOpt"; type: { option: "f32" } }, { name: "stablePriceDelayIntervalSecondsOpt"; type: { option: "u32" } }, { name: "stablePriceDelayGrowthLimitOpt"; type: { option: "f32" } }, { name: "stablePriceGrowthLimitOpt"; type: { option: "f32" } }, { name: "settlePnlLimitFactorOpt"; type: { option: "f32" } }, { name: "settlePnlLimitWindowSizeTsOpt"; type: { option: "u64" } }, { name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "resetStablePrice"; type: "bool" }, { name: "positivePnlLiquidationFeeOpt"; type: { option: "f32" } }, { name: "nameOpt"; type: { option: "string" } }, { name: "forceCloseOpt"; type: { option: "bool" } }, { name: "platformLiquidationFeeOpt"; type: { option: "f32" } }]; name: "perpEditMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "perpCloseMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group"] }]; args: []; name: "perpDeactivatePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrder"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceLots"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }]; name: "perpPlaceOrderV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPegged"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "event_queue", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventQueue" }, { isMut: false; isSigner: false; name: "oracle" }]; args: [{ name: "side"; type: { defined: "Side" } }, { name: "priceOffsetLots"; type: "i64" }, { name: "pegLimit"; type: "i64" }, { name: "maxBaseLots"; type: "i64" }, { name: "maxQuoteLots"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "PlaceOrderType" } }, { name: "selfTradeBehavior"; type: { defined: "SelfTradeBehavior" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: "u64" }, { name: "limit"; type: "u8" }, { name: "maxOracleStalenessSlots"; type: "i32" }]; name: "perpPlaceOrderPeggedV2"; returns: { option: "u128" } }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "orderId"; type: "u128" }]; name: "perpCancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "clientOrderId"; type: "u64" }]; name: "perpCancelOrderByClientOrderId" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpCancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "owner" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "sideOption"; type: { option: { defined: "Side" } } }, { name: "limit"; type: "u8" }]; name: "perpCancelAllOrdersBySide" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "event_queue"] }, { isMut: true; isSigner: false; name: "eventQueue" }]; args: [{ name: "limit"; type: "u64" }]; name: "perpConsumeEvents" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks", "oracle"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpUpdateFunding" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "settler"; relations: ["group"] }, { isMut: false; isSigner: true; name: "settlerOwner" }, { isMut: false; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: []; name: "perpSettlePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "accountA"; relations: ["group"] }, { isMut: true; isSigner: false; name: "accountB"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }]; args: []; name: "perpForceClosePosition" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxSettleAmount"; type: "u64" }]; name: "perpSettleFees" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }]; args: [{ name: "maxBaseTransfer"; type: "i64" }, { name: "maxPnlTransfer"; type: "u64" }]; name: "perpLiqBaseOrPositivePnl" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "perpLiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcy" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["insurance_vault"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorOwner" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "perpMarket"; relations: ["group", "oracle"] }, { isMut: false; isSigner: false; name: "oracle" }, { isMut: true; isSigner: false; name: "settleBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "settleVault" }, { isMut: false; isSigner: false; name: "settleOracle" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "insuranceBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "insuranceBankVault" }, { isMut: false; isSigner: false; name: "insuranceOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "maxLiabTransfer"; type: "u64" }]; name: "perpLiqNegativePnlOrBankruptcyV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }]; name: "tokenConditionalSwapCreate" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "pricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }]; name: "tokenConditionalSwapCreateV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceLowerLimit"; type: "f64" }, { name: "priceUpperLimit"; type: "f64" }, { name: "maxPricePremiumRate"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "intention"; type: { defined: "TokenConditionalSwapIntention" } }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreatePremiumAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { name: "expiryTimestamp"; type: "u64" }, { name: "priceStart"; type: "f64" }, { name: "priceEnd"; type: "f64" }, { name: "allowCreatingDeposits"; type: "bool" }, { name: "allowCreatingBorrows"; type: "bool" }, { name: "displayPriceStyle"; type: { defined: "TokenConditionalSwapDisplayPriceStyle" } }, { name: "startTimestamp"; type: "u64" }, { name: "durationSeconds"; type: "u64" }]; name: "tokenConditionalSwapCreateLinearAuction" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { docs: ["The bank's token_index is checked at #1"]; isMut: true; isSigner: false; name: "buyBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "sellBank"; relations: ["group"] }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapCancel" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }]; name: "tokenConditionalSwapTrigger" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }, { name: "maxBuyTokenToLiqee"; type: "u64" }, { name: "maxSellTokenToLiqor"; type: "u64" }, { name: "minBuyToken"; type: "u64" }, { name: "minTakerPrice"; type: "f32" }]; name: "tokenConditionalSwapTriggerV2" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "liqee"; relations: ["group"] }, { isMut: true; isSigner: false; name: "liqor"; relations: ["group"] }, { isMut: false; isSigner: true; name: "liqorAuthority" }]; args: [{ name: "tokenConditionalSwapIndex"; type: "u8" }, { name: "tokenConditionalSwapId"; type: "u64" }]; name: "tokenConditionalSwapStart" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }]; args: []; name: "tokenChargeCollateralFees" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }]; name: "altSet" }, { accounts: [{ isMut: false; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: true; name: "payer" }, { isMut: true; isSigner: false; name: "addressLookupTable" }]; args: [{ name: "index"; type: "u8" }, { name: "newAddresses"; type: { vec: "publicKey" } }]; name: "altExtend" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: false; name: "account"; relations: ["group"] }]; args: []; docs: ["Warning, this instruction is for testing purposes only!"]; name: "computeAccountData" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openbookV2Market"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Market" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }] } }, { isMut: true; isSigner: false; name: "indexReservation"; pda: { seeds: [{ kind: "const"; type: "string"; value: "OpenbookV2Index" }, { kind: "account"; path: "group"; type: "publicKey" }, { kind: "arg"; path: "market_index"; type: "u16" }] } }, { isMut: false; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: false; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "marketIndex"; type: "u16" }, { name: "name"; type: "string" }]; docs: ["", "OpenbookV2", ""]; name: "openbookV2RegisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "market"; relations: ["group"] }]; args: [{ name: "reduceOnlyOpt"; type: { option: "bool" } }, { name: "forceCloseOpt"; type: { option: "bool" } }]; name: "openbookV2EditMarket" }, { accounts: [{ isMut: true; isSigner: false; name: "group"; relations: ["admin"] }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "openbookV2Market"; relations: ["group"] }, { isMut: true; isSigner: false; name: "indexReservation"; relations: ["group"] }, { isMut: true; isSigner: false; name: "solDestination" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "openbookV2DeregisterMarket" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders"; pda: { programId: { kind: "account"; path: "openbook_v2_program"; type: "publicKey" }; seeds: [{ kind: "const"; type: "string"; value: "OpenOrders" }, { kind: "account"; path: "openbook_v2_market"; type: "publicKey" }, { kind: "account"; path: "openbook_v2_market_external"; type: "publicKey" }, { kind: "arg"; path: "account_num"; type: "u32" }] } }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "accountNum"; type: "u32" }]; name: "openbookV2CreateOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "solDestination" }]; args: []; name: "openbookV2CloseOpenOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market" }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "orderType"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketRequestQueue" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { docs: ["The bank that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerBank"; relations: ["group"] }, { docs: ["The bank vault that pays for the order, if necessary"]; isMut: true; isSigner: false; name: "payerVault" }, { isMut: false; isSigner: false; name: "payerOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "side"; type: "u8" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQty"; type: "u64" }, { name: "maxNativeQuoteQtyIncludingFees"; type: "u64" }, { name: "selfTradeBehavior"; type: "u8" }, { name: "clientOrderId"; type: "u64" }, { name: "limit"; type: "u16" }]; name: "openbookV2PlaceTakerOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "side"; type: "u8" }, { name: "orderId"; type: "u128" }]; name: "openbookV2CancelOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: true; isSigner: false; name: "openbookV2MarketExternal" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { docs: ["needed for the automatic settle_funds call"]; isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "quoteOracle" }, { isMut: false; isSigner: false; name: "baseOracle" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "feesToDao"; type: "bool" }]; name: "openbookV2SettleFunds" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks", "event_heap"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }, { isMut: true; isSigner: false; name: "eventHeap" }, { isMut: true; isSigner: false; name: "marketBaseVault" }, { isMut: true; isSigner: false; name: "marketQuoteVault" }, { isMut: false; isSigner: false; name: "marketVaultSigner" }, { isMut: true; isSigner: false; name: "quoteBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "quoteVault" }, { isMut: true; isSigner: false; name: "baseBank"; relations: ["group"] }, { isMut: true; isSigner: false; name: "baseVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2LiqForceCancelOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "group" }, { isMut: true; isSigner: false; name: "account"; relations: ["group"] }, { isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: false; isSigner: false; name: "openbookV2Market"; relations: ["group", "openbook_v2_program", "openbook_v2_market_external"] }, { isMut: false; isSigner: false; name: "openbookV2Program" }, { isMut: false; isSigner: false; name: "openbookV2MarketExternal"; relations: ["bids", "asks"] }, { isMut: true; isSigner: false; name: "bids" }, { isMut: true; isSigner: false; name: "asks" }]; args: [{ name: "limit"; type: "u8" }]; name: "openbookV2CancelAllOrders" }, { accounts: [{ isMut: false; isSigner: false; name: "dummy" }]; args: []; docs: ["", "benchmark", ""]; name: "benchmark" }]
                      • name: "mango_v4"
                      • types: [{ name: "InterestRateParams"; type: { fields: [{ name: "util0"; type: "f32" }, { name: "rate0"; type: "f32" }, { name: "util1"; type: "f32" }, { name: "rate1"; type: "f32" }, { name: "maxRate"; type: "f32" }, { name: "adjustmentFactor"; type: "f32" }]; kind: "struct" } }, { name: "Equity"; type: { fields: [{ name: "tokens"; type: { vec: { defined: "TokenEquity" } } }, { name: "perps"; type: { vec: { defined: "PerpEquity" } } }]; kind: "struct" } }, { name: "TokenEquity"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "PerpEquity"; type: { fields: [{ name: "perpMarketIndex"; type: "u16" }, { name: "value"; type: { defined: "I80F48" } }]; kind: "struct" } }, { name: "FlashLoanTokenDetail"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { name: "changeAmount"; type: "i128" }, { name: "loan"; type: "i128" }, { name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV2"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Deposit fee paid for positive change_amount.", "", "Not factored into change_amount."]; name: "depositFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "FlashLoanTokenDetailV3"; type: { fields: [{ name: "tokenIndex"; type: "u16" }, { docs: ["The amount by which the user's token position changed at the end", "", "So if the user repaid the approved_amount in full, it'd be 0.", "", "Does NOT include the loan_origination_fee or deposit_fee, so the true", "change is `change_amount - loan_origination_fee - deposit_fee`."]; name: "changeAmount"; type: "i128" }, { docs: ["The amount that was a loan (<= approved_amount, depends on user's deposits)"]; name: "loan"; type: "i128" }, { docs: ["The fee paid on the loan, not included in `loan` or `change_amount`"]; name: "loanOriginationFee"; type: "i128" }, { name: "depositIndex"; type: "i128" }, { name: "borrowIndex"; type: "i128" }, { name: "price"; type: "i128" }, { docs: ["Swap fee paid on the in token of a swap.", "", "Not factored into change_amount."]; name: "swapFee"; type: "i128" }, { docs: ["The amount that was transfered out to the user"]; name: "approvedAmount"; type: "u64" }]; kind: "struct" } }, { name: "TokenPosition"; type: { fields: [{ docs: ["The deposit_index (if positive) or borrow_index (if negative) scaled position"]; name: "indexedPosition"; type: { defined: "I80F48" } }, { docs: ["index into Group.tokens"]; name: "tokenIndex"; type: "u16" }, { docs: ["incremented when a market requires this position to stay alive"]; name: "inUseCount"; type: "u16" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "previousIndex"; type: { defined: "I80F48" } }, { name: "cumulativeDepositInterest"; type: "f64" }, { name: "cumulativeBorrowInterest"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { name: "Serum3Orders"; type: { fields: [{ name: "openOrders"; type: "publicKey" }, { docs: ["Tracks the amount of borrows that have flowed into the serum open orders account.", "These borrows did not have the loan origination fee applied, and that may happen", "later (in serum3_settle_funds) if we can guarantee that the funds were used.", "In particular a place-on-book, cancel, settle should not cost fees."]; name: "baseBorrowsWithoutFee"; type: "u64" }, { name: "quoteBorrowsWithoutFee"; type: "u64" }, { name: "marketIndex"; type: "u16" }, { docs: ["Store the base/quote token index, so health computations don't need", "to get passed the static SerumMarket to find which tokens a market", "uses and look up the correct oracles."]; name: "baseTokenIndex"; type: "u16" }, { name: "quoteTokenIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Track something like the highest open bid / lowest open ask, in native/native units.", "", "Tracking it exactly isn't possible since we don't see fills. So instead track", "the min/max of the _placed_ bids and asks.", "", "The value is reset in serum3_place_order when a new order is placed without an", "existing one on the book.", "", "0 is a special \"unset\" state."]; name: "highestPlacedBidInv"; type: "f64" }, { name: "lowestPlacedAsk"; type: "f64" }, { docs: ["An overestimate of the amount of tokens that might flow out of the open orders account.", "", "The bank still considers these amounts user deposits (see Bank::potential_serum_tokens)", "and that value needs to be updated in conjunction with these numbers.", "", "This estimation is based on the amount of tokens in the open orders account", "(see update_bank_potential_tokens() in serum3_place_order and settle)"]; name: "potentialBaseTokens"; type: "u64" }, { name: "potentialQuoteTokens"; type: "u64" }, { docs: ["Track lowest bid/highest ask, same way as for highest bid/lowest ask.", "", "0 is a special \"unset\" state."]; name: "lowestPlacedBidInv"; type: "f64" }, { name: "highestPlacedAsk"; type: "f64" }, { name: "reserved"; type: { array: ["u8", 16] } }]; kind: "struct" } }, { name: "PerpPosition"; type: { fields: [{ name: "marketIndex"; type: "u16" }, { name: "padding"; type: { array: ["u8", 2] } }, { docs: ["Index of the current settle pnl limit window"]; name: "settlePnlLimitWindow"; type: "u32" }, { docs: ["Amount of realized trade pnl and unrealized pnl that was already settled this window.", "", "Will be negative when negative pnl was settled.", "", "Note that this will be adjusted for bookkeeping reasons when the realized_trade settle", "limitchanges and is not useable for actually tracking how much pnl was settled", "on balance."]; name: "settlePnlLimitSettledInCurrentWindowNative"; type: "i64" }, { docs: ["Active position size, measured in base lots"]; name: "basePositionLots"; type: "i64" }, { docs: ["Active position in oracle quote native. At the same time this is 1:1 a settle_token native amount.", "", "Example: Say there's a perp market on the BTC/USD price using SOL for settlement. The user buys", "one long contract for $20k, then base = 1, quote = -20k. The price goes to $21k. Now their", "unsettled pnl is (1 * 21k - 20k) __SOL__ = 1000 SOL. This is because the perp contract arbitrarily", "decides that each unit of price difference creates 1 SOL worth of settlement.", "(yes, causing 1 SOL of settlement for each $1 price change implies a lot of extra leverage; likely", "there should be an extra configurable scaling factor before we use this for cases like that)"]; name: "quotePositionNative"; type: { defined: "I80F48" } }, { docs: ["Tracks what the position is to calculate average entry & break even price"]; name: "quoteRunningNative"; type: "i64" }, { docs: ["Already settled long funding"]; name: "longSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Already settled short funding"]; name: "shortSettledFunding"; type: { defined: "I80F48" } }, { docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { docs: ["Amount of base lots on the EventQueue waiting to be processed"]; name: "takerBaseLots"; type: "i64" }, { docs: ["Amount of quote lots on the EventQueue waiting to be processed"]; name: "takerQuoteLots"; type: "i64" }, { docs: ["Cumulative long funding in quote native units.", "If the user paid $1 in funding for a long position, this would be 1e6.", "Beware of the sign!", "", "(Display only)"]; name: "cumulativeLongFunding"; type: "f64" }, { docs: ["Cumulative short funding in quote native units", "If the user paid $1 in funding for a short position, this would be -1e6.", "", "(Display only)"]; name: "cumulativeShortFunding"; type: "f64" }, { docs: ["Cumulative maker volume in quote native units", "", "(Display only)"]; name: "makerVolume"; type: "u64" }, { docs: ["Cumulative taker volume in quote native units", "", "(Display only)"]; name: "takerVolume"; type: "u64" }, { docs: ["Cumulative number of quote native units transfered from the perp position", "to the settle token spot position.", "", "For example, if the user settled $1 of positive pnl into their USDC spot", "position, this would be 1e6.", "", "(Display only)"]; name: "perpSpotTransfers"; type: "i64" }, { docs: ["The native average entry price for the base lots of the current position.", "Reset to 0 when the base position reaches or crosses 0."]; name: "avgEntryPricePerBaseLot"; type: "f64" }, { docs: ["Deprecated field: Amount of pnl that was realized by bringing the base position closer to 0."]; name: "deprecatedRealizedTradePnlNative"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled once.", "", "- The value is signed: a negative number means negative pnl can be settled.", "- A settlement in the right direction will decrease this amount.", "", "Typically added for fees, funding and liquidation."]; name: "oneshotSettlePnlAllowance"; type: { defined: "I80F48" } }, { docs: ["Amount of pnl that can be settled in each settle window.", "", "- Unsigned, the settlement can happen in both directions. Value is >= 0.", "- Previously stored a similar value that was signed, so in migration cases", "this value can be negative and should be .abs()ed.", "- If this value exceeds the current stable-upnl, it should be decreased,", "see apply_recurring_settle_pnl_allowance_constraint()", "", "When the base position is reduced, the settle limit contribution from the reduced", "base position is materialized into this value. When the base position increases,", "some of the allowance is taken away.", "", "This also gets increased when a liquidator takes over pnl."]; name: "recurringSettlePnlAllowance"; type: "i64" }, { docs: ["Trade pnl, fees, funding that were added over the current position's lifetime.", "", "Reset when the position changes sign or goes to zero.", "Not decreased by settling.", "", "This is tracked for display purposes: this value plus the difference between entry", "price and current price of the base position is the overall pnl."]; name: "realizedPnlForPositionNative"; type: { defined: "I80F48" } }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { name: "PerpOpenOrder"; type: { fields: [{ name: "sideAndTree"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 1] } }, { name: "market"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 4] } }, { name: "clientId"; type: "u64" }, { name: "id"; type: "u128" }, { name: "quantity"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 56] } }]; kind: "struct" } }, { name: "MangoAccountFixed"; type: { fields: [{ name: "group"; type: "publicKey" }, { name: "owner"; type: "publicKey" }, { name: "name"; type: { array: ["u8", 32] } }, { name: "delegate"; type: "publicKey" }, { name: "accountNum"; type: "u32" }, { name: "beingLiquidated"; type: "u8" }, { name: "inHealthRegion"; type: "u8" }, { name: "bump"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { name: "netDeposits"; type: "i64" }, { name: "perpSpotTransfers"; type: "i64" }, { name: "healthRegionBeginInitHealth"; type: "i64" }, { name: "frozenUntil"; type: "u64" }, { name: "buybackFeesAccruedCurrent"; type: "u64" }, { name: "buybackFeesAccruedPrevious"; type: "u64" }, { name: "buybackFeesExpiryTimestamp"; type: "u64" }, { name: "nextTokenConditionalSwapId"; type: "u64" }, { name: "temporaryDelegate"; type: "publicKey" }, { name: "temporaryDelegateExpiry"; type: "u64" }, { name: "lastCollateralFeeCharge"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 152] } }]; kind: "struct" } }, { name: "OracleConfig"; type: { fields: [{ name: "confFilter"; type: { defined: "I80F48" } }, { name: "maxStalenessSlots"; type: "i64" }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { name: "OracleConfigParams"; type: { fields: [{ name: "confFilter"; type: "f32" }, { name: "maxStalenessSlots"; type: { option: "u32" } }]; kind: "struct" } }, { docs: ["InnerNodes and LeafNodes compose the binary tree of orders.", "", "Each InnerNode has exactly two children, which are either InnerNodes themselves,", "or LeafNodes. The children share the top `prefix_len` bits of `key`. The left", "child has a 0 in the next bit, and the right a 1."]; name: "InnerNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { docs: ["number of highest `key` bits that all children share", "e.g. if it's 2, the two highest bits of `key` will be the same on all children"]; name: "prefixLen"; type: "u32" }, { docs: ["only the top `prefix_len` bits of `key` are relevant"]; name: "key"; type: "u128" }, { docs: ["indexes into `BookSide::nodes`"]; name: "children"; type: { array: ["u32", 2] } }, { docs: ["The earliest expiry timestamp for the left and right subtrees.", "", "Needed to be able to find and remove expired orders without having to", "iterate through the whole bookside."]; name: "childEarliestExpiry"; type: { array: ["u64", 2] } }, { name: "reserved"; type: { array: ["u8", 72] } }]; kind: "struct" } }, { docs: ["LeafNodes represent an order in the binary tree"]; name: "LeafNode"; type: { fields: [{ docs: ["NodeTag"]; name: "tag"; type: "u8" }, { docs: ["Index into the owning MangoAccount's PerpOpenOrders"]; name: "ownerSlot"; type: "u8" }, { docs: ["PostOrderType, this was added for TradingView move order"]; name: "orderType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 1] } }, { docs: ["Time in seconds after `timestamp` at which the order expires.", "A value of 0 means no expiry."]; name: "timeInForce"; type: "u16" }, { name: "padding2"; type: { array: ["u8", 2] } }, { docs: ["The binary tree key, see new_node_key()"]; name: "key"; type: "u128" }, { docs: ["Address of the owning MangoAccount"]; name: "owner"; type: "publicKey" }, { docs: ["Number of base lots to buy or sell, always >=1"]; name: "quantity"; type: "i64" }, { docs: ["The time the order was placed"]; name: "timestamp"; type: "u64" }, { docs: ["If the effective price of an oracle pegged order exceeds this limit,", "it will be considered invalid and may be removed.", "", "Only applicable in the oracle_pegged OrderTree"]; name: "pegLimit"; type: "i64" }, { docs: ["User defined id for this order, used in FillEvents"]; name: "clientOrderId"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 32] } }]; kind: "struct" } }, { name: "AnyNode"; type: { fields: [{ name: "tag"; type: "u8" }, { name: "data"; type: { array: ["u8", 119] } }]; kind: "struct" } }, { name: "OrderTreeRoot"; type: { fields: [{ name: "maybeNode"; type: "u32" }, { name: "leafCount"; type: "u32" }]; kind: "struct" } }, { docs: ["A binary tree on AnyNode::key()", "", "The key encodes the price in the top 64 bits."]; name: "OrderTreeNodes"; type: { fields: [{ name: "orderTreeType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 3] } }, { name: "bumpIndex"; type: "u32" }, { name: "freeListLen"; type: "u32" }, { name: "freeListHead"; type: "u32" }, { name: "reserved"; type: { array: ["u8", 512] } }, { name: "nodes"; type: { array: [{ defined: "AnyNode" }, 1024] } }]; kind: "struct" } }, { name: "EventQueueHeader"; type: { fields: [{ name: "head"; type: "u32" }, { name: "count"; type: "u32" }, { name: "seqNum"; type: "u64" }]; kind: "struct" } }, { name: "AnyEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 207] } }]; kind: "struct" } }, { name: "FillEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "takerSide"; type: "u8" }, { name: "makerOut"; type: "u8" }, { name: "makerSlot"; type: "u8" }, { name: "padding"; type: { array: ["u8", 4] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "maker"; type: "publicKey" }, { name: "padding2"; type: { array: ["u8", 32] } }, { name: "makerTimestamp"; type: "u64" }, { name: "taker"; type: "publicKey" }, { name: "padding3"; type: { array: ["u8", 16] } }, { name: "takerClientOrderId"; type: "u64" }, { name: "makerOrderId"; type: "u128" }, { name: "price"; type: "i64" }, { name: "quantity"; type: "i64" }, { name: "makerClientOrderId"; type: "u64" }, { name: "makerFee"; type: "f32" }, { name: "takerFee"; type: "f32" }, { name: "reserved"; type: { array: ["u8", 8] } }]; kind: "struct" } }, { name: "OutEvent"; type: { fields: [{ name: "eventType"; type: "u8" }, { name: "side"; type: "u8" }, { name: "ownerSlot"; type: "u8" }, { name: "padding0"; type: { array: ["u8", 5] } }, { name: "timestamp"; type: "u64" }, { name: "seqNum"; type: "u64" }, { name: "owner"; type: "publicKey" }, { name: "quantity"; type: "i64" }, { name: "orderId"; type: "u128" }, { name: "padding1"; type: { array: ["u8", 128] } }]; kind: "struct" } }, { docs: ["Maintains a \"stable_price\" based on the oracle price.", "", "The stable price follows the oracle price, but its relative rate of", "change is limited (to `stable_growth_limit`) and futher reduced if", "the oracle price is far from the `delay_price`.", "", "Conceptually the `delay_price` is itself a time delayed", "(`24 * delay_interval_seconds`, assume 24h) and relative rate of change limited", "function of the oracle price. It is implemented as averaging the oracle", "price over every `delay_interval_seconds` (assume 1h) and then applying the", "`delay_growth_limit` between intervals."]; name: "StablePriceModel"; type: { fields: [{ docs: ["Current stable price to use in health"]; name: "stablePrice"; type: "f64" }, { name: "lastUpdateTimestamp"; type: "u64" }, { docs: ["Stored delay_price for each delay_interval.", "If we want the delay_price to be 24h delayed, we would store one for each hour.", "This is used in a cyclical way: We use the maximally-delayed value at delay_interval_index", "and once enough time passes to move to the next delay interval, that gets overwritten and", "we use the next one."]; name: "delayPrices"; type: { array: ["f64", 24] } }, { docs: ["The delay price is based on an average over each delay_interval. The contributions", "to the average are summed up here."]; name: "delayAccumulatorPrice"; type: "f64" }, { docs: ["Accumulating the total time for the above average."]; name: "delayAccumulatorTime"; type: "u32" }, { docs: ["Length of a delay_interval"]; name: "delayIntervalSeconds"; type: "u32" }, { docs: ["Maximal relative difference between two delay_price in consecutive intervals."]; name: "delayGrowthLimit"; type: "f32" }, { docs: ["Maximal per-second relative difference of the stable price.", "It gets further reduced if stable and delay price disagree."]; name: "stableGrowthLimit"; type: "f32" }, { docs: ["The delay_interval_index that update() was last called on."]; name: "lastDelayIntervalIndex"; type: "u8" }, { docs: ["If set to 1, the stable price will reset on the next non-zero price it sees."]; name: "resetOnNonzeroPrice"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { name: "reserved"; type: { array: ["u8", 48] } }]; kind: "struct" } }, { name: "TokenConditionalSwap"; type: { fields: [{ name: "id"; type: "u64" }, { docs: ["maximum amount of native tokens to buy or sell"]; name: "maxBuy"; type: "u64" }, { name: "maxSell"; type: "u64" }, { docs: ["how many native tokens were already bought/sold"]; name: "bought"; type: "u64" }, { name: "sold"; type: "u64" }, { docs: ["timestamp until which the conditional swap is valid"]; name: "expiryTimestamp"; type: "u64" }, { docs: ["The lower or starting price:", "- For FixedPremium or PremiumAuctions, it's the lower end of the price range:", "the tcs can only be triggered if the oracle price exceeds this value.", "- For LinearAuctions it's the starting price that's offered at start_timestamp.", "", "The price is always in \"sell_token per buy_token\" units, which can be computed", "by dividing the buy token price by the sell token price.", "", "For FixedPremium or PremiumAuctions:", "", "The price must exceed this threshold to allow execution.", "", "This threshold is compared to the \"sell_token per buy_token\" oracle price.", "If that price is >= lower_limit and <= upper_limit the tcs may be executable.", "", "Example: Stop loss to get out of a SOL long: The user bought SOL at 20 USDC/SOL", "and wants to stop loss at 18 USDC/SOL. They'd set buy_token=USDC, sell_token=SOL", "so the reference price is in SOL/USDC units. Set price_lower_limit=toNative(1/18)", "and price_upper_limit=toNative(1/10). Also set allow_borrows=false.", "", "Example: Want to buy SOL with USDC if the price falls below 22 USDC/SOL.", "buy_token=SOL, sell_token=USDC, reference price is in USDC/SOL units. Set", "price_upper_limit=toNative(22), price_lower_limit=0."]; name: "priceLowerLimit"; type: "f64" }, { docs: ["Parallel to price_lower_limit, but an upper limit / auction end price."]; name: "priceUpperLimit"; type: "f64" }, { docs: ["The premium to pay over oracle price to incentivize execution."]; name: "pricePremiumRate"; type: "f64" }, { docs: ["The taker receives only premium_price * (1 - taker_fee_rate)"]; name: "takerFeeRate"; type: "f32" }, { docs: ["The maker has to pay premium_price * (1 + maker_fee_rate)"]; name: "makerFeeRate"; type: "f32" }, { docs: ["indexes of tokens for the swap"]; name: "buyTokenIndex"; type: "u16" }, { name: "sellTokenIndex"; type: "u16" }, { docs: ["If this struct is in use. (tcs are stored in a static-length array)"]; name: "isConfigured"; type: "u8" }, { docs: ["may token purchases create deposits? (often users just want to get out of a borrow)"]; name: "allowCreatingDeposits"; type: "u8" }, { docs: ["may token selling create borrows? (often users just want to get out of a long)"]; name: "allowCreatingBorrows"; type: "u8" }, { docs: ["The stored prices are always \"sell token per buy token\", but if the user", "used \"buy token per sell token\" when creating the tcs order, we should continue", "to show them prices in that way.", "", "Stores a TokenConditionalSwapDisplayPriceStyle enum value"]; name: "displayPriceStyle"; type: "u8" }, { docs: ["The intention the user had when placing this order, display-only", "", "Stores a TokenConditionalSwapIntention enum value"]; name: "intention"; type: "u8" }, { docs: ["Stores a TokenConditionalSwapType enum value"]; name: "tcsType"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }, { docs: ["In seconds since epoch. 0 means not-started.", "", "FixedPremium: Time of first trigger call. No other effect.", "PremiumAuction: Time of start or first trigger call. Can continue to trigger once started.", "LinearAuction: Set during creation, auction starts with price_lower_limit at this timestamp."]; name: "startTimestamp"; type: "u64" }, { docs: ["Duration of the auction mechanism", "", "FixedPremium: ignored", "PremiumAuction: time after start that the premium needs to scale to price_premium_rate", "LinearAuction: time after start to go from price_lower_limit to price_upper_limit"]; name: "durationSeconds"; type: "u64" }, { name: "reserved"; type: { array: ["u8", 88] } }]; kind: "struct" } }, { docs: ["Nothing in Rust shall use these types. They only exist so that the Anchor IDL", "knows about them and typescript can deserialize it."]; name: "TokenIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "Serum3MarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "PerpMarketIndex"; type: { fields: [{ name: "val"; type: "u16" }]; kind: "struct" } }, { name: "I80F48"; type: { fields: [{ name: "val"; type: "i128" }]; kind: "struct" } }, { name: "FlashLoanType"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "Swap" }, { name: "SwapWithoutFee" }] } }, { docs: ["Copy paste a bunch of enums so that we could AnchorSerialize & AnchorDeserialize them"]; name: "Serum3SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Serum3OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }] } }, { name: "Serum3Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["There are three types of health:", "- initial health (\"init\"): users can only open new positions if it's >= 0", "- maintenance health (\"maint\"): users get liquidated if it's < 0", "- liquidation end health: once liquidation started (see being_liquidated), it", "only stops once this is >= 0", "", "The ordering is", "init health <= liquidation end health <= maint health", "", "The different health types are realized by using different weights and prices:", "- init health: init weights with scaling, stable-price adjusted prices", "- liq end health: init weights without scaling, oracle prices", "- maint health: maint weights, oracle prices", ""]; name: "HealthType"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "Maint" }, { name: "LiquidationEnd" }] } }, { name: "LoanOriginationFeeInstruction"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "LiqTokenBankruptcy" }, { name: "LiqTokenWithToken" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3SettleFunds" }, { name: "TokenWithdraw" }, { name: "TokenConditionalSwapTrigger" }] } }, { docs: ["Enum for lookup into ix gate", "note:", "total ix files 56,", "ix files included 48,", "ix files not included 8,", "- Benchmark,", "- ComputeAccountData,", "- GroupCreate", "- GroupEdit", "- IxGateSet,", "- PerpZeroOut,", "- PerpEditMarket,", "- TokenEdit,"]; name: "IxGate"; type: { kind: "enum"; variants: [{ name: "AccountClose" }, { name: "AccountCreate" }, { name: "AccountEdit" }, { name: "AccountExpand" }, { name: "AccountToggleFreeze" }, { name: "AltExtend" }, { name: "AltSet" }, { name: "FlashLoan" }, { name: "GroupClose" }, { name: "GroupCreate" }, { name: "HealthRegion" }, { name: "PerpCancelAllOrders" }, { name: "PerpCancelAllOrdersBySide" }, { name: "PerpCancelOrder" }, { name: "PerpCancelOrderByClientOrderId" }, { name: "PerpCloseMarket" }, { name: "PerpConsumeEvents" }, { name: "PerpCreateMarket" }, { name: "PerpDeactivatePosition" }, { name: "PerpLiqBaseOrPositivePnl" }, { name: "PerpLiqForceCancelOrders" }, { name: "PerpLiqNegativePnlOrBankruptcy" }, { name: "PerpPlaceOrder" }, { name: "PerpSettleFees" }, { name: "PerpSettlePnl" }, { name: "PerpUpdateFunding" }, { name: "Serum3CancelAllOrders" }, { name: "Serum3CancelOrder" }, { name: "Serum3CloseOpenOrders" }, { name: "Serum3CreateOpenOrders" }, { name: "Serum3DeregisterMarket" }, { name: "Serum3EditMarket" }, { name: "Serum3LiqForceCancelOrders" }, { name: "Serum3PlaceOrder" }, { name: "Serum3RegisterMarket" }, { name: "Serum3SettleFunds" }, { name: "StubOracleClose" }, { name: "StubOracleCreate" }, { name: "StubOracleSet" }, { name: "TokenAddBank" }, { name: "TokenDeposit" }, { name: "TokenDeregister" }, { name: "TokenLiqBankruptcy" }, { name: "TokenLiqWithToken" }, { name: "TokenRegister" }, { name: "TokenRegisterTrustless" }, { name: "TokenUpdateIndexAndRate" }, { name: "TokenWithdraw" }, { name: "AccountBuybackFeesWithMngo" }, { name: "TokenForceCloseBorrowsWithToken" }, { name: "PerpForceClosePosition" }, { name: "GroupWithdrawInsuranceFund" }, { name: "TokenConditionalSwapCreate" }, { name: "TokenConditionalSwapTrigger" }, { name: "TokenConditionalSwapCancel" }, { name: "OpenbookV2CancelOrder" }, { name: "OpenbookV2CloseOpenOrders" }, { name: "OpenbookV2CreateOpenOrders" }, { name: "OpenbookV2DeregisterMarket" }, { name: "OpenbookV2EditMarket" }, { name: "OpenbookV2LiqForceCancelOrders" }, { name: "OpenbookV2PlaceOrder" }, { name: "OpenbookV2PlaceTakeOrder" }, { name: "OpenbookV2RegisterMarket" }, { name: "OpenbookV2SettleFunds" }, { name: "AdminTokenWithdrawFees" }, { name: "AdminPerpWithdrawFees" }, { name: "AccountSizeMigration" }, { name: "TokenConditionalSwapStart" }, { name: "TokenConditionalSwapCreatePremiumAuction" }, { name: "TokenConditionalSwapCreateLinearAuction" }, { name: "Serum3PlaceOrderV2" }] } }, { name: "CheckLiquidatable"; type: { kind: "enum"; variants: [{ name: "NotLiquidatable" }, { name: "Liquidatable" }, { name: "BecameNotLiquidatable" }] } }, { name: "OracleType"; type: { kind: "enum"; variants: [{ name: "Pyth" }, { name: "Stub" }, { name: "SwitchboardV1" }, { name: "SwitchboardV2" }, { name: "OrcaCLMM" }] } }, { name: "OrderState"; type: { kind: "enum"; variants: [{ name: "Valid" }, { name: "Invalid" }, { name: "Skipped" }] } }, { name: "BookSideOrderTree"; type: { kind: "enum"; variants: [{ name: "Fixed" }, { name: "OraclePegged" }] } }, { name: "NodeTag"; type: { kind: "enum"; variants: [{ name: "Uninitialized" }, { name: "InnerNode" }, { name: "LeafNode" }, { name: "FreeNode" }, { name: "LastFreeNode" }] } }, { name: "PlaceOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "PostOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "PostOnly" }, { name: "PostOnlySlide" }] } }, { docs: ["Self trade behavior controls how taker orders interact with resting limit orders of the same account.", "This setting has no influence on placing a resting or oracle pegged limit order that does not match", "immediately, instead it's the responsibility of the user to correctly configure his taker orders."]; name: "SelfTradeBehavior"; type: { kind: "enum"; variants: [{ name: "DecrementTake" }, { name: "CancelProvide" }, { name: "AbortTransaction" }] } }, { name: "Side"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { docs: ["SideAndOrderTree is a storage optimization, so we don't need two bytes for the data"]; name: "SideAndOrderTree"; type: { kind: "enum"; variants: [{ name: "BidFixed" }, { name: "AskFixed" }, { name: "BidOraclePegged" }, { name: "AskOraclePegged" }] } }, { name: "OrderParams"; type: { kind: "enum"; variants: [{ name: "Market" }, { fields: [{ name: "price_lots"; type: "i64" }]; name: "ImmediateOrCancel" }, { fields: [{ name: "price_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }]; name: "Fixed" }, { fields: [{ name: "price_offset_lots"; type: "i64" }, { name: "order_type"; type: { defined: "PostOrderType" } }, { name: "peg_limit"; type: "i64" }, { name: "max_oracle_staleness_slots"; type: "i32" }]; name: "OraclePegged" }] } }, { name: "OrderTreeType"; type: { kind: "enum"; variants: [{ name: "Bids" }, { name: "Asks" }] } }, { name: "EventType"; type: { kind: "enum"; variants: [{ name: "Fill" }, { name: "Out" }, { name: "Liquidate" }] } }, { name: "TokenConditionalSwapDisplayPriceStyle"; type: { kind: "enum"; variants: [{ name: "SellTokenPerBuyToken" }, { name: "BuyTokenPerSellToken" }] } }, { name: "TokenConditionalSwapIntention"; type: { kind: "enum"; variants: [{ name: "Unknown" }, { name: "StopLoss" }, { name: "TakeProfit" }] } }, { name: "TokenConditionalSwapType"; type: { kind: "enum"; variants: [{ name: "FixedPremium" }, { name: "PremiumAuction" }, { name: "LinearAuction" }] } }]
                      • version: "0.22.0"
                      Modify<T, R>: Omit<T, keyof R> & R

                      Type parameters

                      • T

                      • R

                      OracleConfig: { confFilter: I80F48; maxStalenessSlots: BN }

                      Type declaration

                      • confFilter: I80F48
                      • maxStalenessSlots: BN
                      OracleConfigDto: { confFilter: I80F48Dto; maxStalenessSlots: BN }

                      Type declaration

                      ParsedFillEvent: Modify<FillEvent, { price: number; quantity: number }>
                      PerpMarketIndex: number & As<"perp-market-index">
                      PerpOrderSide: { bid: Record<string, never> } | { ask: Record<string, never> }
                      PerpOrderType: { limit: Record<string, never> } | { immediateOrCancel: Record<string, never> } | { postOnly: Record<string, never> } | { market: Record<string, never> } | { postOnlySlide: Record<string, never> }
                      PerpSelfTradeBehavior: { decrementTake: Record<string, never> } | { cancelProvide: Record<string, never> } | { abortTransaction: Record<string, never> }
                      PlatformFee: { feeAccount: string; feeBps: number }

                      Type declaration

                      • feeAccount: string
                      • feeBps: number
                      PriceImpact: { avg_price_impact_percent: number; max_price_impact_percent: number; min_price_impact_percent: number; p90: number; p95: number; side: "bid" | "ask"; symbol: string; target_amount: number }

                      Type declaration

                      • avg_price_impact_percent: number
                      • max_price_impact_percent: number
                      • min_price_impact_percent: number
                      • p90: number
                      • p95: number
                      • side: "bid" | "ask"
                      • symbol: string
                      • target_amount: number
                      QuoteMintToReferrer: Map<TokenMintAddress, string>
                      Routes: { bestRoute: RouteInfo | null; routes: RouteInfo[] }

                      Type declaration

                      SendTransactionOpts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>
                      Serum3OrderType: { limit: Record<string, never> } | { immediateOrCancel: Record<string, never> } | { postOnly: Record<string, never> }
                      Serum3SelfTradeBehavior: { decrementTake: Record<string, never> } | { cancelProvide: Record<string, never> } | { abortTransaction: Record<string, never> }
                      Serum3Side: { bid: Record<string, never> } | { ask: Record<string, never> }
                      StablePriceModel: { delayAccumulatorPrice: number; delayAccumulatorTime: number; delayGrowthLimit: number; delayIntervalSeconds: number; delayPrices: number[]; lastDelayIntervalIndex: number; lastUpdateTimestamp: BN; stableGrowthLimit: number; stablePrice: number }

                      Type declaration

                      • delayAccumulatorPrice: number
                      • delayAccumulatorTime: number
                      • delayGrowthLimit: number
                      • delayIntervalSeconds: number
                      • delayPrices: number[]
                      • lastDelayIntervalIndex: number
                      • lastUpdateTimestamp: BN
                      • stableGrowthLimit: number
                      • stablePrice: number
                      Token: { address: string; chainId: number; decimals: number; extensions: { coingeckoId?: string }; logoURI: string; name: string; symbol: string; tags: string[] }

                      Type declaration

                      • address: string
                      • chainId: number
                      • decimals: number
                      • extensions: { coingeckoId?: string }
                        • Optional coingeckoId?: string
                      • logoURI: string
                      • name: string
                      • symbol: string
                      • tags: string[]
                      TokenConditionalSwapDisplayPriceStyle: { sellTokenPerBuyToken: Record<string, never> } | { buyTokenPerSellToken: Record<string, never> }
                      TokenConditionalSwapIntention: { unknown: Record<string, never> } | { stopLoss: Record<string, never> } | { takeProfit: Record<string, never> }
                      TokenIndex: number & As<"token-index">
                      TokenMintAddress: string

                      Variables

                      COMPUTE_BUDGET_PROGRAM_ID: PublicKey = ...
                      I64_MAX_BN: BN = ...
                      IDL: MangoV4 = ...
                      JUPITER: { V3: PublicKey; V4: PublicKey; V6: PublicKey } = ...

                      Type declaration

                      • V3: PublicKey
                      • V4: PublicKey
                      • V6: PublicKey
                      MANGO_ROUTER_API_URL: "https://api.mngo.cloud/router/v1" = 'https://api.mngo.cloud/router/v1'
                      MANGO_V4_ID: { devnet: PublicKey; mainnet-beta: PublicKey; testnet: PublicKey } = ...

                      Type declaration

                      • devnet: PublicKey
                      • mainnet-beta: PublicKey
                      • testnet: PublicKey
                      MANGO_V4_MAIN_GROUP: PublicKey = ...
                      MAX_RECENT_PRIORITY_FEE_ACCOUNTS: 128 = 128
                      NullPerpEditParams: PerpEditParams = ...
                      NullTokenEditParams: TokenEditParams = ...
                      OPENBOOK_PROGRAM_ID: { devnet: PublicKey; mainnet-beta: PublicKey } = ...

                      Type declaration

                      • devnet: PublicKey
                      • mainnet-beta: PublicKey
                      QUOTE_DECIMALS: 6 = 6
                      TrueIxGateParams: IxGateParams = ...
                      U64_MAX_BN: BN = ...
                      USDC_MINT: PublicKey = ...

                      Functions

                      • RUST_I64_MAX(): BN
                      • RUST_I64_MIN(): BN
                      • RUST_U64_MAX(): BN
                      • bpsToDecimal(bps: number): number
                      • buildFetch(): Promise<(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>>
                      • buildIxGate(p: IxGateParams): BN
                      • buildVersionedTx(provider: AnchorProvider, ix: TransactionInstruction[], additionalSigners?: Signer[], alts?: AddressLookupTableAccount[]): Promise<VersionedTransaction>
                      • Parameters

                        • provider: AnchorProvider
                        • ix: TransactionInstruction[]
                        • additionalSigners: Signer[] = []
                        • alts: AddressLookupTableAccount[] = []

                        Returns Promise<VersionedTransaction>

                      • computePriceImpactOnJup(pis: PriceImpact[], usdcAmount: number, tokenName: string): number
                      • Returns price impact in bps i.e. 0 to 10,000 returns -1 if data is missing

                        -

                        Parameters

                        Returns number

                      • containsJupiterProgram(logMessages: string[]): boolean
                      • createAssociatedTokenAccountIdempotentInstruction(payer: PublicKey, owner: PublicKey, mint: PublicKey): Promise<TransactionInstruction>
                      • Parameters

                        • payer: PublicKey
                        • owner: PublicKey
                        • mint: PublicKey

                        Returns Promise<TransactionInstruction>

                      • createComputeBudgetIx(microLamports: number): TransactionInstruction
                      • deepClone<T>(obj: T, hash?: WeakMap<object, any>): T
                      • fetchJupiterTransaction(connection: Connection, selectedRoute: RouteInfo, userPublicKey: PublicKey, slippage: number, inputMint: PublicKey, outputMint: PublicKey): Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
                      • Parameters

                        • connection: Connection
                        • selectedRoute: RouteInfo
                        • userPublicKey: PublicKey
                        • slippage: number
                        • inputMint: PublicKey
                        • outputMint: PublicKey

                        Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>

                      • fetchLatestBlockHash(provider: AnchorProvider, opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<LatestBlockhash>
                      • Parameters

                        • provider: AnchorProvider
                        • opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }> = {}

                        Returns Promise<LatestBlockhash>

                      • fetchRoutes(inputMint: any, outputMint: any, amount?: string, slippage?: number, swapMode?: string, feeBps?: string, wallet?: PublicKey): Promise<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>

                      • findLargestAssetBatchUi(pisForLiqor: LiqorPriceImpact[][], coin: string, startFromChange?: number, maxChange?: number, stepSize?: number): [number, number, LiquidationBatches[]]
                      • getAssociatedTokenAddress(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<PublicKey>
                      • containsJupiterProgram(logMessages: string[]): boolean
                      • createAssociatedTokenAccountIdempotentInstruction(payer: PublicKey, owner: PublicKey, mint: PublicKey): Promise<TransactionInstruction>
                      • Parameters

                        • payer: PublicKey
                        • owner: PublicKey
                        • mint: PublicKey

                        Returns Promise<TransactionInstruction>

                      • createComputeBudgetIx(microLamports: number): TransactionInstruction
                      • deepClone<T>(obj: T, hash?: WeakMap<object, any>): T
                      • fetchJupiterTransaction(connection: Connection, selectedRoute: RouteInfo, userPublicKey: PublicKey, slippage: number, inputMint: PublicKey, outputMint: PublicKey): Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
                      • Parameters

                        • connection: Connection
                        • selectedRoute: RouteInfo
                        • userPublicKey: PublicKey
                        • slippage: number
                        • inputMint: PublicKey
                        • outputMint: PublicKey

                        Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>

                      • fetchLatestBlockHash(provider: AnchorProvider, opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<LatestBlockhash>
                      • Parameters

                        • provider: AnchorProvider
                        • opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }> = {}

                        Returns Promise<LatestBlockhash>

                      • fetchRoutes(inputMint: any, outputMint: any, amount?: string, slippage?: number, swapMode?: string, feeBps?: string, wallet?: PublicKey): Promise<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>

                      • findLargestAssetBatchUi(pisForLiqor: LiqorPriceImpact[][], coin: string, startFromChange?: number, maxChange?: number, stepSize?: number): [number, number, LiquidationBatches[]]
                      • getAssociatedTokenAddress(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<PublicKey>
                      • Get the address of the associated token account for a given mint and owner

                        Parameters

                        • mint: PublicKey

                          Token mint account

                          @@ -14,9 +14,9 @@ returns -1 if data is missing

                        • associatedTokenProgramId: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

                          SPL Associated Token program account

                        Returns Promise<PublicKey>

                        Address of the associated token account

                        -
                      • getOnChainPriceForMints(mints: string[]): Promise<number[]>
                      • isOracleStaleOrUnconfident(nowSlot: number, maxStalenessSlots: number, oracleLastUpdatedSlot: undefined | number, deviation: undefined | I80F48, confFilter: I80F48, price: I80F48): boolean
                      • isPythOracle(accountInfo: AccountInfo<Buffer>): boolean
                      • isSwitchboardOracle(accountInfo: AccountInfo<Buffer>): boolean
                      • parseSwitchboardOracle(oracle: PublicKey, accountInfo: AccountInfo<Buffer>, connection: Connection): Promise<{ lastUpdatedSlot: number; price: number; uiDeviation: number }>
                      • Parameters

                        • oracle: PublicKey
                        • accountInfo: AccountInfo<Buffer>
                        • connection: Connection

                        Returns Promise<{ lastUpdatedSlot: number; price: number; uiDeviation: number }>

                        ui price

                        -
                      • parseSwitchboardOracleV1(accountInfo: AccountInfo<Buffer>): { lastUpdatedSlot: number; price: number; uiDeviation: number }
                      • Parameters

                        • accountInfo: AccountInfo<Buffer>

                        Returns { lastUpdatedSlot: number; price: number; uiDeviation: number }

                        • lastUpdatedSlot: number
                        • price: number
                        • uiDeviation: number
                      • parseSwitchboardOracleV2(program: default, accountInfo: AccountInfo<Buffer>, oracle: PublicKey): { lastUpdatedSlot: number; price: number; uiDeviation: number }
                      • Parameters

                        • program: default
                        • accountInfo: AccountInfo<Buffer>
                        • oracle: PublicKey

                        Returns { lastUpdatedSlot: number; price: number; uiDeviation: number }

                        • lastUpdatedSlot: number
                        • price: number
                        • uiDeviation: number
                      • parseTxForKnownErrors(connection: Connection, signature: string): Promise<TransactionErrors>
                      • percentageToDecimal(percentage: number): number
                      • prepareMangoRouterInstructions(selectedRoute: RouteInfo, inputMint: PublicKey, outputMint: PublicKey, userPublicKey: PublicKey): Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
                      • Parameters

                        • selectedRoute: RouteInfo
                        • inputMint: PublicKey
                        • outputMint: PublicKey
                        • userPublicKey: PublicKey

                        Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>

                      • roundTo5(number: any): number
                      • sendTransaction(provider: AnchorProvider, ixs: TransactionInstruction[], alts: AddressLookupTableAccount[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
                      • Parameters

                        • provider: AnchorProvider
                        • ixs: TransactionInstruction[]
                        • alts: AddressLookupTableAccount[]
                        • opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }> = {}

                        Returns Promise<MangoSignatureStatus>

                      • switchboardDecimalToBig(sbDecimal: { mantissa: BN; scale: number }): Big
                      • toNative(uiAmount: number, decimals: number): BN
                      • toNativeI80F48(uiAmount: number, decimals: number): I80F48
                      • toNativeI80F48ForQuote(uiAmount: number): I80F48
                      • toNativeSellPerBuyTokenPrice(price: number, sellBank: Bank, buyBank: Bank): number
                      • toUiDecimals(nativeAmount: number | BN | I80F48, decimals: number): number
                      • toUiDecimalsForQuote(nativeAmount: number | BN | I80F48): number
                      • toUiSellPerBuyTokenPrice(price: number, sellBank: Bank, buyBank: Bank): number
                      • tryStringify(val: any): null | string

                      Legend

                      • Constructor
                      • Property
                      • Method
                      • Property
                      • Method
                      • Private property
                      • Private method
                      • Static property
                      • Static method

                      Settings

                      Theme

                      Generated using TypeDoc

                      \ No newline at end of file +

                      Parameters

                      Returns Promise<{ mangoAccount: PublicKey; perpPosition: PerpPosition }[]>

                    • getOnChainPriceForMints(mints: string[]): Promise<number[]>
                    • isOracleStaleOrUnconfident(nowSlot: number, maxStalenessSlots: number, oracleLastUpdatedSlot: undefined | number, deviation: undefined | I80F48, confFilter: I80F48, price: I80F48): boolean
                    • isPythOracle(accountInfo: AccountInfo<Buffer>): boolean
                    • isSwitchboardOracle(accountInfo: AccountInfo<Buffer>): boolean
                    • parseSwitchboardOracle(oracle: PublicKey, accountInfo: AccountInfo<Buffer>, connection: Connection): Promise<{ lastUpdatedSlot: number; price: number; uiDeviation: number }>
                    • Parameters

                      • oracle: PublicKey
                      • accountInfo: AccountInfo<Buffer>
                      • connection: Connection

                      Returns Promise<{ lastUpdatedSlot: number; price: number; uiDeviation: number }>

                      ui price

                      +
                    • parseSwitchboardOracleV1(accountInfo: AccountInfo<Buffer>): { lastUpdatedSlot: number; price: number; uiDeviation: number }
                    • Parameters

                      • accountInfo: AccountInfo<Buffer>

                      Returns { lastUpdatedSlot: number; price: number; uiDeviation: number }

                      • lastUpdatedSlot: number
                      • price: number
                      • uiDeviation: number
                    • parseSwitchboardOracleV2(program: default, accountInfo: AccountInfo<Buffer>, oracle: PublicKey): { lastUpdatedSlot: number; price: number; uiDeviation: number }
                    • Parameters

                      • program: default
                      • accountInfo: AccountInfo<Buffer>
                      • oracle: PublicKey

                      Returns { lastUpdatedSlot: number; price: number; uiDeviation: number }

                      • lastUpdatedSlot: number
                      • price: number
                      • uiDeviation: number
                    • parseTxForKnownErrors(connection: Connection, signature: string): Promise<TransactionErrors>
                    • percentageToDecimal(percentage: number): number
                    • prepareMangoRouterInstructions(selectedRoute: RouteInfo, inputMint: PublicKey, outputMint: PublicKey, userPublicKey: PublicKey): Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>
                    • Parameters

                      • selectedRoute: RouteInfo
                      • inputMint: PublicKey
                      • outputMint: PublicKey
                      • userPublicKey: PublicKey

                      Returns Promise<[TransactionInstruction[], AddressLookupTableAccount[]]>

                    • roundTo5(number: any): number
                    • sendTransaction(provider: AnchorProvider, ixs: TransactionInstruction[], alts: AddressLookupTableAccount[], opts?: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }>): Promise<MangoSignatureStatus>
                    • Parameters

                      • provider: AnchorProvider
                      • ixs: TransactionInstruction[]
                      • alts: AddressLookupTableAccount[]
                      • opts: Partial<{ additionalSigners: Keypair[]; alts: AddressLookupTableAccount[]; confirmInBackground: boolean; estimateFee: boolean; latestBlockhash: Readonly<LatestBlockhash>; multipleConnections: Connection[]; preflightCommitment: Commitment; prioritizationFee: number; txConfirmationCommitment: Commitment; postSendTxCallback: any; postTxConfirmationCallback: any }> = {}

                      Returns Promise<MangoSignatureStatus>

                    • switchboardDecimalToBig(sbDecimal: { mantissa: BN; scale: number }): Big
                    • toNative(uiAmount: number, decimals: number): BN
                    • toNativeI80F48(uiAmount: number, decimals: number): I80F48
                    • toNativeI80F48ForQuote(uiAmount: number): I80F48
                    • toNativeSellPerBuyTokenPrice(price: number, sellBank: Bank, buyBank: Bank): number
                    • toUiDecimals(nativeAmount: number | BN | I80F48, decimals: number): number
                    • toUiDecimalsForQuote(nativeAmount: number | BN | I80F48): number
                    • toUiSellPerBuyTokenPrice(price: number, sellBank: Bank, buyBank: Bank): number
                    • tryStringify(val: any): null | string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/AccountEquity.html b/ts/client/interfaces/AccountEquity.html index c61b8826f..65c129783 100644 --- a/ts/client/interfaces/AccountEquity.html +++ b/ts/client/interfaces/AccountEquity.html @@ -1 +1 @@ -AccountEquity | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • AccountEquity

                    Index

                    Properties

                    Properties

                    Account: { highlight: boolean; val: PublicKey }

                    Type declaration

                    • highlight: boolean
                    • val: PublicKey
                    Equity: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +AccountEquity | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • AccountEquity

                    Index

                    Properties

                    Properties

                    Account: { highlight: boolean; val: PublicKey }

                    Type declaration

                    • highlight: boolean
                    • val: PublicKey
                    Equity: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/BankForHealth.html b/ts/client/interfaces/BankForHealth.html index bebef949c..70f515c06 100644 --- a/ts/client/interfaces/BankForHealth.html +++ b/ts/client/interfaces/BankForHealth.html @@ -1 +1 @@ -BankForHealth | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • BankForHealth

                    Implemented by

                    Index

                    Properties

                    borrowWeightScaleStartQuote: number
                    depositWeightScaleStartQuote: number
                    initAssetWeight: I80F48
                    initLiabWeight: I80F48
                    maintAssetWeight: I80F48
                    maintLiabWeight: I80F48
                    price: I80F48
                    stablePriceModel: StablePriceModel
                    tokenIndex: TokenIndex

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +BankForHealth | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • BankForHealth

                    Implemented by

                    Index

                    Properties

                    borrowWeightScaleStartQuote: number
                    depositWeightScaleStartQuote: number
                    initAssetWeight: I80F48
                    initLiabWeight: I80F48
                    maintAssetWeight: I80F48
                    maintLiabWeight: I80F48
                    price: I80F48
                    stablePriceModel: StablePriceModel
                    tokenIndex: TokenIndex

                    Methods

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/CumulativeFunding.html b/ts/client/interfaces/CumulativeFunding.html index 96fea3c15..e16ea0010 100644 --- a/ts/client/interfaces/CumulativeFunding.html +++ b/ts/client/interfaces/CumulativeFunding.html @@ -1 +1 @@ -CumulativeFunding | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +CumulativeFunding | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/Event.html b/ts/client/interfaces/Event.html index 7e2784973..6c7aa5e01 100644 --- a/ts/client/interfaces/Event.html +++ b/ts/client/interfaces/Event.html @@ -1 +1 @@ -Event | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Event | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/ExactOutSwapParams.html b/ts/client/interfaces/ExactOutSwapParams.html index 480dc28d1..935c9c8c0 100644 --- a/ts/client/interfaces/ExactOutSwapParams.html +++ b/ts/client/interfaces/ExactOutSwapParams.html @@ -1,3 +1,3 @@ -ExactOutSwapParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    amount: number
                    +ExactOutSwapParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    amount: number

                    amount is used for instruction and can be null when it is an intermediate swap, only the first swap has an amount

                    -
                    destinationMint: string
                    inAmount: number
                    openOrdersAddress?: string
                    overflowFeeAccount?: string
                    platformFee?: PlatformFee
                    quoteMintToReferrer?: QuoteMintToReferrer
                    slippageBps: number
                    sourceMint: string
                    swapMode: SwapMode
                    userDestinationTokenAccount: string
                    userSourceTokenAccount: string
                    userTransferAuthority: string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +
                    destinationMint: string
                    inAmount: number
                    openOrdersAddress?: string
                    overflowFeeAccount?: string
                    platformFee?: PlatformFee
                    quoteMintToReferrer?: QuoteMintToReferrer
                    slippageBps: number
                    sourceMint: string
                    swapMode: SwapMode
                    userDestinationTokenAccount: string
                    userSourceTokenAccount: string
                    userTransferAuthority: string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/Fee.html b/ts/client/interfaces/Fee.html index ac57d1769..f76491d88 100644 --- a/ts/client/interfaces/Fee.html +++ b/ts/client/interfaces/Fee.html @@ -1 +1 @@ -Fee | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Fee | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/FillEvent.html b/ts/client/interfaces/FillEvent.html index c6f8c3ec9..4b044710e 100644 --- a/ts/client/interfaces/FillEvent.html +++ b/ts/client/interfaces/FillEvent.html @@ -1 +1 @@ -FillEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    eventType: number
                    maker: PublicKey
                    makerFee: number
                    makerOrderId: BN
                    makerOut: boolean
                    makerSlot: number
                    makerTimestamp: BN
                    price: number
                    quantity: number
                    seqNum: BN
                    taker: PublicKey
                    takerClientOrderId: BN
                    takerFee: number
                    takerOrderId: BN
                    takerSide: 0 | 1
                    timestamp: BN

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +FillEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    eventType: number
                    maker: PublicKey
                    makerFee: number
                    makerOrderId: BN
                    makerOut: boolean
                    makerSlot: number
                    makerTimestamp: BN
                    price: number
                    quantity: number
                    seqNum: BN
                    taker: PublicKey
                    takerClientOrderId: BN
                    takerFee: number
                    takerOrderId: BN
                    takerSide: 0 | 1
                    timestamp: BN

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/LatestBlockhash.html b/ts/client/interfaces/LatestBlockhash.html index ad3a492af..4da673b9c 100644 --- a/ts/client/interfaces/LatestBlockhash.html +++ b/ts/client/interfaces/LatestBlockhash.html @@ -1 +1 @@ -LatestBlockhash | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +LatestBlockhash | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/LiqorPriceImpact.html b/ts/client/interfaces/LiqorPriceImpact.html index 4fca4d4c3..48da7cc36 100644 --- a/ts/client/interfaces/LiqorPriceImpact.html +++ b/ts/client/interfaces/LiqorPriceImpact.html @@ -1 +1 @@ -LiqorPriceImpact | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • LiqorPriceImpact

                    Index

                    Properties

                    Assets: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Assets Slippage: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Coin: { highlight: boolean; val: string }

                    Type declaration

                    • highlight: boolean
                    • val: string
                    Future Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Jup Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Liabs: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Liabs Slippage: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Oracle Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    V4 Liq Fee: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +LiqorPriceImpact | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • LiqorPriceImpact

                    Index

                    Properties

                    Assets: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Assets Slippage: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Coin: { highlight: boolean; val: string }

                    Type declaration

                    • highlight: boolean
                    • val: string
                    Future Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Jup Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Liabs: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Liabs Slippage: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Oracle Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    V4 Liq Fee: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/LiquidateEvent.html b/ts/client/interfaces/LiquidateEvent.html index b2c9e08bf..7e74036b7 100644 --- a/ts/client/interfaces/LiquidateEvent.html +++ b/ts/client/interfaces/LiquidateEvent.html @@ -1 +1 @@ -LiquidateEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +LiquidateEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/LiquidationBatches.html b/ts/client/interfaces/LiquidationBatches.html index 86aa155e0..0b63c01b3 100644 --- a/ts/client/interfaces/LiquidationBatches.html +++ b/ts/client/interfaces/LiquidationBatches.html @@ -1 +1 @@ -LiquidationBatches | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +LiquidationBatches | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/MangoSignatureStatus.html b/ts/client/interfaces/MangoSignatureStatus.html index bb8997923..a5291768e 100644 --- a/ts/client/interfaces/MangoSignatureStatus.html +++ b/ts/client/interfaces/MangoSignatureStatus.html @@ -1 +1 @@ -MangoSignatureStatus | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • MangoSignatureStatus

                    Index

                    Properties

                    confirmationStatus?: TransactionConfirmationStatus
                    confirmations?: null | number
                    err?: null | TransactionError
                    signature: string
                    slot?: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +MangoSignatureStatus | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • MangoSignatureStatus

                    Index

                    Properties

                    confirmationStatus?: TransactionConfirmationStatus
                    confirmations?: null | number
                    err?: null | TransactionError
                    signature: string
                    slot?: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/MarketInfo.html b/ts/client/interfaces/MarketInfo.html index 2d64f8ed7..9af539629 100644 --- a/ts/client/interfaces/MarketInfo.html +++ b/ts/client/interfaces/MarketInfo.html @@ -1 +1 @@ -MarketInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +MarketInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/OutEvent.html b/ts/client/interfaces/OutEvent.html index 724d05aa5..8cd6c7dcc 100644 --- a/ts/client/interfaces/OutEvent.html +++ b/ts/client/interfaces/OutEvent.html @@ -1 +1 @@ -OutEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +OutEvent | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/PerpPositionsToBeLiquidated.html b/ts/client/interfaces/PerpPositionsToBeLiquidated.html index 3710ec99c..c5a726c65 100644 --- a/ts/client/interfaces/PerpPositionsToBeLiquidated.html +++ b/ts/client/interfaces/PerpPositionsToBeLiquidated.html @@ -1 +1 @@ -PerpPositionsToBeLiquidated | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpPositionsToBeLiquidated

                    Index

                    Properties

                    Future Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Market: { highlight: boolean; val: string }

                    Type declaration

                    • highlight: boolean
                    • val: string
                    Notional Position: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +PerpPositionsToBeLiquidated | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • PerpPositionsToBeLiquidated

                    Index

                    Properties

                    Future Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Market: { highlight: boolean; val: string }

                    Type declaration

                    • highlight: boolean
                    • val: string
                    Notional Position: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number
                    Price: { highlight: boolean; val: number }

                    Type declaration

                    • highlight: boolean
                    • val: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/Quote.html b/ts/client/interfaces/Quote.html index afd398004..4a7e900e6 100644 --- a/ts/client/interfaces/Quote.html +++ b/ts/client/interfaces/Quote.html @@ -1 +1 @@ -Quote | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Quote

                    Index

                    Properties

                    feeAmount: number
                    feeMint: string
                    feePct: number
                    inAmount: number
                    minInAmount?: number
                    minOutAmount?: number
                    notEnoughLiquidity: boolean
                    outAmount: number
                    priceImpactPct: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Quote | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Quote

                    Index

                    Properties

                    feeAmount: number
                    feeMint: string
                    feePct: number
                    inAmount: number
                    minInAmount?: number
                    minOutAmount?: number
                    notEnoughLiquidity: boolean
                    outAmount: number
                    priceImpactPct: number

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/QuoteParams.html b/ts/client/interfaces/QuoteParams.html index 0d70b3de8..c4b3a508f 100644 --- a/ts/client/interfaces/QuoteParams.html +++ b/ts/client/interfaces/QuoteParams.html @@ -1 +1 @@ -QuoteParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +QuoteParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/Risk.html b/ts/client/interfaces/Risk.html index 2b236f18a..8702c7b72 100644 --- a/ts/client/interfaces/Risk.html +++ b/ts/client/interfaces/Risk.html @@ -1 +1 @@ -Risk | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Risk

                    Index

                    Properties

                    assetDrop: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    assetRally: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    liqorEquity: { data: AccountEquity[]; title: string }

                    Type declaration

                    marketMakerEquity: { data: AccountEquity[]; title: string }

                    Type declaration

                    perpDrop: { data: PerpPositionsToBeLiquidated[]; title: string }

                    Type declaration

                    perpRally: { data: PerpPositionsToBeLiquidated[]; title: string }

                    Type declaration

                    usdcDepeg: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    usdtDepeg: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +Risk | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • Risk

                    Index

                    Properties

                    assetDrop: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    assetRally: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    liqorEquity: { data: AccountEquity[]; title: string }

                    Type declaration

                    marketMakerEquity: { data: AccountEquity[]; title: string }

                    Type declaration

                    perpDrop: { data: PerpPositionsToBeLiquidated[]; title: string }

                    Type declaration

                    perpRally: { data: PerpPositionsToBeLiquidated[]; title: string }

                    Type declaration

                    usdcDepeg: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    usdtDepeg: { data: LiqorPriceImpact[]; title: string }

                    Type declaration

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/RouteInfo.html b/ts/client/interfaces/RouteInfo.html index d0168f264..d27d79686 100644 --- a/ts/client/interfaces/RouteInfo.html +++ b/ts/client/interfaces/RouteInfo.html @@ -1 +1 @@ -RouteInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • RouteInfo

                    Index

                    Properties

                    amount: number
                    inAmount: number
                    instructions?: TransactionInstruction[]
                    marketInfos: MarketInfo[]
                    mints?: PublicKey[]
                    otherAmountThreshold: number
                    outAmount: number
                    priceImpactPct: number
                    routerName?: "Mango"
                    slippageBps: number
                    swapMode: SwapMode

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +RouteInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    • RouteInfo

                    Index

                    Properties

                    amount: number
                    inAmount: number
                    instructions?: TransactionInstruction[]
                    marketInfos: MarketInfo[]
                    mints?: PublicKey[]
                    otherAmountThreshold: number
                    outAmount: number
                    priceImpactPct: number
                    routerName?: "Mango"
                    slippageBps: number
                    swapMode: SwapMode

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/SwapParams.html b/ts/client/interfaces/SwapParams.html index 30de757b4..3dbdc4722 100644 --- a/ts/client/interfaces/SwapParams.html +++ b/ts/client/interfaces/SwapParams.html @@ -1,3 +1,3 @@ -SwapParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    amount: number
                    +SwapParams | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Hierarchy

                    Index

                    Properties

                    amount: number

                    amount is used for instruction and can be null when it is an intermediate swap, only the first swap has an amount

                    -
                    destinationMint: string
                    openOrdersAddress?: string
                    quoteMintToReferrer?: QuoteMintToReferrer
                    sourceMint: string
                    swapMode: SwapMode
                    userDestinationTokenAccount: string
                    userSourceTokenAccount: string
                    userTransferAuthority: string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +
                    destinationMint: string
                    openOrdersAddress?: string
                    quoteMintToReferrer?: QuoteMintToReferrer
                    sourceMint: string
                    swapMode: SwapMode
                    userDestinationTokenAccount: string
                    userSourceTokenAccount: string
                    userTransferAuthority: string

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/interfaces/TransactionFeeInfo.html b/ts/client/interfaces/TransactionFeeInfo.html index eaa36c117..0a9718f44 100644 --- a/ts/client/interfaces/TransactionFeeInfo.html +++ b/ts/client/interfaces/TransactionFeeInfo.html @@ -1 +1 @@ -TransactionFeeInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +TransactionFeeInfo | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/modules/BookSideType.html b/ts/client/modules/BookSideType.html index 755746911..a6275a828 100644 --- a/ts/client/modules/BookSideType.html +++ b/ts/client/modules/BookSideType.html @@ -1 +1 @@ -BookSideType | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file +BookSideType | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Legend

                    • Constructor
                    • Property
                    • Method
                    • Property
                    • Method
                    • Private property
                    • Private method
                    • Static property
                    • Static method

                    Settings

                    Theme

                    Generated using TypeDoc

                    \ No newline at end of file diff --git a/ts/client/modules/FlashLoanType.html b/ts/client/modules/FlashLoanType.html index 038901bb3..639633dfb 100644 --- a/ts/client/modules/FlashLoanType.html +++ b/ts/client/modules/FlashLoanType.html @@ -1 +1 @@ -FlashLoanType | @blockworks-foundation/mango-v4
                    Options
                    All
                    • Public
                    • Public/Protected
                    • All
                    Menu

                    Index

                    Variables

                    swap: { swap: {} } = ...

                    Type declaration

                    • swap: {}
                      swapWithoutFee: { swapWithoutFee: {} } = ...

                      Type declaration

                      • swapWithoutFee: {}
                        unknown: { unknown: {} } = ...

                        Type declaration

                        • unknown: {}

                          Legend

                          • Constructor
                          • Property
                          • Method
                          • Property
                          • Method
                          • Private property
                          • Private method
                          • Static property
                          • Static method

                          Settings

                          Theme

                          Generated using TypeDoc

                          \ No newline at end of file +FlashLoanType | @blockworks-foundation/mango-v4
                          Options
                          All
                          • Public
                          • Public/Protected
                          • All
                          Menu

                          Index

                          Variables

                          swap: { swap: {} } = ...

                          Type declaration

                          • swap: {}
                            swapWithoutFee: { swapWithoutFee: {} } = ...

                            Type declaration

                            • swapWithoutFee: {}
                              unknown: { unknown: {} } = ...

                              Type declaration

                              • unknown: {}

                                Legend

                                • Constructor
                                • Property
                                • Method
                                • Property
                                • Method
                                • Private property
                                • Private method
                                • Static property
                                • Static method

                                Settings

                                Theme

                                Generated using TypeDoc

                                \ No newline at end of file diff --git a/ts/client/modules/PerpOrderSide.html b/ts/client/modules/PerpOrderSide.html index b09ec73eb..212572c2e 100644 --- a/ts/client/modules/PerpOrderSide.html +++ b/ts/client/modules/PerpOrderSide.html @@ -1 +1 @@ -PerpOrderSide | @blockworks-foundation/mango-v4
                                Options
                                All
                                • Public
                                • Public/Protected
                                • All
                                Menu

                                Legend

                                • Constructor
                                • Property
                                • Method
                                • Property
                                • Method
                                • Private property
                                • Private method
                                • Static property
                                • Static method

                                Settings

                                Theme

                                Generated using TypeDoc

                                \ No newline at end of file +PerpOrderSide | @blockworks-foundation/mango-v4
                                Options
                                All
                                • Public
                                • Public/Protected
                                • All
                                Menu

                                Legend

                                • Constructor
                                • Property
                                • Method
                                • Property
                                • Method
                                • Private property
                                • Private method
                                • Static property
                                • Static method

                                Settings

                                Theme

                                Generated using TypeDoc

                                \ No newline at end of file diff --git a/ts/client/modules/PerpOrderType.html b/ts/client/modules/PerpOrderType.html index 88f05eed3..bc687b6b0 100644 --- a/ts/client/modules/PerpOrderType.html +++ b/ts/client/modules/PerpOrderType.html @@ -1 +1 @@ -PerpOrderType | @blockworks-foundation/mango-v4
                                Options
                                All
                                • Public
                                • Public/Protected
                                • All
                                Menu

                                Index

                                Variables

                                immediateOrCancel: { immediateOrCancel: {} } = ...

                                Type declaration

                                • immediateOrCancel: {}
                                  limit: { limit: {} } = ...

                                  Type declaration

                                  • limit: {}
                                    market: { market: {} } = ...

                                    Type declaration

                                    • market: {}
                                      postOnly: { postOnly: {} } = ...

                                      Type declaration

                                      • postOnly: {}
                                        postOnlySlide: { postOnlySlide: {} } = ...

                                        Type declaration

                                        • postOnlySlide: {}

                                          Legend

                                          • Constructor
                                          • Property
                                          • Method
                                          • Property
                                          • Method
                                          • Private property
                                          • Private method
                                          • Static property
                                          • Static method

                                          Settings

                                          Theme

                                          Generated using TypeDoc

                                          \ No newline at end of file +PerpOrderType | @blockworks-foundation/mango-v4
                                          Options
                                          All
                                          • Public
                                          • Public/Protected
                                          • All
                                          Menu

                                          Index

                                          Variables

                                          immediateOrCancel: { immediateOrCancel: {} } = ...

                                          Type declaration

                                          • immediateOrCancel: {}
                                            limit: { limit: {} } = ...

                                            Type declaration

                                            • limit: {}
                                              market: { market: {} } = ...

                                              Type declaration

                                              • market: {}
                                                postOnly: { postOnly: {} } = ...

                                                Type declaration

                                                • postOnly: {}
                                                  postOnlySlide: { postOnlySlide: {} } = ...

                                                  Type declaration

                                                  • postOnlySlide: {}

                                                    Legend

                                                    • Constructor
                                                    • Property
                                                    • Method
                                                    • Property
                                                    • Method
                                                    • Private property
                                                    • Private method
                                                    • Static property
                                                    • Static method

                                                    Settings

                                                    Theme

                                                    Generated using TypeDoc

                                                    \ No newline at end of file diff --git a/ts/client/modules/PerpSelfTradeBehavior.html b/ts/client/modules/PerpSelfTradeBehavior.html index e1f9e9e32..c98e054fc 100644 --- a/ts/client/modules/PerpSelfTradeBehavior.html +++ b/ts/client/modules/PerpSelfTradeBehavior.html @@ -1 +1 @@ -PerpSelfTradeBehavior | @blockworks-foundation/mango-v4
                                                    Options
                                                    All
                                                    • Public
                                                    • Public/Protected
                                                    • All
                                                    Menu

                                                    Index

                                                    Variables

                                                    abortTransaction: { abortTransaction: {} } = ...

                                                    Type declaration

                                                    • abortTransaction: {}
                                                      cancelProvide: { cancelProvide: {} } = ...

                                                      Type declaration

                                                      • cancelProvide: {}
                                                        decrementTake: { decrementTake: {} } = ...

                                                        Type declaration

                                                        • decrementTake: {}

                                                          Legend

                                                          • Constructor
                                                          • Property
                                                          • Method
                                                          • Property
                                                          • Method
                                                          • Private property
                                                          • Private method
                                                          • Static property
                                                          • Static method

                                                          Settings

                                                          Theme

                                                          Generated using TypeDoc

                                                          \ No newline at end of file +PerpSelfTradeBehavior | @blockworks-foundation/mango-v4
                                                          Options
                                                          All
                                                          • Public
                                                          • Public/Protected
                                                          • All
                                                          Menu

                                                          Index

                                                          Variables

                                                          abortTransaction: { abortTransaction: {} } = ...

                                                          Type declaration

                                                          • abortTransaction: {}
                                                            cancelProvide: { cancelProvide: {} } = ...

                                                            Type declaration

                                                            • cancelProvide: {}
                                                              decrementTake: { decrementTake: {} } = ...

                                                              Type declaration

                                                              • decrementTake: {}

                                                                Legend

                                                                • Constructor
                                                                • Property
                                                                • Method
                                                                • Property
                                                                • Method
                                                                • Private property
                                                                • Private method
                                                                • Static property
                                                                • Static method

                                                                Settings

                                                                Theme

                                                                Generated using TypeDoc

                                                                \ No newline at end of file diff --git a/ts/client/modules/Serum3OrderType.html b/ts/client/modules/Serum3OrderType.html index 19aaae4b3..99b4b66b6 100644 --- a/ts/client/modules/Serum3OrderType.html +++ b/ts/client/modules/Serum3OrderType.html @@ -1 +1 @@ -Serum3OrderType | @blockworks-foundation/mango-v4
                                                                Options
                                                                All
                                                                • Public
                                                                • Public/Protected
                                                                • All
                                                                Menu

                                                                Index

                                                                Variables

                                                                immediateOrCancel: { immediateOrCancel: {} } = ...

                                                                Type declaration

                                                                • immediateOrCancel: {}
                                                                  limit: { limit: {} } = ...

                                                                  Type declaration

                                                                  • limit: {}
                                                                    postOnly: { postOnly: {} } = ...

                                                                    Type declaration

                                                                    • postOnly: {}

                                                                      Legend

                                                                      • Constructor
                                                                      • Property
                                                                      • Method
                                                                      • Property
                                                                      • Method
                                                                      • Private property
                                                                      • Private method
                                                                      • Static property
                                                                      • Static method

                                                                      Settings

                                                                      Theme

                                                                      Generated using TypeDoc

                                                                      \ No newline at end of file +Serum3OrderType | @blockworks-foundation/mango-v4
                                                                      Options
                                                                      All
                                                                      • Public
                                                                      • Public/Protected
                                                                      • All
                                                                      Menu

                                                                      Index

                                                                      Variables

                                                                      immediateOrCancel: { immediateOrCancel: {} } = ...

                                                                      Type declaration

                                                                      • immediateOrCancel: {}
                                                                        limit: { limit: {} } = ...

                                                                        Type declaration

                                                                        • limit: {}
                                                                          postOnly: { postOnly: {} } = ...

                                                                          Type declaration

                                                                          • postOnly: {}

                                                                            Legend

                                                                            • Constructor
                                                                            • Property
                                                                            • Method
                                                                            • Property
                                                                            • Method
                                                                            • Private property
                                                                            • Private method
                                                                            • Static property
                                                                            • Static method

                                                                            Settings

                                                                            Theme

                                                                            Generated using TypeDoc

                                                                            \ No newline at end of file diff --git a/ts/client/modules/Serum3SelfTradeBehavior.html b/ts/client/modules/Serum3SelfTradeBehavior.html index 82d7ac015..38e9a1423 100644 --- a/ts/client/modules/Serum3SelfTradeBehavior.html +++ b/ts/client/modules/Serum3SelfTradeBehavior.html @@ -1 +1 @@ -Serum3SelfTradeBehavior | @blockworks-foundation/mango-v4
                                                                            Options
                                                                            All
                                                                            • Public
                                                                            • Public/Protected
                                                                            • All
                                                                            Menu

                                                                            Index

                                                                            Variables

                                                                            abortTransaction: { abortTransaction: {} } = ...

                                                                            Type declaration

                                                                            • abortTransaction: {}
                                                                              cancelProvide: { cancelProvide: {} } = ...

                                                                              Type declaration

                                                                              • cancelProvide: {}
                                                                                decrementTake: { decrementTake: {} } = ...

                                                                                Type declaration

                                                                                • decrementTake: {}

                                                                                  Legend

                                                                                  • Constructor
                                                                                  • Property
                                                                                  • Method
                                                                                  • Property
                                                                                  • Method
                                                                                  • Private property
                                                                                  • Private method
                                                                                  • Static property
                                                                                  • Static method

                                                                                  Settings

                                                                                  Theme

                                                                                  Generated using TypeDoc

                                                                                  \ No newline at end of file +Serum3SelfTradeBehavior | @blockworks-foundation/mango-v4
                                                                                  Options
                                                                                  All
                                                                                  • Public
                                                                                  • Public/Protected
                                                                                  • All
                                                                                  Menu

                                                                                  Index

                                                                                  Variables

                                                                                  abortTransaction: { abortTransaction: {} } = ...

                                                                                  Type declaration

                                                                                  • abortTransaction: {}
                                                                                    cancelProvide: { cancelProvide: {} } = ...

                                                                                    Type declaration

                                                                                    • cancelProvide: {}
                                                                                      decrementTake: { decrementTake: {} } = ...

                                                                                      Type declaration

                                                                                      • decrementTake: {}

                                                                                        Legend

                                                                                        • Constructor
                                                                                        • Property
                                                                                        • Method
                                                                                        • Property
                                                                                        • Method
                                                                                        • Private property
                                                                                        • Private method
                                                                                        • Static property
                                                                                        • Static method

                                                                                        Settings

                                                                                        Theme

                                                                                        Generated using TypeDoc

                                                                                        \ No newline at end of file diff --git a/ts/client/modules/Serum3Side.html b/ts/client/modules/Serum3Side.html index a955706df..87d3bf2e8 100644 --- a/ts/client/modules/Serum3Side.html +++ b/ts/client/modules/Serum3Side.html @@ -1 +1 @@ -Serum3Side | @blockworks-foundation/mango-v4
                                                                                        Options
                                                                                        All
                                                                                        • Public
                                                                                        • Public/Protected
                                                                                        • All
                                                                                        Menu

                                                                                        Legend

                                                                                        • Constructor
                                                                                        • Property
                                                                                        • Method
                                                                                        • Property
                                                                                        • Method
                                                                                        • Private property
                                                                                        • Private method
                                                                                        • Static property
                                                                                        • Static method

                                                                                        Settings

                                                                                        Theme

                                                                                        Generated using TypeDoc

                                                                                        \ No newline at end of file +Serum3Side | @blockworks-foundation/mango-v4
                                                                                        Options
                                                                                        All
                                                                                        • Public
                                                                                        • Public/Protected
                                                                                        • All
                                                                                        Menu

                                                                                        Legend

                                                                                        • Constructor
                                                                                        • Property
                                                                                        • Method
                                                                                        • Property
                                                                                        • Method
                                                                                        • Private property
                                                                                        • Private method
                                                                                        • Static property
                                                                                        • Static method

                                                                                        Settings

                                                                                        Theme

                                                                                        Generated using TypeDoc

                                                                                        \ No newline at end of file diff --git a/ts/client/modules/TokenConditionalSwapDisplayPriceStyle.html b/ts/client/modules/TokenConditionalSwapDisplayPriceStyle.html index 881492e64..31ff4fd2f 100644 --- a/ts/client/modules/TokenConditionalSwapDisplayPriceStyle.html +++ b/ts/client/modules/TokenConditionalSwapDisplayPriceStyle.html @@ -1 +1 @@ -TokenConditionalSwapDisplayPriceStyle | @blockworks-foundation/mango-v4
                                                                                        Options
                                                                                        All
                                                                                        • Public
                                                                                        • Public/Protected
                                                                                        • All
                                                                                        Menu

                                                                                        Namespace TokenConditionalSwapDisplayPriceStyle

                                                                                        Index

                                                                                        Variables

                                                                                        buyTokenPerSellToken: { buyTokenPerSellToken: {} } = ...

                                                                                        Type declaration

                                                                                        • buyTokenPerSellToken: {}
                                                                                          sellTokenPerBuyToken: { sellTokenPerBuyToken: {} } = ...

                                                                                          Type declaration

                                                                                          • sellTokenPerBuyToken: {}

                                                                                            Legend

                                                                                            • Constructor
                                                                                            • Property
                                                                                            • Method
                                                                                            • Property
                                                                                            • Method
                                                                                            • Private property
                                                                                            • Private method
                                                                                            • Static property
                                                                                            • Static method

                                                                                            Settings

                                                                                            Theme

                                                                                            Generated using TypeDoc

                                                                                            \ No newline at end of file +TokenConditionalSwapDisplayPriceStyle | @blockworks-foundation/mango-v4
                                                                                            Options
                                                                                            All
                                                                                            • Public
                                                                                            • Public/Protected
                                                                                            • All
                                                                                            Menu

                                                                                            Namespace TokenConditionalSwapDisplayPriceStyle

                                                                                            Index

                                                                                            Variables

                                                                                            buyTokenPerSellToken: { buyTokenPerSellToken: {} } = ...

                                                                                            Type declaration

                                                                                            • buyTokenPerSellToken: {}
                                                                                              sellTokenPerBuyToken: { sellTokenPerBuyToken: {} } = ...

                                                                                              Type declaration

                                                                                              • sellTokenPerBuyToken: {}

                                                                                                Legend

                                                                                                • Constructor
                                                                                                • Property
                                                                                                • Method
                                                                                                • Property
                                                                                                • Method
                                                                                                • Private property
                                                                                                • Private method
                                                                                                • Static property
                                                                                                • Static method

                                                                                                Settings

                                                                                                Theme

                                                                                                Generated using TypeDoc

                                                                                                \ No newline at end of file diff --git a/ts/client/modules/TokenConditionalSwapIntention.html b/ts/client/modules/TokenConditionalSwapIntention.html index 9a4cc226d..6268d10fc 100644 --- a/ts/client/modules/TokenConditionalSwapIntention.html +++ b/ts/client/modules/TokenConditionalSwapIntention.html @@ -1 +1 @@ -TokenConditionalSwapIntention | @blockworks-foundation/mango-v4
                                                                                                Options
                                                                                                All
                                                                                                • Public
                                                                                                • Public/Protected
                                                                                                • All
                                                                                                Menu

                                                                                                Index

                                                                                                Variables

                                                                                                stopLoss: { stopLoss: {} } = ...

                                                                                                Type declaration

                                                                                                • stopLoss: {}
                                                                                                  takeProfit: { takeProfit: {} } = ...

                                                                                                  Type declaration

                                                                                                  • takeProfit: {}
                                                                                                    unknown: { unknown: {} } = ...

                                                                                                    Type declaration

                                                                                                    • unknown: {}

                                                                                                      Legend

                                                                                                      • Constructor
                                                                                                      • Property
                                                                                                      • Method
                                                                                                      • Property
                                                                                                      • Method
                                                                                                      • Private property
                                                                                                      • Private method
                                                                                                      • Static property
                                                                                                      • Static method

                                                                                                      Settings

                                                                                                      Theme

                                                                                                      Generated using TypeDoc

                                                                                                      \ No newline at end of file +TokenConditionalSwapIntention | @blockworks-foundation/mango-v4
                                                                                                      Options
                                                                                                      All
                                                                                                      • Public
                                                                                                      • Public/Protected
                                                                                                      • All
                                                                                                      Menu

                                                                                                      Index

                                                                                                      Variables

                                                                                                      stopLoss: { stopLoss: {} } = ...

                                                                                                      Type declaration

                                                                                                      • stopLoss: {}
                                                                                                        takeProfit: { takeProfit: {} } = ...

                                                                                                        Type declaration

                                                                                                        • takeProfit: {}
                                                                                                          unknown: { unknown: {} } = ...

                                                                                                          Type declaration

                                                                                                          • unknown: {}

                                                                                                            Legend

                                                                                                            • Constructor
                                                                                                            • Property
                                                                                                            • Method
                                                                                                            • Property
                                                                                                            • Method
                                                                                                            • Private property
                                                                                                            • Private method
                                                                                                            • Static property
                                                                                                            • Static method

                                                                                                            Settings

                                                                                                            Theme

                                                                                                            Generated using TypeDoc

                                                                                                            \ No newline at end of file