Pre-trade risk engine handle.

Built from [JsEngineBuilder] via Engine.builder(). The handle drives the two-stage pre-trade flow plus the post-trade and account-adjustment paths.

Methods

  • Returns void

  • Returns the engine's account registry and block facility.

    Returns Accounts

  • Applies an account-adjustment batch for accountId.

    accountId accepts an AccountId object or a number | bigint | string. adjustments is any iterable of AccountAdjustment objects or plain AccountAdjustmentInit literals. On success the result carries the produced outcomes; on rejection it carries the failing index and the rejects.

    Errors

    Throws ParamError/AssetError/AccountIdError when accountId or an adjustment in the batch is invalid. Re-throws the original error a custom policy callback threw, if any.

    Parameters

    Returns AccountAdjustmentBatchResult

  • Applies an execution report across all policies and returns the aggregated post-trade result.

    report accepts an ExecutionReport object or a plain ExecutionReportInit literal. A wrapper report is not consumed, so the caller may reuse the same object afterwards.

    Errors

    Throws ParamError/AssetError when report is neither a valid ExecutionReport nor a valid ExecutionReportInit literal. Re-throws the original error a custom policy callback threw, if any.

    Returns PostTradeResult

  • Returns the engine's runtime policy configurator.

    Returns Configurator

  • Runs start- and main-stage checks in one step, returning a [JsExecuteResult].

    order accepts an Order object or a plain OrderInit literal. A wrapper order is not consumed, so the caller may reuse the same object afterwards.

    Errors

    Throws ParamError/AssetError when order is neither a valid Order nor a valid OrderInit literal. Re-throws the original error a custom policy callback threw, if any.

    Parameters

    Returns ExecuteResult

  • Runs start- and main-stage checks as a non-mutating dry-run.

    order accepts an Order object or a plain OrderInit literal. A wrapper order is not consumed, so the caller may reuse the same object afterwards.

    Errors

    Throws ParamError/AssetError when order is neither a valid Order nor a valid OrderInit literal. Re-throws the original error a custom policy callback threw, if any.

    Parameters

    Returns DryRunReport

  • Returns void

  • Runs start-stage checks and returns a [JsStartResult].

    order accepts an Order object or a plain OrderInit literal. On success the result carries a single-use Request; on rejection it carries the rejects. A wrapper order is not consumed, so the caller may reuse the same object afterwards; a field-equivalent clone is retained as the request payload for later policy callbacks.

    Errors

    Throws ParamError/AssetError when order is neither a valid Order nor a valid OrderInit literal. Re-throws the original error a custom policy callback threw, if any.

    Parameters

    Returns StartResult

  • Runs start-stage checks as a non-mutating dry-run.

    order accepts an Order object or a plain OrderInit literal. A wrapper order is not consumed, so the caller may reuse the same object afterwards.

    Errors

    Throws ParamError/AssetError when order is neither a valid Order nor a valid OrderInit literal. Re-throws the original error a custom policy callback threw, if any.

    Parameters

    Returns DryRunReport