Class SubgraphPosition

Represents the type of option in the Valorem Clear system.

Hierarchy (view full)

Constructors

  • Parameters

    • __namedParameters: {
          optionType: OptionType;
          subgraphOptionType: SubgraphOptionType;
          subgraphPosition: Required<{
              id: string;
              token: {
                  claim: null | {
                      amountExercised: string;
                      amountWritten: string;
                      id: string;
                      optionType: {
                          exerciseAmount: string;
                          exerciseAsset: {
                              symbol: string;
                          };
                          exerciseTimestamp: string;
                          expiryTimestamp: string;
                          id: string;
                          underlyingAmount: string;
                          underlyingAsset: {
                              symbol: string;
                          };
                      };
                      redeemed: boolean;
                  };
                  id: string;
                  optionType: null | {
                      exerciseAmount: string;
                      exerciseAsset: {
                          symbol: string;
                      };
                      exerciseTimestamp: string;
                      expiryTimestamp: string;
                      id: string;
                      underlyingAmount: string;
                      underlyingAsset: {
                          symbol: string;
                      };
                  };
                  type: null | number;
              };
              valueExact: string;
          }>;
      }
      • optionType: OptionType
      • subgraphOptionType: SubgraphOptionType
      • subgraphPosition: Required<{
            id: string;
            token: {
                claim: null | {
                    amountExercised: string;
                    amountWritten: string;
                    id: string;
                    optionType: {
                        exerciseAmount: string;
                        exerciseAsset: {
                            symbol: string;
                        };
                        exerciseTimestamp: string;
                        expiryTimestamp: string;
                        id: string;
                        underlyingAmount: string;
                        underlyingAsset: {
                            symbol: string;
                        };
                    };
                    redeemed: boolean;
                };
                id: string;
                optionType: null | {
                    exerciseAmount: string;
                    exerciseAsset: {
                        symbol: string;
                    };
                    exerciseTimestamp: string;
                    expiryTimestamp: string;
                    id: string;
                    underlyingAmount: string;
                    underlyingAsset: {
                        symbol: string;
                    };
                };
                type: null | number;
            };
            valueExact: string;
        }>

    Returns SubgraphPosition

Properties

exerciseAsset: SupportedAsset
optionInfo: OptionTypeInfo
optionTypeId: bigint
rawClaimFromSubgraph?: {
    amountExercised: string;
    amountWritten: string;
    id: string;
    optionType: {
        exerciseAmount: string;
        exerciseAsset: {
            symbol: string;
        };
        exerciseTimestamp: string;
        expiryTimestamp: string;
        id: string;
        underlyingAmount: string;
        underlyingAsset: {
            symbol: string;
        };
    };
    redeemed: boolean;
}

Type declaration

  • amountExercised: string
  • amountWritten: string
  • id: string
  • optionType: {
        exerciseAmount: string;
        exerciseAsset: {
            symbol: string;
        };
        exerciseTimestamp: string;
        expiryTimestamp: string;
        id: string;
        underlyingAmount: string;
        underlyingAsset: {
            symbol: string;
        };
    }
    • exerciseAmount: string
    • exerciseAsset: {
          symbol: string;
      }
      • symbol: string
    • exerciseTimestamp: string
    • expiryTimestamp: string
    • id: string
    • underlyingAmount: string
    • underlyingAsset: {
          symbol: string;
      }
      • symbol: string
  • redeemed: boolean
rawOptionTypeFromSubgraph: SubgraphOptionType
rawPositionFromSubgraph: Required<{
    id: string;
    token: {
        claim: null | {
            amountExercised: string;
            amountWritten: string;
            id: string;
            optionType: {
                exerciseAmount: string;
                exerciseAsset: {
                    symbol: string;
                };
                exerciseTimestamp: string;
                expiryTimestamp: string;
                id: string;
                underlyingAmount: string;
                underlyingAsset: {
                    symbol: string;
                };
            };
            redeemed: boolean;
        };
        id: string;
        optionType: null | {
            exerciseAmount: string;
            exerciseAsset: {
                symbol: string;
            };
            exerciseTimestamp: string;
            expiryTimestamp: string;
            id: string;
            underlyingAmount: string;
            underlyingAsset: {
                symbol: string;
            };
        };
        type: null | number;
    };
    valueExact: string;
}>

