pit

Account Control

Back to index

OpenPitAccountControl

Opaque handle to the per-account blocking facility bound to one account.

What it is:

Why it exists:

Lifetime contract:

typedef struct OpenPitAccountControl OpenPitAccountControl;

openpit_account_control_block

Records a block against the account bound to an account-control handle.

Records block against the bound account on the engine’s shared blocked-accounts facility. The first cause recorded for an account wins; later calls for the same account are no-ops.

Contract:

Safety

control must be either null or a valid account-control handle provided by this library.

void openpit_account_control_block(
    const OpenPitAccountControl * control,
    OpenPitPretradeAccountBlock block
);

openpit_account_control_clone

Returns a new handle referring to the same account-control facility.

Use this to retain the ability to block the bound account from a later callback within the same pre-trade transaction. The returned handle records blocks against the same account as the source handle and shares its validity window: it is valid to use only within that pre-trade transaction, and is undefined afterwards.

Success:

Error:

Cleanup:

Safety

control must be either null or a valid account-control handle provided by this library.

OpenPitAccountControl * openpit_account_control_clone(
    const OpenPitAccountControl * control
);

openpit_destroy_account_control

Releases a caller-owned account-control handle.

Lifetime contract:

void openpit_destroy_account_control(
    OpenPitAccountControl * control
);

openpit_pretrade_context_get_account_control

Returns an account-control handle for a main-stage pre-trade context.

A main-stage pre-trade context carries account control only when an account could be bound to the request.

Contract:

Success:

Error:

Cleanup:

Safety

ctx must be either null or a valid callback-scoped pre-trade context pointer provided to this library.

OpenPitAccountControl * openpit_pretrade_context_get_account_control(
    const OpenPitPretradeContext * ctx
);

openpit_account_adjustment_context_get_account_control

Returns an account-control handle for an account-adjustment context.

An account-adjustment context always carries account control, so this call returns a non-null handle for any valid context.

Contract:

Success:

Error:

Cleanup:

Safety

ctx must be either null or a valid callback-scoped account-adjustment context pointer provided to this library.

OpenPitAccountControl * openpit_account_adjustment_context_get_account_control(
    const OpenPitAccountAdjustmentContext * ctx
);

openpit_pretrade_context_get_account_group

Returns the account-group for a main-stage pre-trade context.

Looks up the group registered for the bound order account. The result is cached on first call and reused for subsequent calls within the same context lifetime.

Contract:

Success:

Safety

ctx must be either null or a valid callback-scoped pre-trade context pointer provided to this library.

bool openpit_pretrade_context_get_account_group(
    const OpenPitPretradeContext * ctx,
    OpenPitParamAccountGroupId * out_group
);

openpit_account_adjustment_context_get_account_group

Returns the account-group for an account-adjustment context.

Looks up the group registered for the adjusted account. The result is cached on first call and reused for subsequent calls within the same context lifetime.

Contract:

Success:

Safety

ctx must be either null or a valid callback-scoped account-adjustment context pointer provided to this library.

bool openpit_account_adjustment_context_get_account_group(
    const OpenPitAccountAdjustmentContext * ctx,
    OpenPitParamAccountGroupId * out_group
);

openpit_post_trade_context_get_account_group

Returns the account-group for a post-trade context.

Looks up the group registered for the report’s account. The result is cached on first call and reused for subsequent calls within the same context lifetime.

Contract:

Success:

Safety

ctx must be either null or a valid callback-scoped post-trade context pointer provided to this library.

bool openpit_post_trade_context_get_account_group(
    const OpenPitPostTradeContext * ctx,
    OpenPitParamAccountGroupId * out_group
);