pit

Account Adjustments

Back to index

OpenPitParamAdjustmentAmount

One amount component inside an account adjustment.

The numeric value is interpreted according to kind:

typedef struct OpenPitParamAdjustmentAmount {
    OpenPitParamPositionSize value;
    OpenPitParamAdjustmentAmountKind kind;
} OpenPitParamAdjustmentAmount;

OpenPitAccountAdjustmentBalanceOperation

Balance-operation payload for account adjustment.

typedef struct OpenPitAccountAdjustmentBalanceOperation {
    OpenPitStringView asset;
    OpenPitParamPriceOptional average_entry_price;
} OpenPitAccountAdjustmentBalanceOperation;

OpenPitAccountAdjustmentPositionOperation

Position-operation payload for account adjustment.

typedef struct OpenPitAccountAdjustmentPositionOperation {
    OpenPitInstrument instrument;
    OpenPitStringView collateral_asset;
    OpenPitParamPriceOptional average_entry_price;
    OpenPitParamLeverage leverage;
    OpenPitParamPositionMode mode;
} OpenPitAccountAdjustmentPositionOperation;

OpenPitAccountAdjustmentBalanceOperationOptional

typedef struct OpenPitAccountAdjustmentBalanceOperationOptional {
    OpenPitAccountAdjustmentBalanceOperation value;
    bool is_set;
} OpenPitAccountAdjustmentBalanceOperationOptional;

OpenPitAccountAdjustmentPositionOperationOptional

typedef struct OpenPitAccountAdjustmentPositionOperationOptional {
    OpenPitAccountAdjustmentPositionOperation value;
    bool is_set;
} OpenPitAccountAdjustmentPositionOperationOptional;

OpenPitAccountAdjustmentAmount

Optional amount-change group for account adjustment.

The group is absent when every field is absent.

typedef struct OpenPitAccountAdjustmentAmount {
    OpenPitParamAdjustmentAmount total;
    OpenPitParamAdjustmentAmount reserved;
    OpenPitParamAdjustmentAmount pending;
} OpenPitAccountAdjustmentAmount;

OpenPitAccountAdjustmentBounds

Optional bounds group for account adjustment.

The group is absent when every bound is absent.

typedef struct OpenPitAccountAdjustmentBounds {
    OpenPitParamPositionSizeOptional total_upper;
    OpenPitParamPositionSizeOptional total_lower;
    OpenPitParamPositionSizeOptional reserved_upper;
    OpenPitParamPositionSizeOptional reserved_lower;
    OpenPitParamPositionSizeOptional pending_upper;
    OpenPitParamPositionSizeOptional pending_lower;
} OpenPitAccountAdjustmentBounds;

OpenPitAccountAdjustment

Full caller-owned account-adjustment payload.

typedef struct OpenPitAccountAdjustment {
    OpenPitAccountAdjustmentBalanceOperationOptional balance_operation;
    OpenPitAccountAdjustmentPositionOperationOptional position_operation;
    OpenPitAccountAdjustmentAmountOptional amount;
    OpenPitAccountAdjustmentBoundsOptional bounds;
    void * user_data;
} OpenPitAccountAdjustment;

OpenPitAccountAdjustmentApplyStatus

Result 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)

OpenPitAccountAdjustmentAmountOptional

typedef struct OpenPitAccountAdjustmentAmountOptional {
    OpenPitAccountAdjustmentAmount value;
    bool is_set;
} OpenPitAccountAdjustmentAmountOptional;

OpenPitAccountAdjustmentBoundsOptional

typedef struct OpenPitAccountAdjustmentBoundsOptional {
    OpenPitAccountAdjustmentBounds value;
    bool is_set;
} OpenPitAccountAdjustmentBoundsOptional;