Fetch the current price of a perpetual market.

Implements

Constructors

  • Constructs a new PerpMarketTask.

    Parameters

    Returns PerpMarketTask

Properties

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

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

PerpMarketTask MarketAddress.

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

  • 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<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    • Optionallength: number

      Message length if known beforehand

    Returns PerpMarketTask

    PerpMarketTask

    If the payload is not a reader or valid buffer

    If required fields are missing

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

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    Returns PerpMarketTask

    PerpMarketTask

    If the payload is not a reader or valid buffer

    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

    • Optionalwriter: 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

    • Optionalwriter: 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

    Returns PerpMarketTask

    PerpMarketTask

  • Gets the default type url for PerpMarketTask

    Parameters

    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

    • Optionaloptions: IConversionOptions

      Conversion options

    Returns { [k: string]: any }

    Plain object

  • Verifies a PerpMarketTask message.

    Parameters

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

      Plain object to verify

    Returns string

    null if valid, otherwise the reason why it is not