Options
All
  • Public
  • Public/Protected
  • All
Menu

SMAOracle class for interacting with ERC20 tokens The constructor is private so must be instantiated with SMAOracle.Create

Hierarchy

  • SMAOracle

Implements

Index

Constructors

  • Returns SMAOracle

Properties

_contract?: SMAOracle
_underlyingOracle?: ChainlinkOracleWrapper
address: string
connect: (provider: Provider | Signer) => void = ...

Type declaration

    • (provider: Provider | Signer): void
    • Replaces the provider and connects the contract instance

      Parameters

      • provider: Provider | Signer

        The new provider to connect to

      Returns void

getPrice: () => Promise<BigNumber> = ...

Type declaration

    • (): Promise<BigNumber>
    • get the latest SMA price

      Returns Promise<BigNumber>

      the average of the most recent price data points

getSpotPrice: () => Promise<BigNumber> = ...

Type declaration

    • (): Promise<BigNumber>
    • get the current underlying spot price

      Returns Promise<BigNumber>

      the current price reported by the underlying price oracle

init: (oracleInfo: ISMAOracle) => Promise<void> = ...

Type declaration

multicallProvider: undefined | Signer | MulticallProvider
numPeriods: number
provider: undefined | Provider | Signer
type: undefined | "SMA" | "Spot"
updateInterval: number
Create: (oracleInfo: ISMAOracle) => Promise<SMAOracle> = ...

Type declaration

    • Replacement constructor pattern to support async initialisations

      Parameters

      Returns Promise<SMAOracle>

      a Promise containing an initialised SMAOracle class ready to be used

CreateDefault: () => SMAOracle = ...

Type declaration

    • Creates an empty SMAOracle that can be used as a default

      Returns SMAOracle

      default constructed token

Generated using TypeDoc