Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • cancelAllOpenOrders(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey): Promise<TransactionInstruction[]>
  • Create an array of TransactionInstructions to cancel all of the wallet's orders for a given OptionMarket and SerumMarket.

    NOTE: Current implementation does not account for Transaction packet size limitations. It is on the client to slice the instructions to be within the limits.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • optionMarketKey: PublicKey

      The address of the OptionMarket for the option in the Seurm Market

    • dexProgramId: PublicKey

      The PublicKey of the DEX program

    • serumMarketKey: PublicKey

      The PublicKey of the Serum market

    Returns Promise<TransactionInstruction[]>

  • cancelOrderByClientId(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, order: Order, marketAuthorityBump?: number): Promise<TransactionInstruction>
  • Generate a TransactionInstruction for canceling an open order by the set clientId

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • optionMarketKey: PublicKey

      The address of the OptionMarket for the option in the Seurm Market

    • dexProgramId: PublicKey

      The PublicKey of the DEX program

    • serumMarketKey: PublicKey

      The PublicKey of the Serum market

    • order: Order

      The Serum Order to cancel

    • marketAuthorityBump: number = undefined

      Optional: bump seed for the Serum market

    Returns Promise<TransactionInstruction>

  • cancelOrderInstructionV2(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, order: Order, marketAuthorityBump?: number): Promise<TransactionInstruction>
  • Create a TransactionInstruction for canceling a specific order

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • optionMarketKey: PublicKey

      The address of the OptionMarket for the option in the Seurm Market

    • dexProgramId: PublicKey

      The PublicKey of the DEX program

    • serumMarketKey: PublicKey

      The PublicKey of the Serum market

    • order: Order

      The Serum Order to cancel

    • marketAuthorityBump: number = undefined

      Optional: bump seed for the Serum market

    Returns Promise<TransactionInstruction>

  • closeOpenOrdersInstruction(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, openOrdersKey: PublicKey, marketAuthorityBump: number, solWallet?: PublicKey): Promise<TransactionInstruction>
  • Create instruction to close OpenOrders account.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Psy American Program

    • optionMarketKey: PublicKey

      The OptionMarket address

    • dexProgramId: PublicKey

      The Serum DEX program ID

    • serumMarketKey: PublicKey

      The Serum market address

    • openOrdersKey: PublicKey

      The open orders key for the account we're closing

    • marketAuthorityBump: number

      OPTIONAL: pass in the market authority bump seed

    • Optional solWallet: PublicKey

      OPTIONAL: pass in a different address to send the unlocked Sol to

    Returns Promise<TransactionInstruction>

  • initOpenOrdersInstruction(program: Program<PsyAmerican>, owner: PublicKey, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, marketAuthorityBump?: number): Promise<{ ix: TransactionInstruction }>
  • marketLoader(program: Program<PsyAmerican>, optionMarketKey: PublicKey, marketAuthorityBump: number, dexProgramId: PublicKey, marketKey: PublicKey, opts?: { enableLogger: boolean }): Promise<MarketProxy>
  • newOrderInstruction(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, orderArguments: OrderParamsWithFeeRate<PublicKey>, marketAuthorityBump?: number): Promise<{ openOrdersKey: PublicKey; tx: Transaction }>
  • settleFundsInstruction(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarketKey: PublicKey, baseWallet: PublicKey, quoteWallet: PublicKey, serumReferralKey: PublicKey, openOrdersKey: PublicKey, marketAuthorityBump?: number): Promise<TransactionInstruction>
  • Create a TransactionInstruction for the settleFunds instruction

    Parameters

    • program: Program<PsyAmerican>

      Anchor Psy American Program

    • optionMarketKey: PublicKey

      The OptionMarket address

    • dexProgramId: PublicKey

      The Serum DEX program ID

    • serumMarketKey: PublicKey

      The Serum market address

    • baseWallet: PublicKey

      The wallet address that contains the user's base asset tokens

    • quoteWallet: PublicKey

      The wallet address that contains the user's quote asset tokens

    • serumReferralKey: PublicKey

      The Psy American referral address for the quote asset

    • openOrdersKey: PublicKey

      The open orders keys

    • marketAuthorityBump: number = undefined

      OPTIONAL: pass in the market authority bump seed

    Returns Promise<TransactionInstruction>

  • settleMarketFundsInstruction(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, serumMarket: Market, baseWallet: PublicKey, quoteWallet: PublicKey, openOrdersKey: PublicKey): Promise<TransactionInstruction>
  • Create a TransactionInstruction for the settleFunds instruction

    Note: this API abstracts the complexity of the serumReferralKey away.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Psy American Program

    • optionMarketKey: PublicKey

      The OptionMarket address

    • dexProgramId: PublicKey

      The Serum DEX program ID

    • serumMarket: Market

      The Serum market

    • baseWallet: PublicKey

      The wallet address that contains the user's base asset tokens

    • quoteWallet: PublicKey

      The wallet address that contains the user's quote asset tokens

    • openOrdersKey: PublicKey

      The open orders keys

    Returns Promise<TransactionInstruction>

Generated using TypeDoc