Options
All
  • Public
  • Public/Protected
  • All
Menu

@mrgnlabs/marginfi-client

Index

Type Aliases

IMangoOrderType: { limit: {} } | { immediateOrCancel: {} } | { postOnly: {} } | { market: {} } | { postOnlySlide: {} }
MarginfiIdl: { accounts: [{ name: "marginfiAccount"; type: { fields: [{ name: "authority"; type: "publicKey" }, { name: "marginfiGroup"; type: "publicKey" }, { name: "depositRecord"; type: { defined: "WrappedI80F48" } }, { name: "borrowRecord"; type: { defined: "WrappedI80F48" } }, { name: "activeUtps"; type: { array: ["bool", 32] } }, { name: "utpAccountConfig"; type: { array: [{ defined: "UTPAccountConfig" }, 32] } }, { name: "reservedSpace"; type: { array: ["u128", 256] } }]; kind: "struct" } }, { name: "marginfiGroup"; type: { fields: [{ name: "admin"; type: "publicKey" }, { name: "bank"; type: { defined: "Bank" } }, { name: "paused"; type: "bool" }, { name: "reservedSpace"; type: { array: ["u128", 384] } }]; kind: "struct" } }, { name: "state"; type: { fields: [{ name: "marginRequirementInit"; type: "u128" }, { name: "marginRequirementMaint"; type: "u128" }, { name: "equity"; type: "u128" }]; kind: "struct" } }]; errors: [{ code: 6000; msg: "Signer not authorized to perform this action"; name: "Unauthorized" }, { code: 6001; msg: "Lending pool empty"; name: "EmptyLendingPool" }, { code: 6002; msg: "Illegal utilization ratio"; name: "IllegalUtilizationRatio" }, { code: 6003; msg: "very bad mafs"; name: "MathError" }, { code: 6004; msg: "Invalid timestamp"; name: "InvalidTimestamp" }, { code: 6005; msg: "Initialization margin requirements not met"; name: "MarginRequirementsNotMet" }, { code: 6006; msg: "Only reducing trades are allowed when under init margin requirements"; name: "OnlyReduceAllowed" }, { code: 6007; msg: "Inactive UTP"; name: "UtpInactive" }, { code: 6008; msg: "Utp is already active"; name: "UtpAlreadyActive" }, { code: 6009; msg: "Invalid Account Data"; name: "InvalidAccountData" }, { code: 6010; msg: "Liquidator has active utps"; name: "LiquidatorHasActiveUtps" }, { code: 6011; msg: "Account has active utps"; name: "AccountHasActiveUtps" }, { code: 6012; msg: "Marginfi account not liquidatable"; name: "AccountNotLiquidatable" }, { code: 6013; msg: "Marginfi account not bankrupt"; name: "AccountNotBankrupt" }, { code: 6014; msg: "Utp account cannot be deactivated"; name: "IllegalUtpDeactivation" }, { code: 6015; msg: "Rebalance not legal"; name: "IllegalRebalance" }, { code: 6016; msg: "Borrow not allowed"; name: "BorrowNotAllowed" }, { code: 6017; msg: "Config value not legal"; name: "IllegalConfig" }, { code: 6018; msg: "Operations paused"; name: "OperationsPaused" }, { code: 6019; msg: "Insufficient balance"; name: "InsufficientVaultBalance" }, { code: 6020; msg: "This operation is forbidden"; name: "Forbidden" }, { code: 6021; msg: "Invalid account key"; name: "InvalidUTPAccount" }, { code: 6022; msg: "Deposit exceeds account cap"; name: "AccountDepositLimit" }, { code: 6023; msg: "Deposit exceeds group cap"; name: "GroupDepositLimit" }, { code: 6024; msg: "Missing accounts for UTP observation"; name: "InvalidObserveAccounts" }, { code: 6025; msg: "Mango error"; name: "MangoError" }]; events: [{ fields: [{ index: false; name: "currentTimestamp"; type: "i64" }, { index: false; name: "deltaCompoundingPeriods"; type: "u64" }, { index: false; name: "feesCollected"; type: { defined: "WrappedI80F48" } }, { index: false; name: "utilizationRate"; type: { defined: "WrappedI80F48" } }, { index: false; name: "interestRate"; type: { defined: "WrappedI80F48" } }]; name: "UpdateInterestAccumulatorEvent" }, { fields: [{ index: false; name: "init"; type: "bool" }, { index: false; name: "equity"; type: { defined: "WrappedI80F48" } }, { index: false; name: "marginRequirement"; type: { defined: "WrappedI80F48" } }]; name: "MarginRequirementCheck" }, { fields: [{ index: false; name: "utpIndex"; type: "u8" }, { index: false; name: "value"; type: { defined: "WrappedI80F48" } }]; name: "UptObservationFreeCollateral" }, { fields: [{ index: false; name: "utpIndex"; type: "u8" }, { index: false; name: "netFreeCollateral"; type: { defined: "WrappedI80F48" } }]; name: "UptObservationNeedsRebalance" }, { fields: []; name: "RiskEnginePermissionlessAction" }, { fields: []; name: "RiskEngineReduceOnly" }]; instructions: [{ accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "collateralMint" }, { isMut: false; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: false; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: false; isSigner: false; name: "feeVault" }, { isMut: false; isSigner: false; name: "feeVaultAuthority" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "bankAuthorityPdaBump"; type: "u8" }, { name: "insuranceVaultAuthorityPdaBump"; type: "u8" }, { name: "feeVaultAuthorityPdaBump"; type: "u8" }]; name: "initMarginfiGroup" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "configArg"; type: { defined: "GroupConfig" } }]; name: "configureMarginfiGroup" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bankFeeVault" }, { isMut: false; isSigner: false; name: "bankFeeVaultAuthority" }, { isMut: true; isSigner: false; name: "recipientTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "bankFeeVaultWithdraw" }, { accounts: [{ isMut: true; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "initMarginfiAccount" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: true; isSigner: false; name: "recipientTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "bankInsuranceVaultWithdraw" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "fundingAccount" }, { isMut: true; isSigner: false; name: "tokenVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "marginDepositCollateral" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "marginBankAuthority" }, { isMut: true; isSigner: false; name: "receivingTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "marginWithdrawCollateral" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginfiAccountLiquidatee" }, { isMut: true; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "bankInsuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "utpIndex"; type: "u64" }]; name: "liquidate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "authority" }]; args: [{ name: "utpIndex"; type: "u64" }]; name: "deactivateUtp" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "liquidityVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "handleBankruptcy" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "bankFeeVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "updateInterestAccumulator" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: true; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }]; name: "utpMangoActivate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "tempCollateralAccount" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: true; isSigner: false; name: "mangoCache" }, { isMut: true; isSigner: false; name: "mangoRootBank" }, { isMut: true; isSigner: false; name: "mangoNodeBank" }, { isMut: true; isSigner: false; name: "mangoVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpMangoDeposit" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "mangoCache" }, { isMut: false; isSigner: false; name: "mangoRootBank" }, { isMut: true; isSigner: false; name: "mangoNodeBank" }, { isMut: true; isSigner: false; name: "mangoVault" }, { isMut: false; isSigner: false; name: "mangoVaultAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpMangoWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "mangoCache" }, { isMut: true; isSigner: false; name: "mangoPerpMarket" }, { isMut: true; isSigner: false; name: "mangoBids" }, { isMut: true; isSigner: false; name: "mangoAsks" }, { isMut: true; isSigner: false; name: "mangoEventQueue" }]; args: [{ name: "args"; type: { defined: "UtpMangoPlacePerpOrderArgs" } }]; name: "utpMangoUsePlacePerpOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: true; isSigner: false; name: "mangoPerpMarket" }, { isMut: true; isSigner: false; name: "mangoBids" }, { isMut: true; isSigner: false; name: "mangoAsks" }]; args: [{ name: "orderId"; type: "i128" }, { name: "invalidIdOk"; type: "bool" }]; name: "utpMangoUseCancelPerpOrder" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "zoState" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: true; isSigner: false; name: "zoControl" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }, { name: "zoMarginNonce"; type: "u8" }]; name: "utpZoActivate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "tempCollateralAccount" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "zoState" }, { isMut: false; isSigner: false; name: "zoStateSigner" }, { isMut: true; isSigner: false; name: "zoCache" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: true; isSigner: false; name: "zoVault" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpZoDeposit" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: true; isSigner: false; name: "zoState" }, { isMut: true; isSigner: false; name: "zoStateSigner" }, { isMut: true; isSigner: false; name: "zoCache" }, { isMut: true; isSigner: false; name: "zoControl" }, { isMut: true; isSigner: false; name: "zoVault" }, { isMut: true; isSigner: false; name: "heimdall" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpZoWithdraw" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: false; isSigner: false; name: "dexProgram" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "utpZoCreatePerpOpenOrders" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: true; isSigner: false; name: "reqQ" }, { isMut: true; isSigner: false; name: "eventQ" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: false; isSigner: false; name: "dexProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "args"; type: { defined: "UtpZoPlacePerpOrderIxArgs" } }]; name: "utpZoPlacePerpOrder" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "eventQ" }, { isMut: false; isSigner: false; name: "dexProgram" }]; args: [{ name: "orderId"; type: { option: "u128" } }, { name: "isLong"; type: { option: "bool" } }, { name: "clientId"; type: { option: "u64" } }]; name: "utpZoCancelPerpOrder" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: false; isSigner: false; name: "dexProgram" }]; args: []; name: "utpZoSettleFunds" }]; name: "marginfi"; types: [{ name: "UtpMangoPlacePerpOrderArgs"; type: { fields: [{ name: "side"; type: { defined: "MangoSide" } }, { name: "price"; type: "i64" }, { name: "maxBaseQuantity"; type: "i64" }, { name: "maxQuoteQuantity"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "MangoOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: { option: "u64" } }, { name: "limit"; type: "u8" }, { name: "expiryType"; type: { defined: "MangoExpiryType" } }]; kind: "struct" } }, { name: "UtpZoPlacePerpOrderIxArgs"; type: { fields: [{ name: "isLong"; type: "bool" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQuantity"; type: "u64" }, { name: "maxQuoteQuantity"; type: "u64" }, { name: "orderType"; type: { defined: "OrderType" } }, { name: "limit"; type: "u16" }, { name: "clientId"; type: "u64" }]; kind: "struct" } }, { name: "UtpZoCancelPerpOrderIxArgs"; type: { fields: [{ name: "orderId"; type: { option: "u128" } }, { name: "isLong"; type: { option: "bool" } }, { name: "clientId"; type: { option: "u64" } }]; kind: "struct" } }, { name: "WrappedI80F48"; type: { fields: [{ name: "bits"; type: "i128" }]; kind: "struct" } }, { name: "UTPAccountConfig"; type: { fields: [{ name: "address"; type: "publicKey" }, { name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }, { name: "utpAddressBook"; type: { array: ["publicKey", 4] } }, { name: "reservedSpace"; type: { array: ["u32", 32] } }]; kind: "struct" } }, { name: "UTPConfig"; type: { fields: [{ name: "utpProgramId"; type: "publicKey" }, { name: "marginRequirementDepositBuffer"; type: { defined: "WrappedI80F48" } }]; kind: "struct" } }, { name: "GroupConfig"; type: { fields: [{ name: "admin"; type: { option: "publicKey" } }, { name: "bank"; type: { option: { defined: "BankConfig" } } }, { name: "paused"; type: { option: "bool" } }]; kind: "struct" } }, { name: "BankConfig"; type: { fields: [{ name: "scalingFactorC"; type: { option: "u64" } }, { name: "fixedFee"; type: { option: "u64" } }, { name: "interestFee"; type: { option: "u64" } }, { name: "initMarginRatio"; type: { option: "u64" } }, { name: "maintMarginRatio"; type: { option: "u64" } }, { name: "accountDepositLimit"; type: { option: "u64" } }, { name: "lpDepositLimit"; type: { option: "u64" } }]; kind: "struct" } }, { name: "Bank"; type: { fields: [{ name: "scalingFactorC"; type: { defined: "WrappedI80F48" } }, { name: "fixedFee"; type: { defined: "WrappedI80F48" } }, { name: "interestFee"; type: { defined: "WrappedI80F48" } }, { name: "depositAccumulator"; type: { defined: "WrappedI80F48" } }, { name: "borrowAccumulator"; type: { defined: "WrappedI80F48" } }, { name: "lastUpdate"; type: "i64" }, { name: "totalDepositsRecord"; type: { defined: "WrappedI80F48" } }, { name: "totalBorrowsRecord"; type: { defined: "WrappedI80F48" } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "vaultAuthorityPdaBump"; type: "u8" }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceVaultAuthorityPdaBump"; type: "u8" }, { name: "insuranceVaultOutstandingTransfers"; type: { defined: "WrappedI80F48" } }, { name: "feeVault"; type: "publicKey" }, { name: "feeVaultAuthorityPdaBump"; type: "u8" }, { name: "feeVaultOutstandingTransfers"; type: { defined: "WrappedI80F48" } }, { name: "initMarginRatio"; type: { defined: "WrappedI80F48" } }, { name: "maintMarginRatio"; type: { defined: "WrappedI80F48" } }, { name: "accountDepositLimit"; type: { defined: "WrappedI80F48" } }, { name: "lpDepositLimit"; type: { defined: "WrappedI80F48" } }, { name: "reservedSpace"; type: { array: ["u128", 31] } }]; kind: "struct" } }, { name: "MangoOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "MangoSide"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { name: "MangoExpiryType"; type: { kind: "enum"; variants: [{ name: "Absolute" }, { name: "Relative" }] } }, { name: "MarginRequirement"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "PartialLiquidation" }, { name: "Maint" }] } }, { name: "EquityType"; type: { kind: "enum"; variants: [{ name: "InitReqAdjusted" }, { name: "Total" }] } }, { name: "BankVaultType"; type: { kind: "enum"; variants: [{ name: "LiquidityVault" }, { name: "InsuranceVault" }, { name: "ProtocolFeeVault" }] } }, { name: "InternalTransferType"; type: { kind: "enum"; variants: [{ name: "InsuranceFee" }, { name: "ProtocolFee" }] } }, { name: "LendingSide"; type: { kind: "enum"; variants: [{ name: "Borrow" }, { name: "Deposit" }] } }, { name: "OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "ReduceOnlyIoc" }, { name: "ReduceOnlyLimit" }, { name: "FillOrKill" }] } }]; version: "0.1.0" }

