Skip to navigation

Propose an adjustment

Proposes a correction of an account’s derivative position or of its inventory of an asset (risk:propose): its cost basis, realized PnL or a fee — never a quantity. It moves nothing until approved; once approved it applies as of this proposal. Takes no If-Match. Answers 201 with the adjustment, PENDING_APPROVAL.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

Idempotency-KeystringRequired

Required on every write: a URL-safe string of 1 to 64 characters from [A-Za-z0-9._~-] (a UUID fits), scoped to you. It names one operation on one record, ever: a retry replays the stored outcome (Idempotent-Replay: true) or attaches to the live one, and reuse on another record refuses 409 IDEMPOTENCY_KEY_REUSED. Missing or malformed, 400.

X-Request-IdstringOptional

Your own id for the request: 8 to 128 of [A-Za-z0-9._-]. It becomes the request’s id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.

Query parameters

minGlobalSequencestringOptionalformat: "^[0-9]{1,19}$"

A position you hold — an X-Immix-Global-Sequence you read, or a 202’s commandGlobalSequence: this member answers only once it has folded the platform’s stream through it, waiting up to its deadline, then 503 PROJECTION_BEHIND with Retry-After. Within that stream a read is never older than what you have seen; drop your positions after an announced stream cut. A retry stating its 202’s position attaches to or replays that operation while the journal holds its key, never publishing twice. Stated once: one to nineteen digits, at most 9223372036854775807; else 400 MALFORMED_REQUEST.

Request

This endpoint expects an object.
accountIdintegerRequired>=1
The account whose position or inventory is adjusted.
reasonenumRequired

Why. OTHER needs a remark.

Allowed values:
instrumentIdstring or nullOptionalformat: "^[1-9][0-9]*$"

The derivative position’s instrument; send this or assetId, not both.

assetIdinteger or nullOptional>=1

The asset whose inventory is adjusted; send this or instrumentId, not both.

costModeenum or nullOptional

How to apply the cost arm to the position’s cost basis in its settle asset, or the inventory’s cost basis in USD: SET replaces it, DELTA adds to it; omitted or NONE leaves it.

Allowed values:
coststring or nullOptionalformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (a decimal string): the cost arm’s value, in the settle asset for a position and in USD at most eight places for an inventory; send it exactly when the mode is SET or DELTA.

realizedPnlModeenum or nullOptional

How to apply the realizedPnl arm to the position’s realized PnL in its settle asset, or the inventory’s realized PnL in USD: SET replaces it, DELTA adds to it; omitted or NONE leaves it.

Allowed values:
realizedPnlstring or nullOptionalformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (a decimal string): the realizedPnl arm’s value, in the settle asset for a position and in USD at most eight places for an inventory; send it exactly when the mode is SET or DELTA.

feeAssetIdinteger or nullOptional>=1

The asset the fee arm is in — a position’s only; send it exactly when the fee arm is set.

feeModeenum or nullOptional

How to apply the fee arm: SET, DELTA, or omitted or NONE.

Allowed values:
feestring or nullOptionalformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (a decimal string): the fee arm’s value in feeAssetId; send it exactly when the fee arm is set.

fundingModeenum or nullOptional

How to apply the funding arm to the position’s cumulative funding in its settle asset: SET replaces it, DELTA adds to it; omitted or NONE leaves it. A position’s only: on an inventory it is refused (ARM_INVALID).

Allowed values:
fundingstring or nullOptionalformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (a decimal string): the funding arm’s value, in the position’s settle asset; send it exactly when the mode is SET or DELTA.

remarkstringOptional<=256 characters

What the adjustment corrects, for its approvers; US-ASCII, at most 256 bytes.

Response

The adjustment exists, PENDING_APPROVAL — with the answering change’s position, its ETag and, on a replayed key, Idempotent-Replay.

adjustmentIdstringformat: "^-?[0-9]+$"

The adjustment’s id, a 64-bit integer as decimal digits.

