lockIntoShareGroup lets you move collateral directly from your chain-level balance into a share group’s shared margin pool in a single step. This is the most direct way to fund PORTFOLIO mode trading when you already have chain-level funds available and want to skip the intermediate per-market-deployer allocation.
Share-group margin applies to accounts in PORTFOLIO margin mode, where contracts in the same share group draw from one pooled balance. See
setMarginShareType.Endpoint
Request
Every request must carry an ECDSA signature and a nonce to prevent replay attacks.Action parameters
int32
required
groupId (required) — The ID of the target share group. Funds are credited directly to this group’s shared margin pool.int32
required
coinId (required) — The coin or currency ID to transfer from your chain-level balance into the share group.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 and must not exceed your available chain-level balance for the given coin. Decimals are not accepted — use the coin’s smallest unit.The server does not reject a request that omits
marketDeployerId, groupId, or coinId with a 400: an omitted ID is treated as 0, and the resulting invalid combination is returned as HTTP 200 with a non-zero errorCode in response.data. Only a missing, malformed, or non-positive amount returns a 400. Always send every ID explicitly.Response
A successful transfer returns the updated balances for both the source (your chain-level ledger, represented asfromBalanceAfter) and the destination share group. The response type is shareGroupFund, consistent with other share group fund operations.
int32
The coin ID that was transferred.
int64
The amount moved from your chain-level balance into the share group.
int64
Your chain-level balance for this coin after the transfer.
int64
The share group’s margin pool balance 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 withstatus: "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
amountexceeds your available chain-level funds for the given coin. - Unknown
groupId— the specified share group does not exist.
