OpenPitParamAdjustmentAmountOne amount component inside an account adjustment.
The numeric value is interpreted according to kind:
Delta means “change current state by this signed amount”;Absolute means “set current state to this signed amount”.typedef struct OpenPitParamAdjustmentAmount {
OpenPitParamPositionSize value;
OpenPitParamAdjustmentAmountKind kind;
} OpenPitParamAdjustmentAmount;
OpenPitAccountAdjustmentBalanceOperationBalance-operation payload for account adjustment.
typedef struct OpenPitAccountAdjustmentBalanceOperation {
OpenPitStringView asset;
OpenPitParamPriceOptional average_entry_price;
OpenPitParamPnlOptional realized_pnl;
} OpenPitAccountAdjustmentBalanceOperation;
OpenPitAccountAdjustmentPositionOperationPosition-operation payload for account adjustment.
typedef struct OpenPitAccountAdjustmentPositionOperation {
OpenPitInstrument instrument;
OpenPitStringView collateral_asset;
OpenPitParamPriceOptional average_entry_price;
OpenPitParamLeverage leverage;
OpenPitParamPositionMode mode;
} OpenPitAccountAdjustmentPositionOperation;
OpenPitAccountAdjustmentOperationKindSelects which account-adjustment operation payload is present.
At most one operation payload can be selected at a time:
Absent means no operation is supplied;Balance selects the balance-operation payload;Position selects the position-operation payload.typedef uint8_t OpenPitAccountAdjustmentOperationKind;
/**
* No operation is supplied.
*/
#define OpenPitAccountAdjustmentOperationKind_Absent \
((OpenPitAccountAdjustmentOperationKind) 0)
/**
* The balance-operation payload is selected.
*/
#define OpenPitAccountAdjustmentOperationKind_Balance \
((OpenPitAccountAdjustmentOperationKind) 1)
/**
* The position-operation payload is selected.
*/
#define OpenPitAccountAdjustmentOperationKind_Position \
((OpenPitAccountAdjustmentOperationKind) 2)
OpenPitAccountAdjustmentOperationAccount-adjustment operation as a single discriminated value.
kind selects which payload is meaningful; the payload not selected by kind
is ignored. Because a single discriminant chooses the payload, supplying both a
balance and a position operation at once is not representable.
typedef struct OpenPitAccountAdjustmentOperation {
OpenPitAccountAdjustmentOperationKind kind;
OpenPitAccountAdjustmentBalanceOperation balance;
OpenPitAccountAdjustmentPositionOperation position;
} OpenPitAccountAdjustmentOperation;
OpenPitAccountAdjustmentAmountOptional amount-change group for account adjustment.
The group is absent when every field is absent.
typedef struct OpenPitAccountAdjustmentAmount {
OpenPitParamAdjustmentAmount balance;
OpenPitParamAdjustmentAmount held;
OpenPitParamAdjustmentAmount incoming;
} OpenPitAccountAdjustmentAmount;
OpenPitAccountAdjustmentBoundsOptional bounds group for account adjustment.
The group is absent when every bound is absent.
typedef struct OpenPitAccountAdjustmentBounds {
OpenPitParamPositionSizeOptional balance_upper;
OpenPitParamPositionSizeOptional balance_lower;
OpenPitParamPositionSizeOptional held_upper;
OpenPitParamPositionSizeOptional held_lower;
OpenPitParamPositionSizeOptional incoming_upper;
OpenPitParamPositionSizeOptional incoming_lower;
} OpenPitAccountAdjustmentBounds;
OpenPitAccountAdjustmentFull caller-owned account-adjustment payload.
typedef struct OpenPitAccountAdjustment {
OpenPitAccountAdjustmentOperation operation;
OpenPitAccountAdjustmentAmountOptional amount;
OpenPitAccountAdjustmentBoundsOptional bounds;
void * user_data;
} OpenPitAccountAdjustment;
OpenPitAccountAdjustmentApplyStatusResult of openpit_engine_apply_account_adjustment.
typedef uint8_t OpenPitAccountAdjustmentApplyStatus;
/**
* The call failed before the batch could be evaluated.
*/
#define OpenPitAccountAdjustmentApplyStatus_Error \
((OpenPitAccountAdjustmentApplyStatus) 0)
/**
* The batch was accepted and applied.
*/
#define OpenPitAccountAdjustmentApplyStatus_Applied \
((OpenPitAccountAdjustmentApplyStatus) 1)
/**
* The batch was evaluated and rejected by policy or validation logic.
*/
#define OpenPitAccountAdjustmentApplyStatus_Rejected \
((OpenPitAccountAdjustmentApplyStatus) 2)
OpenPitAccountAdjustmentAmountOptionaltypedef struct OpenPitAccountAdjustmentAmountOptional {
OpenPitAccountAdjustmentAmount value;
bool is_set;
} OpenPitAccountAdjustmentAmountOptional;
OpenPitAccountAdjustmentBoundsOptionaltypedef struct OpenPitAccountAdjustmentBoundsOptional {
OpenPitAccountAdjustmentBounds value;
bool is_set;
} OpenPitAccountAdjustmentBoundsOptional;
openpit_param_adjustment_amount_to_stringRenders an adjustment amount into a caller-owned shared string.
Returns null and writes out_error when the amount is not set or its numeric
value cannot be decoded.
OpenPitSharedString * openpit_param_adjustment_amount_to_string(
OpenPitParamAdjustmentAmount value,
OpenPitOutParamError out_error
);