Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • deriveCoinVault(program: Program<PsyAmerican>, optionMarketKey: PublicKey, priceCurrencyKey: PublicKey): Promise<[PublicKey, number]>
  • deriveMarketAuthority(program: Program<PsyAmerican>, dexProgramId: PublicKey, serumMarketKey: PublicKey): Promise<[PublicKey, number]>
  • derivePCVault(program: Program<PsyAmerican>, optionMarketKey: PublicKey, priceCurrencyKey: PublicKey): Promise<[PublicKey, number]>
  • deriveRequestQueue(program: Program<PsyAmerican>, optionMarketKey: PublicKey, priceCurrencyKey: PublicKey): Promise<[PublicKey, number]>
  • deriveSerumMarketAddress(program: Program<PsyAmerican>, optionMarketKey: PublicKey, priceCurrencyKey: PublicKey): Promise<[PublicKey, number]>
  • findOpenOrdersAccountsForOwner(program: Program<PsyAmerican>, dexProgramId: PublicKey, serumMarketAddress: PublicKey): Promise<OpenOrders[]>
  • findOpenOrdersForOptionMarkets(program: Program<PsyAmerican>, serumProgramId: PublicKey, optionMarketKeys: PublicKey[], priceCurrencyKey: PublicKey, optionMetaList?: { expiration: number; optionContractMintAddress: string; optionMarketAddress: string; optionWriterTokenMintAddress: string; psyOptionsProgramId: string; quoteAssetMint: string; quoteAssetPerContract: string; quoteAssetPoolAddress: string; serumMarketAddress: string; serumProgramId: string; underlyingAssetMint: string; underlyingAssetPerContract: string; underlyingAssetPoolAddress: string }[]): Promise<Record<string, OpenOrders>>
  • Load all the open orders for a user based on the Serum DEX and the option market keys.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Psy American program

    • serumProgramId: PublicKey

      Serum DEX program id

    • optionMarketKeys: PublicKey[]

      Keys for the Psy American OptionMarket's to load the open orders from

    • priceCurrencyKey: PublicKey

      Key of the pc (aka quote currency) from the serum markets

    • Optional optionMetaList: { expiration: number; optionContractMintAddress: string; optionMarketAddress: string; optionWriterTokenMintAddress: string; psyOptionsProgramId: string; quoteAssetMint: string; quoteAssetPerContract: string; quoteAssetPoolAddress: string; serumMarketAddress: string; serumProgramId: string; underlyingAssetMint: string; underlyingAssetPerContract: string; underlyingAssetPoolAddress: string }[]

      Optional list of option meta data to pull serum market data from instead of deriving the address. This is for backwards compatibility

    Returns Promise<Record<string, OpenOrders>>

  • getMarketAndAuthorityInfo(program: Program<PsyAmerican>, optionMarketKey: PublicKey, dexProgramId: PublicKey, priceCurrencyKey: PublicKey): Promise<{ marketAuthority: PublicKey; marketAuthorityBump: number; serumMarketKey: PublicKey }>
  • Given an OptionMarket address and DEX program, generate the Serum market key, market authority, and authority bump seed.

    Parameters

    • program: Program<PsyAmerican>

      PsyOptions American V1 Anchor program

    • optionMarketKey: PublicKey

      The key for the OptionMarket

    • dexProgramId: PublicKey

      Serum DEX public key

    • priceCurrencyKey: PublicKey

    Returns Promise<{ marketAuthority: PublicKey; marketAuthorityBump: number; serumMarketKey: PublicKey }>

Generated using TypeDoc