Policy-tagged account-level realized-PnL outcome.

SpotFunds denominates both the delta and absolute value in the account currency. SpotFunds emits a halted outcome only for the report that transitions the account accumulator to halted. Later reports omit the unchanged halt until its account PnL is explicitly force-set. Re-arming a position does not re-arm account PnL, and re-arming account PnL does not re-arm any position.

Exactly one of pnl and haltReason is present.

Constructors

  • Constructs a policy-tagged account-level PnL outcome.

    policyGroupId accepts an integer in 0..=65535. accountId accepts an AccountId object or a number | bigint | string. 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, TypeError/RangeError when policyGroupId is invalid, or AccountIdError when the account is invalid.

    Parameters

    Returns AccountPnlOutcome

Properties

accountId: AccountId

The account that owns the realized-PnL ledger.

haltReason: undefined | PnlHaltReason

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

isHalted: boolean

Whether this account 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.

policyGroupId: number

The policy-group tag of the policy that produced this outcome.

Methods

  • Returns void

  • Returns void