Skip to main content
Hyperliquid
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

Request Body

action

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. financing is unsupported and explicitly rejected. Margin adds use available collateral.

Response

pending confirms the request was recorded, not that margin has moved. Poll Isolated Operation Status using operationId. Market Trading State 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.