Skip to main content
When you want to trade contracts under a specific market deployer, you first need to move funds from your chain-level balance into that deployer’s cross margin pool. The lockCollateral action performs this transfer — your total funds remain constant, since this is a reallocation rather than a deposit or mint. Once locked, those funds are available as margin for any contracts offered by that market deployer.
You must be enrolled in the target market deployer before calling lockCollateral. If you haven’t enrolled yet, see enrollUserToMarketDeployer.

Endpoint

Request

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

Action parameters

int32
required
marketDeployerId (required) — The ID of the market deployer you want to fund. You must already be enrolled in this deployer.
int32
required
coinId (required) — The coin or currency ID to transfer. Must match a coin supported by the target market deployer.
string
required
amount (required) — The amount to transfer, expressed as a raw integer string (e.g. "1000"). Must be greater than zero — 0 or a negative value returns 400 INVALID_PARAM. Decimals are not accepted — use the coin’s smallest unit.

Response

A successful transfer returns the updated balances for both your chain-level ledger and the market deployer’s cross margin pool.
int32
The coin ID that was transferred, confirming which asset was moved.
int64
The amount that was transferred into the market deployer’s cross margin pool.
int64
Your chain-level balance for this coin after the transfer.
int64
Your cross margin balance within the target market deployer after the transfer.
number
Present only when the request is rejected; a non-zero value means nothing moved.
string
Present together with errorCode. The rejection reason.

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 non-zero errorCode (number) and an errorMessage are present while the numeric amount and balance fields are set to 0. Common causes include:
  • Insufficient chain-level balance — the requested amount exceeds your available chain-level funds for the given coin.
  • Not enrolled in the market deployer — you must enroll before locking collateral into a market deployer.

HTTP errors

To move funds in the opposite direction — from a market deployer back to your chain-level balance — use unlockCollateral.