subaccount_id you put on every order, deposit and withdrawal.
One subaccount trades both cNGN-USDC spot and the cNGN futures. Margin covers the
whole subaccount, across every series and the cNGN it holds.
Open a subaccount
Post a deposit toPOST /v1/deposits with subaccount_id 0.
The venue opens the subaccount, funds it and pays the gas. The response’s subaccount_id is your
new subaccount.
To top up a subaccount you already have, send its id instead of 0.
Ownership
Matching holds every subaccount and records its owner: theowner of the deposit that opened it.
Only the owner can deposit to it or withdraw from it, and withdrawals are paid to the owner.
A withdrawal lends the subaccount to the WithdrawalModule for the call. The subaccount stays in
Matching, so trading from it is not interrupted.
Trade from a session key
For orders, you can sign with a session key instead of the owner key. Register it on chain withregisterSessionKey(address toAllow, uint expiry). Matching then accepts that signer for all the
owner’s subaccounts until expiry. See Session keys.
Deposits and withdrawals must be signed by the owner. Session keys are not supported for them.
Use a subaccount on an order
Setsubaccount_id in the request body and subaccountId in the signed Action to the same id.
A mismatch is refused. See Order errors and validation.
Read a subaccount
GET /v1/positions?subaccount_id=N returns the subaccount’s
futures positions and its margin surplus, read from chain. No signature is needed, because
positions are public on chain.

