OpenPitAccountControlOpaque handle to the per-account blocking facility bound to one account.
What it is:
Why it exists:
Lifetime contract:
openpit_destroy_account_control exactly once.typedef struct OpenPitAccountControl OpenPitAccountControl;
openpit_account_control_blockRecords 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:
control must be a valid non-null account-control handle, or null.block payload fields are copied into internal storage before this call
returns.control records nothing and has no effect.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_cloneReturns 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:
control is null.Cleanup:
openpit_destroy_account_control
exactly once.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_controlReleases a caller-owned account-control handle.
Lifetime contract:
void openpit_destroy_account_control(
OpenPitAccountControl * control
);
openpit_pretrade_context_get_account_controlReturns 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:
ctx must be the callback-scoped context pointer passed to a custom
main-stage pre-trade callback; it is valid only for the duration of that
callback.Success:
Error:
ctx is null or the context carries no account control
(no account could be bound).Cleanup:
openpit_destroy_account_control
exactly once. It may be retained for deferred blocking, but it is valid to
use only within the pre-trade transaction of this request — through the
commit or rollback of its reservation; recording a block through it
afterwards is undefined.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_controlReturns 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:
ctx must be the callback-scoped context pointer passed to a custom
account-adjustment callback; it is valid only for the duration of that
callback.Success:
Error:
ctx is null.Cleanup:
openpit_destroy_account_control
exactly once. It may be retained for deferred blocking, but it is valid to
use only within the account adjustment processing of this request — through
the commit or rollback of that request; recording a block through it
afterwards is undefined.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_groupReturns 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:
ctx must be the callback-scoped context pointer passed to a custom
main-stage pre-trade callback; it is valid only for the duration of that
callback.out_group must be a valid non-null pointer.Success:
true and writes the group to out_group when the account is
registered in a group;false when ctx is null, no account was bound to the request, or
the account belongs to no group; out_group is not written to.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_groupReturns 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:
ctx must be the callback-scoped context pointer passed to a custom
account-adjustment callback; it is valid only for the duration of that
callback.out_group must be a valid non-null pointer.Success:
true and writes the group to out_group when the account is
registered in a group;false when ctx is null or the account belongs to no group;
out_group is not written to.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_groupReturns 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:
ctx must be the callback-scoped context pointer passed to a custom
apply_execution_report callback; it is valid only for the duration of that
callback.out_group must be a valid non-null pointer.Success:
true and writes the group to out_group when the account is
registered in a group;false when ctx is null or the account belongs to no group;
out_group is not written to.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
);