Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • OpenbookV2Market

Index

Constructors

  • new OpenbookV2Market(publicKey: PublicKey, group: PublicKey, baseTokenIndex: TokenIndex, quoteTokenIndex: TokenIndex, name: number[], openbookProgram: PublicKey, openbookMarketExternal: PublicKey, marketIndex: OpenbookV2MarketIndex, registrationTime: BN, reduceOnly: boolean, forceClose: boolean): OpenbookV2Market

Properties

baseTokenIndex: TokenIndex
forceClose: boolean
group: PublicKey
name: string
openbookMarketExternal: PublicKey
openbookProgram: PublicKey
publicKey: PublicKey
quoteTokenIndex: TokenIndex
reduceOnly: boolean
registrationTime: BN

Methods

  • computePriceForMarketOrderOfSize(client: MangoClient, group: Group, size: number, side: "buy" | "sell"): Promise<number>
  • findOoIndexerPda(programId: PublicKey, mangoAccount: PublicKey): PublicKey
  • findOoPda(programId: PublicKey, mangoAccount: PublicKey, index: number): PublicKey
  • getFeeRates(taker?: boolean): number
  • getL2(client: MangoClient, marketAccount: DecodeStruct<{ fields: [{ docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { name: "quoteDecimals"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>, bidsAccount?: DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>, asksAccount?: DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>): [number, number][]
  • Parameters

    • client: MangoClient
    • marketAccount: DecodeStruct<{ fields: [{ docs: ["PDA bump"]; name: "bump"; type: "u8" }, { docs: ["Number of decimals used for the base token.", "", "Used to convert the oracle's price into a native/native price."]; name: "baseDecimals"; type: "u8" }, { name: "quoteDecimals"; type: "u8" }, { name: "padding1"; type: { array: ["u8", 5] } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>
    • Optional bidsAccount: DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>
    • Optional asksAccount: DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>

    Returns [number, number][]

  • getNextOoPda(client: MangoClient, programId: PublicKey, mangoAccount: PublicKey): Promise<PublicKey>
  • loadAsks(client: MangoClient, group: Group): Promise<DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>>
  • Parameters

    Returns Promise<DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>>

  • loadBids(client: MangoClient, group: Group): Promise<DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>>
  • Parameters

    Returns Promise<DecodeStruct<{ fields: [{ name: "roots"; type: { array: [{ defined: "OrderTreeRoot" }, 2] } }, { name: "reservedRoots"; type: { array: [{ defined: "OrderTreeRoot" }, 4] } }, { name: "reserved"; type: { array: ["u8", 256] } }, { name: "nodes"; type: { defined: "OrderTreeNodes" } }]; kind: "struct" }, DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], DecodedHelper<[{ docs: ["Like `Option`, but implemented for `Pubkey` to be used with `zero_copy`"]; name: "NonZeroPubkeyOption"; type: { fields: [{ name: "key"; type: "publicKey" }]; kind: "struct" } }, { name: "Position"; type: { fields: [{ docs: ["Base lots in open bids"]; name: "bidsBaseLots"; type: "i64" }, { docs: ["Base lots in open asks"]; name: "asksBaseLots"; type: "i64" }, { name: "baseFreeNative"; type: "u64" }, { name: "quoteFreeNative"; type: "u64" }, { name: "lockedMakerFees"; type: "u64" }]; kind: "struct" } }, { name: "OpenOrder"; type: { fields: [{ name: "id"; type: "u128" }, { name: "clientId"; type: "u64" }, { docs: ["Price at which user's assets were locked"]; name: "lockedPrice"; type: "i64" }, { name: "isFree"; type: "u8" }, { name: "sideAndTree"; type: "u8" }, { name: "padding"; type: { array: ["u8", 6] } }]; kind: "struct" } }], EmptyDefined>>>>

  • maxAskLeverage(group: Group): number
  • Parameters

    Returns number

    maximum leverage one can ask on this market, this is only for display purposes, also see getMaxQuoteForOpenbookV2BidUi and getMaxBaseForOpenbookV2AskUi

  • maxBidLeverage(group: Group): number
  • Parameters

    Returns number

    maximum leverage one can bid on this market, this is only for display purposes, also see getMaxQuoteForOpenbookV2BidUi and getMaxBaseForOpenbookV2AskUi

  • from(publicKey: PublicKey, obj: { baseTokenIndex: number; forceClose: number; group: PublicKey; marketIndex: number; name: number[]; openbookV2MarketExternal: PublicKey; openbookV2Program: PublicKey; quoteTokenIndex: number; reduceOnly: number; registrationTime: BN }): OpenbookV2Market
  • Parameters

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

    Returns OpenbookV2Market

Generated using TypeDoc