Fetch the current price of a perpetual market.

Implements

Constructors

Properties

MarketAddress?: "mangoMarketAddress" | "driftMarketAddress" | "zetaMarketAddress" | "zoMarketAddress"

PerpMarketTask MarketAddress.

driftMarketAddress?: string

Market address for a drift perpetual market. A full list can be found here: https://github.com/drift-labs/protocol-v1/blob/master/sdk/src/constants/markets.ts

mangoMarketAddress?: string

Market address for a mango perpetual market. A full list can be found here: https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json

zetaMarketAddress?: string

Market address for a zeta perpetual market.

zoMarketAddress?: string

Market address for a 01 protocol perpetual market.

Methods

  • Converts this PerpMarketTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

    • [k: string]: any
  • Creates a new PerpMarketTask instance using the specified properties.

    Parameters

    Returns PerpMarketTask

    PerpMarketTask instance

  • Decodes a PerpMarketTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    • Optional length: number

      Message length if known beforehand

    Returns PerpMarketTask

    PerpMarketTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Decodes a PerpMarketTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns PerpMarketTask

    PerpMarketTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Encodes the specified PerpMarketTask message. Does not implicitly verify messages.

    Parameters

    • message: IPerpMarketTask

      PerpMarketTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified PerpMarketTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IPerpMarketTask

      PerpMarketTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a PerpMarketTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: {
          [k: string]: any;
      }

      Plain object

      • [k: string]: any

    Returns PerpMarketTask

    PerpMarketTask

  • Gets the default type url for PerpMarketTask

    Parameters

    • Optional typeUrlPrefix: string

      your custom typeUrlPrefix(default "type.googleapis.com")

    Returns string

    The default type url

  • Creates a plain object from a PerpMarketTask message. Also converts values to other types if specified.

    Parameters

    • message: PerpMarketTask

      PerpMarketTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a PerpMarketTask message.

    Parameters

    • message: {
          [k: string]: any;
      }

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not