Type declaration

  • id: string
  • token: {
        claim: null | {
            amountExercised: string;
            amountWritten: string;
            id: string;
            optionType: {
                exerciseAmount: string;
                exerciseAsset: {
                    symbol: string;
                };
                exerciseTimestamp: string;
                expiryTimestamp: string;
                id: string;
                underlyingAmount: string;
                underlyingAsset: {
                    symbol: string;
                };
            };
            redeemed: boolean;
        };
        id: string;
        optionType: null | {
            exerciseAmount: string;
            exerciseAsset: {
                symbol: string;
            };
            exerciseTimestamp: string;
            expiryTimestamp: string;
            id: string;
            underlyingAmount: string;
            underlyingAsset: {
                symbol: string;
            };
        };
        type: null | number;
    }
    • claim: null | {
          amountExercised: string;
          amountWritten: string;
          id: string;
          optionType: {
              exerciseAmount: string;
              exerciseAsset: {
                  symbol: string;
              };
              exerciseTimestamp: string;
              expiryTimestamp: string;
              id: string;
              underlyingAmount: string;
              underlyingAsset: {
                  symbol: string;
              };
          };
          redeemed: boolean;
      }
    • id: string
    • optionType: null | {
          exerciseAmount: string;
          exerciseAsset: {
              symbol: string;
          };
          exerciseTimestamp: string;
          expiryTimestamp: string;
          id: string;
          underlyingAmount: string;
          underlyingAsset: {
              symbol: string;
          };
      }
    • type: null | number
  • valueExact: string
tokenId: undefined | bigint = undefined
tokenType: undefined | 0 | 2 | 1 = undefined
typeExists: boolean
underlyingAsset: SupportedAsset

Accessors

  • get claim(): undefined | {
        amountExercised: string;
        amountWritten: string;
        id: string;
        optionType: {
            exerciseAmount: string;
            exerciseAsset: {
                symbol: string;
            };
            exerciseTimestamp: string;
            expiryTimestamp: string;
            id: string;
            underlyingAmount: string;
            underlyingAsset: {
                symbol: string;
            };
        };
        redeemed: boolean;
    }
  • Returns undefined | {
        amountExercised: string;
        amountWritten: string;
        id: string;
        optionType: {
            exerciseAmount: string;
            exerciseAsset: {
                symbol: string;
            };
            exerciseTimestamp: string;
            expiryTimestamp: string;
            id: string;
            underlyingAmount: string;
            underlyingAsset: {
                symbol: string;
            };
        };
        redeemed: boolean;
    }

Methods

  • Parameters

    • __namedParameters: {
          chainId: number;
          subgraphPosition: Required<{
              id: string;
              token: {
                  claim: null | {
                      amountExercised: string;
                      amountWritten: string;
                      id: string;
                      optionType: {
                          exerciseAmount: string;
                          exerciseAsset: {
                              symbol: string;
                          };
                          exerciseTimestamp: string;
                          expiryTimestamp: string;
                          id: string;
                          underlyingAmount: string;
                          underlyingAsset: {
                              symbol: string;
                          };
                      };
                      redeemed: boolean;
                  };
                  id: string;
                  optionType: null | {
                      exerciseAmount: string;
                      exerciseAsset: {
                          symbol: string;
                      };
                      exerciseTimestamp: string;
                      expiryTimestamp: string;
                      id: string;
                      underlyingAmount: string;
                      underlyingAsset: {
                          symbol: string;
                      };
                  };
                  type: null | number;
              };
              valueExact: string;
          }>;
      }
      • chainId: number
      • subgraphPosition: Required<{
            id: string;
            token: {
                claim: null | {
                    amountExercised: string;
                    amountWritten: string;
                    id: string;
                    optionType: {
                        exerciseAmount: string;
                        exerciseAsset: {
                            symbol: string;
                        };
                        exerciseTimestamp: string;
                        expiryTimestamp: string;
                        id: string;
                        underlyingAmount: string;
                        underlyingAsset: {
                            symbol: string;
                        };
                    };
                    redeemed: boolean;
                };
                id: string;
                optionType: null | {
                    exerciseAmount: string;
                    exerciseAsset: {
                        symbol: string;
                    };
                    exerciseTimestamp: string;
                    expiryTimestamp: string;
                    id: string;
                    underlyingAmount: string;
                    underlyingAsset: {
                        symbol: string;
                    };
                };
                type: null | number;
            };
            valueExact: string;
        }>

    Returns SubgraphPosition

  • Retrieves the option type information from the clearinghouse contract.

    Parameters

    • tokenId: bigint

      The unique identifier of the option or claim.

    • clearinghouse: ClearinghouseContract

      The clearinghouse contract instance.

    Returns Promise<{
        exerciseAmount: bigint;
        exerciseAsset: `0x${string}`;
        exerciseTimestamp: number;
        expiryTimestamp: number;
        nextClaimKey: bigint;
        settlementSeed: bigint;
        underlyingAmount: bigint;
        underlyingAsset: `0x${string}`;
    }>

    The option type information.

  • Determines the token type for the given ID by querying the clearinghouse.

    Parameters

    • tokenId: bigint

      The unique identifier of the option or claim.

    • clearinghouse: ClearinghouseContract

      The clearinghouse contract instance.

    Returns Promise<0 | 2 | 1>

    The token type as a promise that resolves to 0, 1, or 2.

Generated using TypeDoc