Thread-shareable live market-data service.

Reads use get(instrumentId, accountId, accountInfo, resolution) and getOrErr(...). accountInfo is any object exposing an accountGroup getter returning an AccountGroupId or null; the group is read only when the read needs it.

Methods

  • Returns void

  • Removes every stored quote for instrumentId.

    instrumentId accepts an InstrumentId or a numeric/string identifier.

    Errors

    Throws ParamError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId

    Returns void

  • Clears the TTL override for accountGroupId.

    accountGroupId accepts an AccountGroupId or a numeric/string identifier. Passing AccountGroupId.DEFAULT targets the service-level default-group ("everyone-else") bucket.

    Errors

    Throws ParamError on an invalid identifier.

    Parameters

    • account_group_id:
          | string
          | number
          | bigint
          | AccountGroupId

    Returns void

  • Clears the TTL override for accountId.

    accountId accepts an AccountId or a numeric/string identifier.

    Errors

    Throws AccountIdError on an invalid identifier.

    Parameters

    • account_id:
          | string
          | number
          | bigint
          | AccountId

    Returns void

  • Clears the per-instrument, per-group TTL override.

    instrumentId/accountGroupId accept the wrapper or a numeric/string id. Passing AccountGroupId.DEFAULT targets the instrument-level default-group bucket.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_group_id:
          | string
          | number
          | bigint
          | AccountGroupId

    Returns void

  • Clears the per-instrument, per-account TTL override.

    instrumentId/accountId accept the wrapper or a numeric/string id.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError/AccountIdError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_id:
          | string
          | number
          | bigint
          | AccountId

    Returns void

  • Clears the per-instrument TTL override.

    instrumentId accepts an InstrumentId or a numeric/string identifier.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId

    Returns void

  • Returns void

  • Returns the latest quote for (instrumentId, accountId), or undefined.

    instrumentId/accountId accept the wrapper or a numeric/string id. accountInfo is any object exposing an accountGroup getter; the group is consulted only when the read needs it. resolution is a QuoteResolution or its wire string.

    Errors

    Throws ParamError/AccountIdError on an invalid identifier, resolution, or a consulted accountInfo shape. Unknown instruments, unavailable quotes, and expired quotes return undefined.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_id:
          | string
          | number
          | bigint
          | AccountId
    • account_info: undefined | null | AccountInfo
    • resolution:
          | QuoteResolution
          | "ACCOUNT_ONLY"
          | "ACCOUNT_THEN_GROUP"
          | "ACCOUNT_THEN_GROUP_THEN_DEFAULT"

    Returns undefined | Quote

  • Returns the latest quote for (instrumentId, accountId), throwing when no usable quote exists.

    instrumentId/accountId accept the wrapper or a numeric/string id. accountInfo is any object exposing an accountGroup getter; resolution is a QuoteResolution or its wire string.

    Errors

    Throws UnknownInstrument when instrumentId is not registered, QuoteUnavailable when no quote is available, QuoteExpired with the selected stale quote when its TTL elapsed, and ParamError/ AccountIdError on an invalid identifier, resolution, or accountInfo shape.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_id:
          | string
          | number
          | bigint
          | AccountId
    • account_info: undefined | null | AccountInfo
    • resolution:
          | QuoteResolution
          | "ACCOUNT_ONLY"
          | "ACCOUNT_THEN_GROUP"
          | "ACCOUNT_THEN_GROUP_THEN_DEFAULT"

    Returns Quote

  • Publishes quote to the default bucket for instrumentId.

    instrumentId accepts an InstrumentId or a numeric/string identifier; quote accepts a Quote object or a plain QuoteInit literal.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier or quote literal.

    Parameters

    Returns void

  • Publishes quote to instrument's default bucket, auto-registering it.

    instrument accepts an Instrument object or a plain InstrumentInit literal; quote accepts a Quote object or a plain QuoteInit literal. Returns the resolved (or newly assigned) instrument id.

    Errors

    Throws AssetError/ParamError on an invalid instrument or quote.

    Parameters

    Returns InstrumentId

  • Merges a partial quote into instrument's default bucket.

    instrument accepts an Instrument object or a plain InstrumentInit literal; quote accepts a Quote object or a plain QuoteInit literal. Returns the resolved (or newly assigned) instrument id.

    Errors

    Throws AssetError/ParamError on an invalid instrument or quote.

    Parameters

    Returns InstrumentId

  • Publishes quote to the given accounts and groups.

    instrumentId accepts an InstrumentId or a numeric/string id; quote accepts a Quote object or a plain QuoteInit literal; the target iterables accept AccountId/AccountGroupId or numeric/string ids. To target the default ("everyone-else") bucket, include AccountGroupId.DEFAULT in accountGroupIds.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, RangeError when both target lists are empty, or ParamError/AccountIdError on an invalid input.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • quote: Quote | QuoteInit
    • account_ids: Iterable<
          | string
          | number
          | bigint
          | AccountId, any, any>
    • account_group_ids: Iterable<
          | string
          | number
          | bigint
          | AccountGroupId, any, any>

    Returns void

  • Merges a partial quote into the given accounts and groups.

    instrumentId accepts an InstrumentId or a numeric/string id; quote accepts a Quote object or a plain QuoteInit literal; the target iterables accept AccountId/AccountGroupId or numeric/string ids. To target the default ("everyone-else") bucket, include AccountGroupId.DEFAULT in accountGroupIds.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, RangeError when both target lists are empty, or ParamError/AccountIdError on an invalid input.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • quote: Quote | QuoteInit
    • account_ids: Iterable<
          | string
          | number
          | bigint
          | AccountId, any, any>
    • account_group_ids: Iterable<
          | string
          | number
          | bigint
          | AccountGroupId, any, any>

    Returns void

  • Merges a partial quote into the default bucket for instrumentId.

    instrumentId accepts an InstrumentId or a numeric/string identifier; quote accepts a Quote object or a plain QuoteInit literal.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier or quote literal.

    Parameters

    Returns void

  • Registers instrument and returns its assigned id.

    instrument accepts an Instrument object or a plain InstrumentInit literal.

    Errors

    Throws AlreadyRegistered when the instrument is already registered, or AssetError/ParamError on an invalid literal.

    Parameters

    Returns InstrumentId

  • Registers instrument under an explicit id and returns it.

    instrument accepts an Instrument object or a plain InstrumentInit literal; id accepts an InstrumentId or a numeric/string identifier.

    Errors

    Throws RegistrationError when the id or instrument already exists, or AssetError/ParamError on an invalid input.

    Parameters

    Returns InstrumentId

  • Registers instrument under an explicit id with a TTL.

    instrument accepts an Instrument object or a plain InstrumentInit literal; id accepts an InstrumentId or a numeric/string identifier.

    Errors

    Throws RegistrationError when the id or instrument already exists, or AssetError/ParamError on an invalid input.

    Parameters

    Returns InstrumentId

  • Registers instrument with a per-instrument TTL and returns its id.

    instrument accepts an Instrument object or a plain InstrumentInit literal.

    Errors

    Throws AlreadyRegistered when the instrument is already registered, or AssetError/ParamError on an invalid literal.

    Parameters

    Returns InstrumentId

  • Returns the id instrument is registered under, or undefined.

    instrument accepts an Instrument object or a plain InstrumentInit literal.

    Errors

    Throws AssetError/ParamError on an invalid literal.

    Parameters

    Returns undefined | InstrumentId

  • Sets the TTL override for accountGroupId.

    accountGroupId accepts an AccountGroupId or a numeric/string identifier. Passing AccountGroupId.DEFAULT targets the service-level default-group ("everyone-else") bucket.

    Errors

    Throws ParamError on an invalid identifier.

    Parameters

    Returns void

  • Sets the TTL override for accountId.

    accountId accepts an AccountId or a numeric/string identifier.

    Errors

    Throws AccountIdError on an invalid identifier.

    Parameters

    • account_id:
          | string
          | number
          | bigint
          | AccountId
    • ttl: QuoteTtl

    Returns void

  • Sets the per-instrument, per-group TTL override.

    instrumentId/accountGroupId accept the wrapper or a numeric/string id. Passing AccountGroupId.DEFAULT targets the instrument-level default-group bucket.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_group_id:
          | string
          | number
          | bigint
          | AccountGroupId
    • ttl: QuoteTtl

    Returns void

  • Sets the per-instrument, per-account TTL override.

    instrumentId/accountId accept the wrapper or a numeric/string id.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError/AccountIdError on an invalid identifier.

    Parameters

    • instrument_id:
          | string
          | number
          | bigint
          | InstrumentId
    • account_id:
          | string
          | number
          | bigint
          | AccountId
    • ttl: QuoteTtl

    Returns void

  • Sets the per-instrument TTL override.

    instrumentId accepts an InstrumentId or a numeric/string identifier.

    Errors

    Throws UnknownInstrumentId when instrumentId is not registered, or ParamError on an invalid identifier.

    Parameters

    Returns void