Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • burnWriterForQuote(program: Program<PsyAmerican>, size: BN, optionMarket: OptionMarketWithKey, writerTokenSrc: PublicKey, writerQuoteDest: PublicKey): TransactionInstruction
  • Burn WriterTokens to get the size * OptionMarket.quoteAmountPerContract from the OptionMarket's quote asset pool. This instruction will fail if no one has exercised or the quote assets in the pool have already been claimed.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • size: BN

      The amount of WriterTokens to burn and retrieve the quote assets for

    • optionMarket: OptionMarketWithKey

      The deserialized OptionMarket data

    • writerTokenSrc: PublicKey

      The SPL Token account that holds the WriterTokens

    • writerQuoteDest: PublicKey

      SPL Token account that is the destination for the quote assets

    Returns TransactionInstruction

  • closePositionInstruction(program: Program<PsyAmerican>, size: BN, optionMarket: OptionMarketWithKey, writerTokenSrc: PublicKey, optionTokenSrc: PublicKey, underlyingAssetDest: PublicKey): TransactionInstruction
  • Close size option positions by burning the OptionTokens and WriterTokens.

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • size: BN

      The amount of OptionTokens and WriterTokens to burn

    • optionMarket: OptionMarketWithKey

      The OptionMarket the OptionTokens and WriterTokens belong to

    • writerTokenSrc: PublicKey

      The SPL Token address that holds the WriterTokens

    • optionTokenSrc: PublicKey

      The SPL Token address that holds the OptionTokens

    • underlyingAssetDest: PublicKey

      The SPL Token address destination for the returned underlying assets

    Returns TransactionInstruction

  • closePostExpirationInstruction(program: Program<PsyAmerican>, size: BN, optionMarket: OptionMarketWithKey, writerTokenSrc: PublicKey, underlyingAssetDest: PublicKey): TransactionInstruction
  • exerciseOptionsInstruction(program: Program<PsyAmerican>, size: BN, optionMarket: OptionMarketWithKey, exerciserOptionTokenSrc: PublicKey, underlyingAssetDest: PublicKey, quoteAssetSrc: PublicKey, opts?: { optionAuthority?: PublicKey }): Promise<TransactionInstruction>
  • Exercise OptionTokens you're holding

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • size: BN

      The amount of options to exercise

    • optionMarket: OptionMarketWithKey

      The OptionMarket data from the chain for the options to exercise

    • exerciserOptionTokenSrc: PublicKey

      The SPL Token address holding the OptionTokens

    • underlyingAssetDest: PublicKey

      The SPL Token address where the underlying assets will be sent

    • quoteAssetSrc: PublicKey

      The SPL Token address holding the quote asset used to exercise

    • opts: { optionAuthority?: PublicKey } = {}
      • Optional optionAuthority?: PublicKey

        The authority account that owns the options

    Returns Promise<TransactionInstruction>

  • exerciseOptionsV2Instruction(program: Program<PsyAmerican>, size: BN, optionMarket: OptionMarketWithKey, exerciserOptionTokenSrc: PublicKey, underlyingAssetDest: PublicKey, quoteAssetSrc: PublicKey, opts?: { optionAuthority?: PublicKey }): TransactionInstruction
  • Exercise OptionTokens you're holding without fees!

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for Psy American

    • size: BN

      The amount of options to exercise

    • optionMarket: OptionMarketWithKey

      The OptionMarket data from the chain for the options to exercise

    • exerciserOptionTokenSrc: PublicKey

      The SPL Token address holding the OptionTokens

    • underlyingAssetDest: PublicKey

      The SPL Token address where the underlying assets will be sent

    • quoteAssetSrc: PublicKey

      The SPL Token address holding the quote asset used to exercise

    • opts: { optionAuthority?: PublicKey } = {}
      • Optional optionAuthority?: PublicKey

        The authority account that owns the options

    Returns TransactionInstruction

  • initializeMarket(program: Program<PsyAmerican>, __namedParameters: { expirationUnixTimestamp: BN; quoteAmountPerContract: BN; quoteMint: PublicKey; underlyingAmountPerContract: BN; underlyingMint: PublicKey }): Promise<{ optionMarketKey: PublicKey; optionMintKey: PublicKey; quoteAssetPoolKey: PublicKey; tx: string; underlyingAssetPoolKey: PublicKey; writerMintKey: PublicKey }>
  • Initialize a new OptionMarket

    Parameters

    • program: Program<PsyAmerican>

      The Psy American program

    • __namedParameters: { expirationUnixTimestamp: BN; quoteAmountPerContract: BN; quoteMint: PublicKey; underlyingAmountPerContract: BN; underlyingMint: PublicKey }
      • expirationUnixTimestamp: BN

        The option market expiration timestamp in seconds

      • quoteAmountPerContract: BN

        The quote amount per contract for the OptionMarket Strike price is derived from underlyingAmountPerContract & quoteAmountPerContract

      • quoteMint: PublicKey

        The quote asset mint

      • underlyingAmountPerContract: BN

        The underlying amount per contract for the OptionMarket. * Strike price is derived from underlyingAmountPerContract & quoteAmountPerContract

      • underlyingMint: PublicKey

        The underlying mint address

    Returns Promise<{ optionMarketKey: PublicKey; optionMintKey: PublicKey; quoteAssetPoolKey: PublicKey; tx: string; underlyingAssetPoolKey: PublicKey; writerMintKey: PublicKey }>

  • initializeSerumMarket(program: Program<PsyAmerican>, param1: { asks?: PublicKey; bids?: PublicKey; eventQueue?: PublicKey; optionMarketKey: PublicKey; optionMint: PublicKey; pcDustThreshold: BN; pcLotSize: BN; pcMint: PublicKey; serumProgramKey: PublicKey }): Promise<{ marketAuthority: PublicKey; serumMarketKey: PublicKey; tx: string }>
  • Parameters

    • program: Program<PsyAmerican>

      Anchor Psy American Program

    • param1: { asks?: PublicKey; bids?: PublicKey; eventQueue?: PublicKey; optionMarketKey: PublicKey; optionMint: PublicKey; pcDustThreshold: BN; pcLotSize: BN; pcMint: PublicKey; serumProgramKey: PublicKey }
      • Optional asks?: PublicKey

        The address for the new Serum market's asks

      • Optional bids?: PublicKey

        The address for the new Serum market's bids

      • Optional eventQueue?: PublicKey

        The address for the new Serum market's eventual Event Queue

      • optionMarketKey: PublicKey

        The OptionMarket address that owns the OptionToken mint

      • optionMint: PublicKey

        The OptionToken's Mint address. This is the base token for the Serum market

      • pcDustThreshold: BN

        Serum market's dust threshold for the price currency

      • pcLotSize: BN

        Serum market's price currency lot size

      • pcMint: PublicKey

        The Serum's price currency mint

      • serumProgramKey: PublicKey

        The Serum DEX program ID

    Returns Promise<{ marketAuthority: PublicKey; serumMarketKey: PublicKey; tx: string }>

  • mintOptionInstruction(program: Program<PsyAmerican>, minterOptionAcct: PublicKey, minterWriterAcct: PublicKey, minterUnderlyingAccount: PublicKey, size: BN, optionMarket: OptionMarketWithKey): Promise<{ ix: TransactionInstruction; signers: Signer[] }>
  • Create a TransactionInstruction for minting size option contracts

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for the PsyAmerican program and the minter as the provider wallet

    • minterOptionAcct: PublicKey

      Where the OptionTokens will be sent

    • minterWriterAcct: PublicKey

      Where the WriterTokens will be sent

    • minterUnderlyingAccount: PublicKey

      Where the underlying asset tokens come from

    • size: BN

      The amount of contracts to mint

    • optionMarket: OptionMarketWithKey

      The OptionMarket data

    Returns Promise<{ ix: TransactionInstruction; signers: Signer[] }>

  • mintOptionV2Instruction(program: Program<PsyAmerican>, minterOptionAcct: PublicKey, minterWriterAcct: PublicKey, minterUnderlyingAccount: PublicKey, size: BN, optionMarket: OptionMarketWithKey): Promise<{ ix: TransactionInstruction; signers: Signer[] }>
  • Create a TransactionInstruction for minting size option contracts using V2 instruction

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for the PsyAmerican program and the minter as the provider wallet

    • minterOptionAcct: PublicKey

      Where the OptionTokens will be sent

    • minterWriterAcct: PublicKey

      Where the WriterTokens will be sent

    • minterUnderlyingAccount: PublicKey

      Where the underlying asset tokens come from

    • size: BN

      The amount of contracts to mint

    • optionMarket: OptionMarketWithKey

      The OptionMarket data

    Returns Promise<{ ix: TransactionInstruction; signers: Signer[] }>

  • mintOptionsTx(program: Program<PsyAmerican>, minterOptionAcct: PublicKey, minterWriterAcct: PublicKey, minterUnderlyingAccount: PublicKey, size: BN, optionMarket: OptionMarketWithKey): Promise<{ tx: string }>
  • Execute a transaction to mint size options

    Parameters

    • program: Program<PsyAmerican>

      Anchor Program for the PsyAmerican program and the minter as the provider wallet

    • minterOptionAcct: PublicKey

      Where the OptionTokens will be sent

    • minterWriterAcct: PublicKey

      Where the WriterTokens will be sent

    • minterUnderlyingAccount: PublicKey

      Where the underlying asset tokens come from

    • size: BN

      The amount of contracts to mint

    • optionMarket: OptionMarketWithKey

      The OptionMarket data

    Returns Promise<{ tx: string }>

Generated using TypeDoc