Type declaration

  • accounts: [{ name: "marginfiAccount"; type: { fields: [{ name: "authority"; type: "publicKey" }, { name: "marginfiGroup"; type: "publicKey" }, { name: "depositRecord"; type: { defined: "WrappedI80F48" } }, { name: "borrowRecord"; type: { defined: "WrappedI80F48" } }, { name: "activeUtps"; type: { array: ["bool", 32] } }, { name: "utpAccountConfig"; type: { array: [{ defined: "UTPAccountConfig" }, 32] } }, { name: "reservedSpace"; type: { array: ["u128", 256] } }]; kind: "struct" } }, { name: "marginfiGroup"; type: { fields: [{ name: "admin"; type: "publicKey" }, { name: "bank"; type: { defined: "Bank" } }, { name: "paused"; type: "bool" }, { name: "reservedSpace"; type: { array: ["u128", 384] } }]; kind: "struct" } }, { name: "state"; type: { fields: [{ name: "marginRequirementInit"; type: "u128" }, { name: "marginRequirementMaint"; type: "u128" }, { name: "equity"; type: "u128" }]; kind: "struct" } }]
  • errors: [{ code: 6000; msg: "Signer not authorized to perform this action"; name: "Unauthorized" }, { code: 6001; msg: "Lending pool empty"; name: "EmptyLendingPool" }, { code: 6002; msg: "Illegal utilization ratio"; name: "IllegalUtilizationRatio" }, { code: 6003; msg: "very bad mafs"; name: "MathError" }, { code: 6004; msg: "Invalid timestamp"; name: "InvalidTimestamp" }, { code: 6005; msg: "Initialization margin requirements not met"; name: "MarginRequirementsNotMet" }, { code: 6006; msg: "Only reducing trades are allowed when under init margin requirements"; name: "OnlyReduceAllowed" }, { code: 6007; msg: "Inactive UTP"; name: "UtpInactive" }, { code: 6008; msg: "Utp is already active"; name: "UtpAlreadyActive" }, { code: 6009; msg: "Invalid Account Data"; name: "InvalidAccountData" }, { code: 6010; msg: "Liquidator has active utps"; name: "LiquidatorHasActiveUtps" }, { code: 6011; msg: "Account has active utps"; name: "AccountHasActiveUtps" }, { code: 6012; msg: "Marginfi account not liquidatable"; name: "AccountNotLiquidatable" }, { code: 6013; msg: "Marginfi account not bankrupt"; name: "AccountNotBankrupt" }, { code: 6014; msg: "Utp account cannot be deactivated"; name: "IllegalUtpDeactivation" }, { code: 6015; msg: "Rebalance not legal"; name: "IllegalRebalance" }, { code: 6016; msg: "Borrow not allowed"; name: "BorrowNotAllowed" }, { code: 6017; msg: "Config value not legal"; name: "IllegalConfig" }, { code: 6018; msg: "Operations paused"; name: "OperationsPaused" }, { code: 6019; msg: "Insufficient balance"; name: "InsufficientVaultBalance" }, { code: 6020; msg: "This operation is forbidden"; name: "Forbidden" }, { code: 6021; msg: "Invalid account key"; name: "InvalidUTPAccount" }, { code: 6022; msg: "Deposit exceeds account cap"; name: "AccountDepositLimit" }, { code: 6023; msg: "Deposit exceeds group cap"; name: "GroupDepositLimit" }, { code: 6024; msg: "Missing accounts for UTP observation"; name: "InvalidObserveAccounts" }, { code: 6025; msg: "Mango error"; name: "MangoError" }]
  • events: [{ fields: [{ index: false; name: "currentTimestamp"; type: "i64" }, { index: false; name: "deltaCompoundingPeriods"; type: "u64" }, { index: false; name: "feesCollected"; type: { defined: "WrappedI80F48" } }, { index: false; name: "utilizationRate"; type: { defined: "WrappedI80F48" } }, { index: false; name: "interestRate"; type: { defined: "WrappedI80F48" } }]; name: "UpdateInterestAccumulatorEvent" }, { fields: [{ index: false; name: "init"; type: "bool" }, { index: false; name: "equity"; type: { defined: "WrappedI80F48" } }, { index: false; name: "marginRequirement"; type: { defined: "WrappedI80F48" } }]; name: "MarginRequirementCheck" }, { fields: [{ index: false; name: "utpIndex"; type: "u8" }, { index: false; name: "value"; type: { defined: "WrappedI80F48" } }]; name: "UptObservationFreeCollateral" }, { fields: [{ index: false; name: "utpIndex"; type: "u8" }, { index: false; name: "netFreeCollateral"; type: { defined: "WrappedI80F48" } }]; name: "UptObservationNeedsRebalance" }, { fields: []; name: "RiskEnginePermissionlessAction" }, { fields: []; name: "RiskEngineReduceOnly" }]
  • instructions: [{ accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "admin" }, { isMut: false; isSigner: false; name: "collateralMint" }, { isMut: false; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: false; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: false; isSigner: false; name: "feeVault" }, { isMut: false; isSigner: false; name: "feeVaultAuthority" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "bankAuthorityPdaBump"; type: "u8" }, { name: "insuranceVaultAuthorityPdaBump"; type: "u8" }, { name: "feeVaultAuthorityPdaBump"; type: "u8" }]; name: "initMarginfiGroup" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }]; args: [{ name: "configArg"; type: { defined: "GroupConfig" } }]; name: "configureMarginfiGroup" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "bankFeeVault" }, { isMut: false; isSigner: false; name: "bankFeeVaultAuthority" }, { isMut: true; isSigner: false; name: "recipientTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "bankFeeVaultWithdraw" }, { accounts: [{ isMut: true; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "initMarginfiAccount" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "admin" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: true; isSigner: false; name: "recipientTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "bankInsuranceVaultWithdraw" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "fundingAccount" }, { isMut: true; isSigner: false; name: "tokenVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "marginDepositCollateral" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "marginBankAuthority" }, { isMut: true; isSigner: false; name: "receivingTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "marginWithdrawCollateral" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginfiAccountLiquidatee" }, { isMut: true; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "bankInsuranceVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "utpIndex"; type: "u64" }]; name: "liquidate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: true; name: "authority" }]; args: [{ name: "utpIndex"; type: "u64" }]; name: "deactivateUtp" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: false; name: "insuranceVaultAuthority" }, { isMut: true; isSigner: false; name: "insuranceVault" }, { isMut: true; isSigner: false; name: "liquidityVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "handleBankruptcy" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: false; name: "bankVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "bankFeeVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: []; name: "updateInterestAccumulator" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: true; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }]; name: "utpMangoActivate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "tempCollateralAccount" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: true; isSigner: false; name: "mangoCache" }, { isMut: true; isSigner: false; name: "mangoRootBank" }, { isMut: true; isSigner: false; name: "mangoNodeBank" }, { isMut: true; isSigner: false; name: "mangoVault" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpMangoDeposit" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "mangoCache" }, { isMut: false; isSigner: false; name: "mangoRootBank" }, { isMut: true; isSigner: false; name: "mangoNodeBank" }, { isMut: true; isSigner: false; name: "mangoVault" }, { isMut: false; isSigner: false; name: "mangoVaultAuthority" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpMangoWithdraw" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: false; isSigner: false; name: "mangoCache" }, { isMut: true; isSigner: false; name: "mangoPerpMarket" }, { isMut: true; isSigner: false; name: "mangoBids" }, { isMut: true; isSigner: false; name: "mangoAsks" }, { isMut: true; isSigner: false; name: "mangoEventQueue" }]; args: [{ name: "args"; type: { defined: "UtpMangoPlacePerpOrderArgs" } }]; name: "utpMangoUsePlacePerpOrder" }, { accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "mangoAuthority" }, { isMut: true; isSigner: false; name: "mangoAccount" }, { isMut: false; isSigner: false; name: "mangoProgram" }, { isMut: false; isSigner: false; name: "mangoGroup" }, { isMut: true; isSigner: false; name: "mangoPerpMarket" }, { isMut: true; isSigner: false; name: "mangoBids" }, { isMut: true; isSigner: false; name: "mangoAsks" }]; args: [{ name: "orderId"; type: "i128" }, { name: "invalidIdOk"; type: "bool" }]; name: "utpMangoUseCancelPerpOrder" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "authority" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "zoState" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: true; isSigner: false; name: "zoControl" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }, { name: "zoMarginNonce"; type: "u8" }]; name: "utpZoActivate" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "bankAuthority" }, { isMut: true; isSigner: false; name: "tempCollateralAccount" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "zoState" }, { isMut: false; isSigner: false; name: "zoStateSigner" }, { isMut: true; isSigner: false; name: "zoCache" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: true; isSigner: false; name: "zoVault" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpZoDeposit" }, { accounts: [{ isMut: true; isSigner: false; name: "marginfiAccount" }, { isMut: true; isSigner: false; name: "marginfiGroup" }, { isMut: false; isSigner: true; name: "signer" }, { isMut: true; isSigner: false; name: "marginCollateralVault" }, { isMut: false; isSigner: false; name: "utpAuthority" }, { isMut: true; isSigner: false; name: "zoMargin" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: true; isSigner: false; name: "zoState" }, { isMut: true; isSigner: false; name: "zoStateSigner" }, { isMut: true; isSigner: false; name: "zoCache" }, { isMut: true; isSigner: false; name: "zoControl" }, { isMut: true; isSigner: false; name: "zoVault" }, { isMut: true; isSigner: false; name: "heimdall" }, { isMut: false; isSigner: false; name: "tokenProgram" }]; args: [{ name: "amount"; type: "u64" }]; name: "utpZoWithdraw" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: false; isSigner: false; name: "dexProgram" }, { isMut: false; isSigner: false; name: "rent" }, { isMut: false; isSigner: false; name: "systemProgram" }]; args: []; name: "utpZoCreatePerpOpenOrders" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: true; isSigner: false; name: "reqQ" }, { isMut: true; isSigner: false; name: "eventQ" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: false; isSigner: false; name: "dexProgram" }, { isMut: false; isSigner: false; name: "rent" }]; args: [{ name: "args"; type: { defined: "UtpZoPlacePerpOrderIxArgs" } }]; name: "utpZoPlacePerpOrder" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: true; isSigner: false; name: "marketBids" }, { isMut: true; isSigner: false; name: "marketAsks" }, { isMut: true; isSigner: false; name: "eventQ" }, { isMut: false; isSigner: false; name: "dexProgram" }]; args: [{ name: "orderId"; type: { option: "u128" } }, { name: "isLong"; type: { option: "bool" } }, { name: "clientId"; type: { option: "u64" } }]; name: "utpZoCancelPerpOrder" }, { accounts: [{ accounts: [{ isMut: false; isSigner: false; name: "marginfiAccount" }, { isMut: false; isSigner: false; name: "marginfiGroup" }, { isMut: true; isSigner: true; name: "signer" }, { isMut: false; isSigner: false; name: "utpAuthority" }]; name: "header" }, { isMut: false; isSigner: false; name: "zoProgram" }, { isMut: false; isSigner: false; name: "state" }, { isMut: true; isSigner: false; name: "stateSigner" }, { isMut: true; isSigner: false; name: "cache" }, { isMut: true; isSigner: false; name: "margin" }, { isMut: true; isSigner: false; name: "control" }, { isMut: true; isSigner: false; name: "openOrders" }, { isMut: true; isSigner: false; name: "dexMarket" }, { isMut: false; isSigner: false; name: "dexProgram" }]; args: []; name: "utpZoSettleFunds" }]
  • name: "marginfi"
  • types: [{ name: "UtpMangoPlacePerpOrderArgs"; type: { fields: [{ name: "side"; type: { defined: "MangoSide" } }, { name: "price"; type: "i64" }, { name: "maxBaseQuantity"; type: "i64" }, { name: "maxQuoteQuantity"; type: "i64" }, { name: "clientOrderId"; type: "u64" }, { name: "orderType"; type: { defined: "MangoOrderType" } }, { name: "reduceOnly"; type: "bool" }, { name: "expiryTimestamp"; type: { option: "u64" } }, { name: "limit"; type: "u8" }, { name: "expiryType"; type: { defined: "MangoExpiryType" } }]; kind: "struct" } }, { name: "UtpZoPlacePerpOrderIxArgs"; type: { fields: [{ name: "isLong"; type: "bool" }, { name: "limitPrice"; type: "u64" }, { name: "maxBaseQuantity"; type: "u64" }, { name: "maxQuoteQuantity"; type: "u64" }, { name: "orderType"; type: { defined: "OrderType" } }, { name: "limit"; type: "u16" }, { name: "clientId"; type: "u64" }]; kind: "struct" } }, { name: "UtpZoCancelPerpOrderIxArgs"; type: { fields: [{ name: "orderId"; type: { option: "u128" } }, { name: "isLong"; type: { option: "bool" } }, { name: "clientId"; type: { option: "u64" } }]; kind: "struct" } }, { name: "WrappedI80F48"; type: { fields: [{ name: "bits"; type: "i128" }]; kind: "struct" } }, { name: "UTPAccountConfig"; type: { fields: [{ name: "address"; type: "publicKey" }, { name: "authoritySeed"; type: "publicKey" }, { name: "authorityBump"; type: "u8" }, { name: "utpAddressBook"; type: { array: ["publicKey", 4] } }, { name: "reservedSpace"; type: { array: ["u32", 32] } }]; kind: "struct" } }, { name: "UTPConfig"; type: { fields: [{ name: "utpProgramId"; type: "publicKey" }, { name: "marginRequirementDepositBuffer"; type: { defined: "WrappedI80F48" } }]; kind: "struct" } }, { name: "GroupConfig"; type: { fields: [{ name: "admin"; type: { option: "publicKey" } }, { name: "bank"; type: { option: { defined: "BankConfig" } } }, { name: "paused"; type: { option: "bool" } }]; kind: "struct" } }, { name: "BankConfig"; type: { fields: [{ name: "scalingFactorC"; type: { option: "u64" } }, { name: "fixedFee"; type: { option: "u64" } }, { name: "interestFee"; type: { option: "u64" } }, { name: "initMarginRatio"; type: { option: "u64" } }, { name: "maintMarginRatio"; type: { option: "u64" } }, { name: "accountDepositLimit"; type: { option: "u64" } }, { name: "lpDepositLimit"; type: { option: "u64" } }]; kind: "struct" } }, { name: "Bank"; type: { fields: [{ name: "scalingFactorC"; type: { defined: "WrappedI80F48" } }, { name: "fixedFee"; type: { defined: "WrappedI80F48" } }, { name: "interestFee"; type: { defined: "WrappedI80F48" } }, { name: "depositAccumulator"; type: { defined: "WrappedI80F48" } }, { name: "borrowAccumulator"; type: { defined: "WrappedI80F48" } }, { name: "lastUpdate"; type: "i64" }, { name: "totalDepositsRecord"; type: { defined: "WrappedI80F48" } }, { name: "totalBorrowsRecord"; type: { defined: "WrappedI80F48" } }, { name: "mint"; type: "publicKey" }, { name: "vault"; type: "publicKey" }, { name: "vaultAuthorityPdaBump"; type: "u8" }, { name: "insuranceVault"; type: "publicKey" }, { name: "insuranceVaultAuthorityPdaBump"; type: "u8" }, { name: "insuranceVaultOutstandingTransfers"; type: { defined: "WrappedI80F48" } }, { name: "feeVault"; type: "publicKey" }, { name: "feeVaultAuthorityPdaBump"; type: "u8" }, { name: "feeVaultOutstandingTransfers"; type: { defined: "WrappedI80F48" } }, { name: "initMarginRatio"; type: { defined: "WrappedI80F48" } }, { name: "maintMarginRatio"; type: { defined: "WrappedI80F48" } }, { name: "accountDepositLimit"; type: { defined: "WrappedI80F48" } }, { name: "lpDepositLimit"; type: { defined: "WrappedI80F48" } }, { name: "reservedSpace"; type: { array: ["u128", 31] } }]; kind: "struct" } }, { name: "MangoOrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "Market" }, { name: "PostOnlySlide" }] } }, { name: "MangoSide"; type: { kind: "enum"; variants: [{ name: "Bid" }, { name: "Ask" }] } }, { name: "MangoExpiryType"; type: { kind: "enum"; variants: [{ name: "Absolute" }, { name: "Relative" }] } }, { name: "MarginRequirement"; type: { kind: "enum"; variants: [{ name: "Init" }, { name: "PartialLiquidation" }, { name: "Maint" }] } }, { name: "EquityType"; type: { kind: "enum"; variants: [{ name: "InitReqAdjusted" }, { name: "Total" }] } }, { name: "BankVaultType"; type: { kind: "enum"; variants: [{ name: "LiquidityVault" }, { name: "InsuranceVault" }, { name: "ProtocolFeeVault" }] } }, { name: "InternalTransferType"; type: { kind: "enum"; variants: [{ name: "InsuranceFee" }, { name: "ProtocolFee" }] } }, { name: "LendingSide"; type: { kind: "enum"; variants: [{ name: "Borrow" }, { name: "Deposit" }] } }, { name: "OrderType"; type: { kind: "enum"; variants: [{ name: "Limit" }, { name: "ImmediateOrCancel" }, { name: "PostOnly" }, { name: "ReduceOnlyIoc" }, { name: "ReduceOnlyLimit" }, { name: "FillOrKill" }] } }]
  • version: "0.1.0"
ObservationCache: Map<UtpIndex, UtpObservation>
UiAmount: BigNumber | number | I80F48 | string

Variables

DUST_THRESHOLD: BigNumber = ...
INSURANCE_VAULT_LIQUIDATION_FEE: BigNumber = ...
LIQUIDATOR_LIQUIDATION_FEE: BigNumber = ...
MARGINFI_IDL: MarginfiIdl = ...
PARTIAL_LIQUIDATION_FACTOR: BigNumber = ...
PDA_BANK_FEE_VAULT_SEED: Buffer = ...
PDA_BANK_INSURANCE_VAULT_SEED: Buffer = ...
PDA_BANK_VAULT_SEED: Buffer = ...
PDA_UTP_AUTH_SEED: Buffer = ...
UTP_NAME: { 0: string; 1: string } = ...

Type declaration

  • 0: string
  • 1: string
VERY_VERBOSE_ERROR: string = ...
ZoPerpOrderType: { FillOrKill: { fillOrKill: {} }; ImmediateOrCancel: { immediateOrCancel: {} }; Limit: { limit: {} }; PostOnly: { postOnly: {} }; ReduceOnlyIoc: { reduceOnlyIoc: {} }; ReduceOnlyLimit: { reduceOnlyLimit: {} } } = ...

Type declaration

  • FillOrKill: { fillOrKill: {} }
    • fillOrKill: {}
    • ImmediateOrCancel: { immediateOrCancel: {} }
      • immediateOrCancel: {}
      • Limit: { limit: {} }
        • limit: {}
        • PostOnly: { postOnly: {} }
          • postOnly: {}
          • ReduceOnlyIoc: { reduceOnlyIoc: {} }
            • reduceOnlyIoc: {}
            • ReduceOnlyLimit: { reduceOnlyLimit: {} }
              • reduceOnlyLimit: {}
              instructions: { makeConfigureMarginfiGroupIx: ((mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; marginfiGroupPk: PublicKey }, args: { args: GroupConfig }) => Promise<TransactionInstruction>); makeDeactivateUtpIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; userTokenAtaPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeHandleBankruptcyIx: ((mfProgram: Program<MarginfiIdl>, accounts: { insuranceVaultAuthorityPk: PublicKey; insuranceVaultPk: PublicKey; liquidityVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeInitMarginfiAccountIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }) => Promise<TransactionInstruction>); makeInitMarginfiGroupIx: ((mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; feeVault: PublicKey; feeVaultAuthority: PublicKey; insuranceVault: PublicKey; insuranceVaultAuthority: PublicKey; marginfiGroupPk: PublicKey; mintPk: PublicKey }, args: { bankAuthorityPdaBump: number; feeVaultAuthorityPdaBump: number; insuranceVaultAuthorityPdaBump: number }) => Promise<TransactionInstruction>); makeLiquidateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankInsuranceVault: PublicKey; bankVault: PublicKey; marginfiAccountLiquidateePk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeUpdateInterestAccumulatorIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankFeeVault: PublicKey; bankVault: PublicKey; marginfiGroupPk: PublicKey }) => Promise<TransactionInstruction>); makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultAuthorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; receivingTokenAccount: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>) }

              Type declaration

              • makeConfigureMarginfiGroupIx: ((mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; marginfiGroupPk: PublicKey }, args: { args: GroupConfig }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; marginfiGroupPk: PublicKey }, args: { args: GroupConfig }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { adminPk: PublicKey; marginfiGroupPk: PublicKey }
                      • adminPk: PublicKey
                      • marginfiGroupPk: PublicKey
                    • args: { args: GroupConfig }
                      • args: GroupConfig

                    Returns Promise<TransactionInstruction>

              • makeDeactivateUtpIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey }
                      • authorityPk: PublicKey
                      • marginfiAccountPk: PublicKey
                    • args: { utpIndex: UtpIndex }
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; userTokenAtaPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; userTokenAtaPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; userTokenAtaPk: PublicKey }
                      • authorityPk: PublicKey
                      • bankVaultPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • userTokenAtaPk: PublicKey
                    • args: { amount: BN }
                      • amount: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeHandleBankruptcyIx: ((mfProgram: Program<MarginfiIdl>, accounts: { insuranceVaultAuthorityPk: PublicKey; insuranceVaultPk: PublicKey; liquidityVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { insuranceVaultAuthorityPk: PublicKey; insuranceVaultPk: PublicKey; liquidityVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { insuranceVaultAuthorityPk: PublicKey; insuranceVaultPk: PublicKey; liquidityVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }
                      • insuranceVaultAuthorityPk: PublicKey
                      • insuranceVaultPk: PublicKey
                      • liquidityVaultPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeInitMarginfiAccountIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authorityPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }
                      • authorityPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey

                    Returns Promise<TransactionInstruction>

              • makeInitMarginfiGroupIx: ((mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; feeVault: PublicKey; feeVaultAuthority: PublicKey; insuranceVault: PublicKey; insuranceVaultAuthority: PublicKey; marginfiGroupPk: PublicKey; mintPk: PublicKey }, args: { bankAuthorityPdaBump: number; feeVaultAuthorityPdaBump: number; insuranceVaultAuthorityPdaBump: number }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { adminPk: PublicKey; bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; feeVault: PublicKey; feeVaultAuthority: PublicKey; insuranceVault: PublicKey; insuranceVaultAuthority: PublicKey; marginfiGroupPk: PublicKey; mintPk: PublicKey }, args: { bankAuthorityPdaBump: number; feeVaultAuthorityPdaBump: number; insuranceVaultAuthorityPdaBump: number }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { adminPk: PublicKey; bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; feeVault: PublicKey; feeVaultAuthority: PublicKey; insuranceVault: PublicKey; insuranceVaultAuthority: PublicKey; marginfiGroupPk: PublicKey; mintPk: PublicKey }
                      • adminPk: PublicKey
                      • bankAuthorityPk: PublicKey
                      • bankVaultPk: PublicKey
                      • feeVault: PublicKey
                      • feeVaultAuthority: PublicKey
                      • insuranceVault: PublicKey
                      • insuranceVaultAuthority: PublicKey
                      • marginfiGroupPk: PublicKey
                      • mintPk: PublicKey
                    • args: { bankAuthorityPdaBump: number; feeVaultAuthorityPdaBump: number; insuranceVaultAuthorityPdaBump: number }
                      • bankAuthorityPdaBump: number
                      • feeVaultAuthorityPdaBump: number
                      • insuranceVaultAuthorityPdaBump: number

                    Returns Promise<TransactionInstruction>

              • makeLiquidateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankInsuranceVault: PublicKey; bankVault: PublicKey; marginfiAccountLiquidateePk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankInsuranceVault: PublicKey; bankVault: PublicKey; marginfiAccountLiquidateePk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { utpIndex: UtpIndex }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { bankAuthority: PublicKey; bankInsuranceVault: PublicKey; bankVault: PublicKey; marginfiAccountLiquidateePk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }
                      • bankAuthority: PublicKey
                      • bankInsuranceVault: PublicKey
                      • bankVault: PublicKey
                      • marginfiAccountLiquidateePk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • signerPk: PublicKey
                    • args: { utpIndex: UtpIndex }
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeUpdateInterestAccumulatorIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankFeeVault: PublicKey; bankVault: PublicKey; marginfiGroupPk: PublicKey }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; bankFeeVault: PublicKey; bankVault: PublicKey; marginfiGroupPk: PublicKey }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { bankAuthority: PublicKey; bankFeeVault: PublicKey; bankVault: PublicKey; marginfiGroupPk: PublicKey }
                      • bankAuthority: PublicKey
                      • bankFeeVault: PublicKey
                      • bankVault: PublicKey
                      • marginfiGroupPk: PublicKey

                    Returns Promise<TransactionInstruction>

              • makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultAuthorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; receivingTokenAccount: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; bankVaultAuthorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; receivingTokenAccount: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authorityPk: PublicKey; bankVaultAuthorityPk: PublicKey; bankVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; receivingTokenAccount: PublicKey }
                      • authorityPk: PublicKey
                      • bankVaultAuthorityPk: PublicKey
                      • bankVaultPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • receivingTokenAccount: PublicKey
                    • args: { amount: BN }
                      • amount: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              mangoInstructions: { makeActivateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoGroupPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey }) => Promise<TransactionInstruction>); makeCancelPerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { invalidIdOk: boolean; orderId: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; proxyTokenAccountPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makePlacePerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoCachePk: PublicKey; mangoEventQueuePk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { args: UtpMangoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultAuthorityPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }) => Promise<TransactionInstruction>) }

              Type declaration

              • makeActivateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoGroupPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authorityPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoGroupPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authorityPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoGroupPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey }
                      • authorityPk: PublicKey
                      • mangoAccountPk: PublicKey
                      • mangoAuthorityPk: PublicKey
                      • mangoGroupPk: PublicKey
                      • mangoProgramId: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                    • args: { authorityBump: number; authoritySeed: PublicKey }
                      • authorityBump: number
                      • authoritySeed: PublicKey

                    Returns Promise<TransactionInstruction>

              • makeCancelPerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { invalidIdOk: boolean; orderId: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { invalidIdOk: boolean; orderId: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }
                      • mangoAccountPk: PublicKey
                      • mangoAsksPk: PublicKey
                      • mangoAuthorityPk: PublicKey
                      • mangoBidsPk: PublicKey
                      • mangoGroupPk: PublicKey
                      • mangoPerpMarketPk: PublicKey
                      • mangoProgramId: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • signerPk: PublicKey
                    • args: { invalidIdOk: boolean; orderId: BN }
                      • invalidIdOk: boolean
                      • orderId: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; proxyTokenAccountPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; proxyTokenAccountPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { bankAuthorityPk: PublicKey; bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; proxyTokenAccountPk: PublicKey; signerPk: PublicKey }
                      • bankAuthorityPk: PublicKey
                      • bankVaultPk: PublicKey
                      • mangoAccountPk: PublicKey
                      • mangoAuthorityPk: PublicKey
                      • mangoCachePk: PublicKey
                      • mangoGroupPk: PublicKey
                      • mangoNodeBankPk: PublicKey
                      • mangoProgramId: PublicKey
                      • mangoRootBankPk: PublicKey
                      • mangoVaultPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • proxyTokenAccountPk: PublicKey
                      • signerPk: PublicKey
                    • args: { amount: BN }
                      • amount: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makePlacePerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoCachePk: PublicKey; mangoEventQueuePk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { args: UtpMangoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoCachePk: PublicKey; mangoEventQueuePk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { args: UtpMangoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { mangoAccountPk: PublicKey; mangoAsksPk: PublicKey; mangoAuthorityPk: PublicKey; mangoBidsPk: PublicKey; mangoCachePk: PublicKey; mangoEventQueuePk: PublicKey; mangoGroupPk: PublicKey; mangoPerpMarketPk: PublicKey; mangoProgramId: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }
                      • mangoAccountPk: PublicKey
                      • mangoAsksPk: PublicKey
                      • mangoAuthorityPk: PublicKey
                      • mangoBidsPk: PublicKey
                      • mangoCachePk: PublicKey
                      • mangoEventQueuePk: PublicKey
                      • mangoGroupPk: PublicKey
                      • mangoPerpMarketPk: PublicKey
                      • mangoProgramId: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • signerPk: PublicKey
                    • args: { args: UtpMangoPlacePerpOrderArgs }
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultAuthorityPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultAuthorityPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }, args: { amount: BN }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { bankVaultPk: PublicKey; mangoAccountPk: PublicKey; mangoAuthorityPk: PublicKey; mangoCachePk: PublicKey; mangoGroupPk: PublicKey; mangoNodeBankPk: PublicKey; mangoProgramId: PublicKey; mangoRootBankPk: PublicKey; mangoVaultAuthorityPk: PublicKey; mangoVaultPk: PublicKey; marginfiAccountPk: PublicKey; marginfiGroupPk: PublicKey; signerPk: PublicKey }
                      • bankVaultPk: PublicKey
                      • mangoAccountPk: PublicKey
                      • mangoAuthorityPk: PublicKey
                      • mangoCachePk: PublicKey
                      • mangoGroupPk: PublicKey
                      • mangoNodeBankPk: PublicKey
                      • mangoProgramId: PublicKey
                      • mangoRootBankPk: PublicKey
                      • mangoVaultAuthorityPk: PublicKey
                      • mangoVaultPk: PublicKey
                      • marginfiAccountPk: PublicKey
                      • marginfiGroupPk: PublicKey
                      • signerPk: PublicKey
                    • args: { amount: BN }
                      • amount: BN

                    Returns Promise<TransactionInstruction>

              zoInstructions: { makeActivateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authority: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey; zoMarginNonce: number }) => Promise<TransactionInstruction>); makeCancelPerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { clientId?: BN; isLong?: boolean; orderId?: BN }, remainingAccounts: AccountMeta[]) => Promise<TransactionInstruction>); makeCreatePerpOpenOrdersIx: ((mfProgram: Program<MarginfiIdl>, accounts: { marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoDexMarket: PublicKey; zoDexProgram: PublicKey; zoMargin: PublicKey; zoOpenOrders: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey }) => Promise<TransactionInstruction>); makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; tempCollateralAccount: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makePlacePerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; reqQ: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { args: UtpZoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>); makeSettleFundsIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }) => Promise<TransactionInstruction>); makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { heimdall: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>) }

              Type declaration

              • makeActivateIx: ((mfProgram: Program<MarginfiIdl>, accounts: { authority: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey; zoMarginNonce: number }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { authority: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey }, args: { authorityBump: number; authoritySeed: PublicKey; zoMarginNonce: number }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { authority: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey }
                      • authority: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • utpAuthority: PublicKey
                      • zoControl: PublicKey
                      • zoMargin: PublicKey
                      • zoProgram: PublicKey
                      • zoState: PublicKey
                    • args: { authorityBump: number; authoritySeed: PublicKey; zoMarginNonce: number }
                      • authorityBump: number
                      • authoritySeed: PublicKey
                      • zoMarginNonce: number

                    Returns Promise<TransactionInstruction>

              • makeCancelPerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { clientId?: BN; isLong?: boolean; orderId?: BN }, remainingAccounts: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { clientId?: BN; isLong?: boolean; orderId?: BN }, remainingAccounts: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }
                      • cache: PublicKey
                      • control: PublicKey
                      • dexMarket: PublicKey
                      • dexProgram: PublicKey
                      • eventQ: PublicKey
                      • margin: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • marketAsks: PublicKey
                      • marketBids: PublicKey
                      • openOrders: PublicKey
                      • signer: PublicKey
                      • state: PublicKey
                      • utpAuthority: PublicKey
                      • zoProgram: PublicKey
                    • args: { clientId?: BN; isLong?: boolean; orderId?: BN }
                      • Optional clientId?: BN
                      • Optional isLong?: boolean
                      • Optional orderId?: BN
                    • remainingAccounts: AccountMeta[]

                    Returns Promise<TransactionInstruction>

              • makeCreatePerpOpenOrdersIx: ((mfProgram: Program<MarginfiIdl>, accounts: { marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoDexMarket: PublicKey; zoDexProgram: PublicKey; zoMargin: PublicKey; zoOpenOrders: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoDexMarket: PublicKey; zoDexProgram: PublicKey; zoMargin: PublicKey; zoOpenOrders: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoControl: PublicKey; zoDexMarket: PublicKey; zoDexProgram: PublicKey; zoMargin: PublicKey; zoOpenOrders: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey }
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • signer: PublicKey
                      • utpAuthority: PublicKey
                      • zoControl: PublicKey
                      • zoDexMarket: PublicKey
                      • zoDexProgram: PublicKey
                      • zoMargin: PublicKey
                      • zoOpenOrders: PublicKey
                      • zoProgram: PublicKey
                      • zoState: PublicKey
                      • zoStateSigner: PublicKey

                    Returns Promise<TransactionInstruction>

              • makeDepositIx: ((mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; tempCollateralAccount: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { bankAuthority: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; tempCollateralAccount: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { bankAuthority: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; tempCollateralAccount: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }
                      • bankAuthority: PublicKey
                      • marginCollateralVault: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • signer: PublicKey
                      • tempCollateralAccount: PublicKey
                      • utpAuthority: PublicKey
                      • zoCache: PublicKey
                      • zoMargin: PublicKey
                      • zoProgram: PublicKey
                      • zoState: PublicKey
                      • zoStateSigner: PublicKey
                      • zoVault: PublicKey
                    • args: { amount: BN }
                      • amount: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makePlacePerpOrderIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; reqQ: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { args: UtpZoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; reqQ: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }, args: { args: UtpZoPlacePerpOrderArgs }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; eventQ: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; marketAsks: PublicKey; marketBids: PublicKey; openOrders: PublicKey; reqQ: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }
                      • cache: PublicKey
                      • control: PublicKey
                      • dexMarket: PublicKey
                      • dexProgram: PublicKey
                      • eventQ: PublicKey
                      • margin: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • marketAsks: PublicKey
                      • marketBids: PublicKey
                      • openOrders: PublicKey
                      • reqQ: PublicKey
                      • signer: PublicKey
                      • state: PublicKey
                      • stateSigner: PublicKey
                      • utpAuthority: PublicKey
                      • zoProgram: PublicKey
                    • args: { args: UtpZoPlacePerpOrderArgs }
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              • makeSettleFundsIx: ((mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { cache: PublicKey; control: PublicKey; dexMarket: PublicKey; dexProgram: PublicKey; margin: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; openOrders: PublicKey; signer: PublicKey; state: PublicKey; stateSigner: PublicKey; utpAuthority: PublicKey; zoProgram: PublicKey }
                      • cache: PublicKey
                      • control: PublicKey
                      • dexMarket: PublicKey
                      • dexProgram: PublicKey
                      • margin: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • openOrders: PublicKey
                      • signer: PublicKey
                      • state: PublicKey
                      • stateSigner: PublicKey
                      • utpAuthority: PublicKey
                      • zoProgram: PublicKey

                    Returns Promise<TransactionInstruction>

              • makeWithdrawIx: ((mfProgram: Program<MarginfiIdl>, accounts: { heimdall: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]) => Promise<TransactionInstruction>)
                  • (mfProgram: Program<MarginfiIdl>, accounts: { heimdall: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }, args: { amount: BN }, remainingAccounts?: AccountMeta[]): Promise<TransactionInstruction>
                  • Parameters

                    • mfProgram: Program<MarginfiIdl>
                    • accounts: { heimdall: PublicKey; marginCollateralVault: PublicKey; marginfiAccount: PublicKey; marginfiGroup: PublicKey; signer: PublicKey; utpAuthority: PublicKey; zoCache: PublicKey; zoControl: PublicKey; zoMargin: PublicKey; zoProgram: PublicKey; zoState: PublicKey; zoStateSigner: PublicKey; zoVault: PublicKey }
                      • heimdall: PublicKey
                      • marginCollateralVault: PublicKey
                      • marginfiAccount: PublicKey
                      • marginfiGroup: PublicKey
                      • signer: PublicKey
                      • utpAuthority: PublicKey
                      • zoCache: PublicKey
                      • zoControl: PublicKey
                      • zoMargin: PublicKey
                      • zoProgram: PublicKey
                      • zoState: PublicKey
                      • zoStateSigner: PublicKey
                      • zoVault: PublicKey
                    • args: { amount: BN }
                      • amount: BN
                    • remainingAccounts: AccountMeta[] = []

                    Returns Promise<TransactionInstruction>

              Functions

              • getBankAuthority(marginfiGroupPk: PublicKey, programId: PublicKey, bankVaultType?: BankVaultType): Promise<[PublicKey, number]>
              • Compute bank authority PDA for a specific marginfi group

                Parameters

                • marginfiGroupPk: PublicKey
                • programId: PublicKey
                • bankVaultType: BankVaultType = BankVaultType.LiquidityVault

                Returns Promise<[PublicKey, number]>

              • getMfiProgram(programAddress: PublicKey, connection: Connection, wallet: Wallet): Program<MarginfiIdl>
              • getUtpAuthority(utpProgramId: PublicKey, authoritySeed: PublicKey, programId: PublicKey): Promise<[PublicKey, number]>
              • Compute UTP account authority PDA

                Parameters

                • utpProgramId: PublicKey
                • authoritySeed: PublicKey
                • programId: PublicKey

                Returns Promise<[PublicKey, number]>

              • loadKeypair(keypairPath: string): Keypair
              • Load Keypair from the provided file.

                Parameters

                • keypairPath: string

                Returns Keypair

              • nativetoUi(amount: BN | UiAmount, decimals?: number): number
              • Converts a native representation of a token amount into its UI value as number, given the specified mint decimal amount (default to 6 for USDC).

                Parameters

                • amount: BN | UiAmount
                • decimals: number = COLLATERAL_DECIMALS

                Returns number

              • processTransaction(provider: default, tx: Transaction, signers?: Signer[], opts?: ConfirmOptions): Promise<TransactionSignature>
              • Transaction processing and error-handling helper.

                Parameters

                • provider: default
                • tx: Transaction
                • Optional signers: Signer[]
                • Optional opts: ConfirmOptions

                Returns Promise<TransactionSignature>

              • toBigNumber(amount: BN | UiAmount): BigNumber
              • Converts a ui representation of a token amount into its native value as BN, given the specified mint decimal amount (default to 6 for USDC).

                Parameters

                Returns BigNumber

              • Converts a ui representation of a token amount into its native value as BN, given the specified mint decimal amount (default to 6 for USDC).

                Parameters

                Returns number

              • uiToNative(amount: UiAmount, decimals?: number): BN
              • Converts a UI representation of a token amount into its native value as BN, given the specified mint decimal amount (default to 6 for USDC).

                Parameters

                • amount: UiAmount
                • decimals: number = COLLATERAL_DECIMALS

                Returns BN

              • wrappedI80F48toBigNumber(__namedParameters: { bits: BN }, scaleDecimal?: number): BigNumber
              • Parameters

                • __namedParameters: { bits: BN }
                  • bits: BN
                • scaleDecimal: number = 6

                Returns BigNumber

              Generated using TypeDoc