Class OptionPSAPI

Represents a class for handling pool operations related to the voidnode server and the pool contracts.

Hierarchy

  • BaseAPI
    • OptionPSAPI

Constructors

Properties

premia: Premia

The Premia SDK instance.

streamIndex: number = 0

The current index of quote streams. Used to cancel stale streams.

Methods

  • Cancels all ongoing streams.

    Returns Promise<void>

  • Returns a promise containing a populated transaction to cancel option exercise before maturity. Allows the user to use the SDK without providing a signer.

    Parameters

    • optionPSAddress: string

      {string} Contract address of the option.

    • strike: bigint

      {bigint} strike price of the option.

    • maturity: bigint

      {bigint} maturity of the option

    • contractSize: bigint

      {bigint} size of the option to exercise.

    Returns Promise<ContractTransaction>

    Promise containing the contract transaction.

  • Returns a promise containing a populated transaction to exercise an option. Allows the user to use the SDK without providing a signer.

    Parameters

    • optionPSAddress: string

      {string} Contract address of the option.

    • strike: bigint

      {bigint} strike price of the option.

    • maturity: bigint

      {bigint} maturity of the option

    • contractSize: bigint

      {bigint} size of the option to exercise.

    Returns Promise<ContractTransaction>

    Promise containing the contract transaction.

  • Returns a promise containing a populated transaction to settle the exercised long options held by the caller. Allows the user to use the SDK without providing a signer.

    Parameters

    • optionPSAddress: string

      {string} Contract address of the option.

    • strike: bigint

      {bigint} strike price of the option.

    • maturity: bigint

      {bigint} maturity of the option

    • contractSize: bigint

      {bigint} size of the option to settle.

    Returns Promise<ContractTransaction>

    Promise containing the contract transaction.

  • Returns a promise containing a populated transaction to settle the short options held by the caller. Allows the user to use the SDK without providing a signer.

    Parameters

    • optionPSAddress: string

      {string} Contract address of the option.

    • strike: bigint

      {bigint} strike price of the option.

    • maturity: bigint

      {bigint} maturity of the option

    • contractSize: bigint

      {bigint} size of the option to settle.

    Returns Promise<ContractTransaction>

    Promise containing the contract transaction.

  • get the amount of exerciseToken to pay to exercise the given amount of contracts

    Parameters

    • optionAddress: string

      The address of the option.

    • strike: bigint

      The strike price of the option.

    • contractSize: bigint

      The size of the option.

    Returns Promise<[bigint, bigint] & {
        fee: bigint;
        totalExerciseCost: bigint;
    }>

    The amount of exerciseToken to pay to exercise the given amount of contracts

  • get the amount of collateral that would be received for a given amount of long tokens

    Parameters

    • optionAddress: string

      The address of the option.

    • strike: bigint

      The strike price of the option.

    • contractSize: bigint

      The size of the option.

    Returns Promise<bigint>

    The amount of collateral that would be received for a given amount of long tokens

Generated using TypeDoc