versionstringformat: "^-?[0-9]+$"

The adjustment’s version as a decimal string: 1 when proposed, one more for each approval and for the withdrawal; its ETag.

accountIdinteger

The account adjusted (GET /accounts).

instrumentIdstring or nullformat: "^-?[0-9]+$"

The derivative position’s instrument (GET /positions); null when the adjustment is of an inventory.

assetIdinteger or null

The inventory’s asset (GET /risk/exposures); null when the adjustment is of a position.

statusenum

PENDING_APPROVAL: proposed, moving nothing until approved. APPLIED: in the position or the inventory, as of effectiveSeq. WITHDRAWN: withdrawn, never applied. The value set is append-only: read an unknown value as UNKNOWN.

Allowed values:
reasonenum

Why it was made. The value set is append-only: read an unknown value as UNKNOWN.

Allowed values:
costModeenum

How the cost arm applies to the position’s cost basis in its settle asset, or the inventory’s cost basis in USD: SET replaces it, DELTA adds to it, NONE leaves it.

Allowed values:
coststring or nullformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (an exact decimal string at the scale the proposal stated it): the cost arm’s value; null when its mode is NONE.

realizedPnlModeenum

How the realizedPnl arm applies to the position’s realized PnL in its settle asset, or the inventory’s realized PnL in USD: SET replaces it, DELTA adds to it, NONE leaves it.

Allowed values:
realizedPnlstring or nullformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (an exact decimal string at the scale the proposal stated it): the realizedPnl arm’s value; null when its mode is NONE.

feeAssetIdinteger or null

The asset the fee arm is in; null when the fee is not adjusted.

feeModeenum

How the fee arm applies to a position’s fees paid in feeAssetId: SET, DELTA or NONE.

Allowed values:
feestring or nullformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (an exact decimal string at the scale the proposal stated it): the fee arm’s value; null when its mode is NONE.

fundingModeenum

How the funding arm applies to the position’s cumulative funding in its settle asset: SET replaces it, DELTA adds to it, NONE leaves it.

Allowed values:
fundingstring or nullformat: "^-?[0-9]+(\.[0-9]+)?$"<=64 characters

money (an exact decimal string at the scale the proposal stated it): the funding arm’s value, in the position’s settle asset; null when its mode is NONE.

effectiveSeqstringformat: "^-?[0-9]+$"

The stream position the adjustment takes effect at — its proposal’s: an applied adjustment moves the position or the inventory as it stood then, and every fill since is replayed through it.

proposedByobject

The maker — an actor, always a member’s: only members write risk.

proposedAtNsstringformat: "^-?[0-9]+$"
When it was proposed, epoch nanoseconds.
approvalslist of objects

Who approved it and when, in approval order; empty until the first approval. It applies when they number the organisation’s risk rule in force at that approval, and at least one (GET /approval-rules?family=RISK).

appliedAtNsstring or nullformat: "^-?[0-9]+$"

When it was applied, epoch nanoseconds; null until then.

withdrawnByobject or null

Who withdrew it; null unless withdrawn.

updatedByobject

Who produced this state: the maker on the proposal, an approver on an approval, the withdrawer on the withdrawal.

withdrawalReasonstring

Why it was withdrawn; empty unless withdrawn.

remarkstring
What it corrects, as its maker wrote it.
globalSequencestringOptionalformat: "^[0-9]+$"

The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.

Errors

400
Propose Adjustment Risk Request Bad Request Error
401
Propose Adjustment Risk Request Unauthorized Error
403
Propose Adjustment Risk Request Forbidden Error
409
Propose Adjustment Risk Request Conflict Error
413
Propose Adjustment Risk Request Content Too Large Error
422
Propose Adjustment Risk Request Unprocessable Entity Error
429
Propose Adjustment Risk Request Too Many Requests Error
500
Propose Adjustment Risk Request Internal Server Error
503
Propose Adjustment Risk Request Service Unavailable Error