apply_adjustment
Adjust an account's available, held, or incoming asset balance by absolute value or delta while enforcing bounds; records or rejects the adjustment with a reason.
Instructions
Apply an adjustment to an account's balances of one asset through the engine and return the recorded adjustment. An agent may only lower the balance (available), held and incoming of the account's own currency, each set to a value (absolute) or changed by one (delta), given as exact decimal strings: another asset, a position included, an account without a currency of its own, a delta above zero or an absolute above the field's current value refuses the whole adjustment with loosening_refused and changes nothing, and so does an averageEntryPrice or a realizedPnl other than the current one, or any realizedPnl while the position's P&L calculation is halted, as it would restart it. A bound constrains the value the adjustment results in, not the change: a result outside it records the adjustment as rejected with a structured reason and changes no balance, a policy outcome rather than an error. An adjustment that changes nothing, such as one naming no field, is not recorded and returns no adjustment. Mutates account balances; protected and disabled by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | Account code | |
| adjustment | Yes | Adjustment to apply to the account's balances of one asset | |
| missingAccount | Yes | Required: create or reject; for an account that does not exist yet, create is refused for an agent with loosening_refused, and reject fails the adjustment instead |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adjustment | No |