Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • closeOptionsInstruction(program: Program<EuroPrimitive>, euroMetaKey: PublicKey, euroMeta: EuroMeta, collateralDestination: PublicKey, optionSource: PublicKey, writerSource: PublicKey, amount: BN, optionType: OptionType): Promise<{ instruction: TransactionInstruction }>
  • Close options by burning a option and writer tokens. This instruction can be used to retrieve the underlying from the option before or after expiration.

    Parameters

    • program: Program<EuroPrimitive>

      Tokenized Euros anchor Program

    • euroMetaKey: PublicKey

      address for the EuroMeta data structure

    • euroMeta: EuroMeta

      The deserialized EuroMeta data

    • collateralDestination: PublicKey

      Where the underlying collateral of the option should be returned

    • optionSource: PublicKey

      The TokenAccount that holds the option tokens

    • writerSource: PublicKey

      The TokenAccount that holds the writer tokens

    • amount: BN

      The amount of options to close

    • optionType: OptionType

      Whether the option is a CALL or a PUT.

    Returns Promise<{ instruction: TransactionInstruction }>

  • createEuroMeta(program: Program<EuroPrimitive>, euroMetaKey: PublicKey, expirationDataKey: PublicKey, euroMeta: EuroMeta, expirationDataBump: number): TransactionInstruction
  • createEuroMetaInstruction(program: Program<EuroPrimitive>, underlyingMint: PublicKey, underlyingDecimals: number, stableMint: PublicKey, stableDecimals: number, expiration: BN, underlyingAmountPerContract: BN, strikePrice: BN, priceDecimals: number, pythOracle: PublicKey): Promise<{ euroMeta: EuroMeta; euroMetaKey: PublicKey; expirationData: ExpirationData; expirationDataKey: PublicKey; instruction: TransactionInstruction }>
  • initExpirationData(program: Program<EuroPrimitive>, underlyingMint: PublicKey, expiration: BN, pythOracleAddress: PublicKey, priceDecimals: number): Promise<{ instruction: TransactionInstruction }>
  • initializeAllAccountsInstructions(program: Program<EuroPrimitive>, underlyingMint: PublicKey, stableMint: PublicKey, pythOracleAddress: PublicKey, expiration: BN, priceDecimals: number): Promise<{ instructions: TransactionInstruction[] }>
  • initializeStablePool(program: Program<EuroPrimitive>, stableMint: PublicKey): Promise<{ instruction: TransactionInstruction }>
  • initializeUnderlyingPool(program: Program<EuroPrimitive>, underlyingMint: PublicKey): Promise<{ instruction: TransactionInstruction }>
  • initializeUnderlyingPoolIx(program: Program<EuroPrimitive>, underlyingMint: PublicKey, poolAuthority: PublicKey, underlyingPool: PublicKey): TransactionInstruction
  • mintOptions(program: Program<EuroPrimitive>, euroMetaKey: PublicKey, euroMeta: EuroMeta, minterCollateralKey: PublicKey, optionDestination: PublicKey, writerDestination: PublicKey, amount: BN, optionType: OptionType): { instruction: TransactionInstruction }
  • Generate an instruction to take collateral and mint options.

    Parameters

    • program: Program<EuroPrimitive>

      The Tokenized Euros anchor program

    • euroMetaKey: PublicKey

      The address for the EuroMeta data

    • euroMeta: EuroMeta

      The deserialized EuroMeta data

    • minterCollateralKey: PublicKey

      The address of the TokenAccount that holds the collateral for the option

    • optionDestination: PublicKey

      The address of the TokenAccount where minted option tokens will be transferred to.

    • writerDestination: PublicKey

      The address of the TokenAccount where minted writer tokens will be transferred to.

    • amount: BN

      The amount of options to mint

    • optionType: OptionType

      CALL or PUT options

    Returns { instruction: TransactionInstruction }

    • instruction: TransactionInstruction
  • setExpirationPriceInstruction(program: Program<EuroPrimitive>, expirationDataKey: PublicKey, expirationData: ExpirationData): { instruction: TransactionInstruction }
  • settleExpiredOptionsInstruction(program: Program<EuroPrimitive>, euroMetaKey: PublicKey, euroMeta: EuroMeta, collateralDestination: PublicKey, optionSource: PublicKey, amount: BN, optionType: OptionType): Promise<{ instruction: TransactionInstruction }>
  • After the option's have expired option holders need to settle the options to get their payoff. This instruction will burn option tokens and return the cash payout in the underlying asset.

    Parameters

    • program: Program<EuroPrimitive>

      The Tokenized Euros anchor program

    • euroMetaKey: PublicKey

      The address for the EuroMeta data

    • euroMeta: EuroMeta

      The deserialized EuroMeta data

    • collateralDestination: PublicKey

      The TokenAccount where the payout will be sent

    • optionSource: PublicKey

      The TokenAccount that holds the options to burn

    • amount: BN

      The amount of options to settle

    • optionType: OptionType

      CALL or PUT

    Returns Promise<{ instruction: TransactionInstruction }>

  • settleExpiredWritersInstruction(program: Program<EuroPrimitive>, euroMetaKey: PublicKey, euroMeta: EuroMeta, collateralDestination: PublicKey, writerSource: PublicKey, amount: BN, optionType: OptionType): Promise<{ instruction: TransactionInstruction }>
  • After the option's have expired writer token holders need to settle the writer tokens to unlock their underlying collateral. This instruction will burn writer tokens and return the colletaral less the pay out for the option holder.

    Parameters

    • program: Program<EuroPrimitive>

      The Tokenized Euros anchor program

    • euroMetaKey: PublicKey

      The address for the EuroMeta data

    • euroMeta: EuroMeta

      The deserialized EuroMeta data

    • collateralDestination: PublicKey

      The TokenAccount where the payout will be sent

    • writerSource: PublicKey

      The TokenAccount that holds the writer tokens to settle

    • amount: BN

      The amount of writer tokens to settle

    • optionType: OptionType

      CALL or PUT

    Returns Promise<{ instruction: TransactionInstruction }>

Generated using TypeDoc