Skip to main content
When you want to trade contracts under a specific market deployer (MD), 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
The ID of the market deployer you want to fund. You must already be enrolled in this deployer.
int32
required
The coin or currency ID to transfer. Must match a coin supported by the target market deployer.
string
required
The amount to transfer, expressed as a raw integer string (e.g. "1000"). Must be greater than zero. 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.

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:
  • 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 an MD.
  • Amount ≤ 0 — the amount field must be a positive integer string.
To move funds in the opposite direction — from a market deployer back to your chain-level balance — use unlockCollateral.