> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notional.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Isolated Margin

<div className="venue-tags" aria-label="Supported venues">
  <span className="venue-tag">Hyperliquid</span>
</div>

Adds or removes USDC margin on an existing assigned HIP-3 position. The request is signed by the
user or an approved API wallet and completes asynchronously.

## Endpoint

```text theme={null}
POST /exchange
```

## Request Body

| Parameter | Type | Description |
| - | - | - |
| `action`\* | object | Isolated-margin action |
| `nonce`\* | number | Replay-protection nonce in Unix milliseconds |
| `signature`\* | object | Notional EIP-712 signature with `r`, `s`, and `v` |
| `expiresAfter` | number | Optional signed expiration time in Unix milliseconds |

### action

| Field | Type | Description |
| - | - | - |
| `type`\* | string | Must be `"updateIsolatedMargin"` |
| `asset`\* | string | Unprefixed 16-character HIP-3 AssetId |
| `direction`\* | string | `"add"` or `"remove"` |
| `amountMicroUsdc`\* | string | Positive integer amount in micro-USDC, with at most 15 digits |

```json theme={null}
{
  "action": {
    "type": "updateIsolatedMargin",
    "asset": "00050000001e3660",
    "direction": "add",
    "amountMicroUsdc": "5000000"
  },
  "nonce": 1785254400000,
  "signature": {
    "r": "0x1234...",
    "s": "0x5678...",
    "v": 27
  }
}
```

This adds 5 USDC. `amountMicroUsdc` must be a string matching `[1-9][0-9]{0,14}`: no sign,
leading zeroes, decimals, exponent notation, or zero. Removing margin also uses a positive amount;
`direction` supplies the direction of the change.

The shared `usdcDecimalToMicroUsdc` helper converts a decimal USDC string exactly and returns
`null` for invalid input. For example, `usdcDecimalToMicroUsdc("5")` returns `"5000000"`.

Sign the complete action using the same `NotionalExchange` signing flow as
[Place Order](/api-reference/exchange-endpoints/order).

`financing` is unsupported and explicitly rejected. Margin adds use available collateral.

## Response

```json theme={null}
{
  "status": "ok",
  "response": {
    "type": "updateIsolatedMargin",
    "data": {
      "status": "pending",
      "operationId": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  }
}
```

`pending` confirms the request was recorded, not that margin has moved. Poll
[Isolated Operation Status](/api-reference/info-endpoints/isolated-operation-status) using
`operationId`. [Market Trading State](/api-reference/info-endpoints/active-asset-data) exposes the current
scope, live operation, and `canAddMargin` / `canRemoveMargin` permissions.

## Admission Rules

* The market must use `hip3.executionPolicy: "exclusive_subaccount_v1"` and the user must have an
  eligible active assignment. This action does not open a position or allocate an assignment.
* Margin adds and removals must satisfy account, scope, and venue constraints. Removing support
  cannot leave the position under-margined.
* Conflicting operations, restrictions, or insufficient funds can reject the request with `400`.
* An exact retry of a recorded request can return the same pending `operationId`; use the status
  read for its eventual result.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.