Realized-PnL result: either the amount or a halt reason.

Exactly one of pnl and haltReason is present.

Constructors

Properties

Methods

Constructors

  • Constructs a realized-PnL outcome.

    Pass either a computed pnl or a haltReason created by a PnlHaltReason factory.

    Errors

    Throws TypeError unless exactly one of pnl and haltReason is present.

    Parameters

    Returns PnlOutcome

Properties

haltReason: undefined | PnlHaltReason

The reason why PnL could not be calculated, or undefined when it is available.

isHalted: boolean

Whether this accumulator halted during the operation.

ok: boolean

Whether this outcome contains authoritative PnL.

pnl: undefined | PnlOutcomeAmount

The computed PnL, or undefined when a halt reason is present.

Methods

  • Returns void

  • Returns a deep copy of this PnL outcome.

    Returns PnlOutcome

  • Returns void