Skip to main content
If you maintain positions across multiple market deployers (MDs), you can rebalance margin between them directly using transferBetweenDeployers. The transfer moves funds from the source deployer’s cross margin pool to the destination deployer’s cross margin pool. Your chain-level balance is not affected in any way. Both deployers must be ones you are already enrolled in, and the transfer is subject to the same withdrawable amount constraints as unlockCollateral on the source side.
You must be enrolled in both the source and destination market deployers before calling this action.

Endpoint

Request

Every request must carry an ECDSA signature and a nonce to prevent replay attacks.

Action parameters

int32
required
The ID of the source market deployer. The transfer amount is deducted from this deployer’s cross margin pool and is subject to its withdrawable amount limit.
int32
required
The ID of the destination market deployer. The transfer amount is credited to this deployer’s cross margin pool.
int32
required
The coin or currency ID to transfer. Must be a coin supported by both market deployers.
string
required
The amount to transfer, expressed as a raw integer string (e.g. "1000"). Must be greater than zero and must not exceed the withdrawable amount on the source deployer. Decimals are not accepted — use the coin’s smallest unit.

Response

A successful transfer returns the updated cross margin balances for both market deployers.
int32
The coin ID that was transferred.
int64
The amount moved from the source to the destination market deployer.
int64
The cross margin balance of the source market deployer after the transfer.
int64
The cross margin balance of the destination market deployer after the transfer.

Errors

If the request cannot be fulfilled, the exchange still returns HTTP 200 with status: "ok" — the rejection is reported inside response.data, where a server-assigned integer errorCode and a human-readable errorMessage are populated while the numeric amount and balance fields are set to 0. Common causes include:
  • Amount exceeds withdrawable balance on source — position IM and frozen order margin reduce how much can be moved from the source deployer.
  • Not enrolled in one or both deployers — you must be enrolled in both the source and destination MDs.
  • Same source and destinationfromMarketDeployerId and toMarketDeployerId must differ.
  • Amount ≤ 0 — the amount field must be a positive integer string.
If you need to move funds involving your chain-level balance instead, use lockCollateral or unlockCollateral.