Archive a sub-account
Archives one of the authenticated main account’s sub-accounts.
Archiving only marks the sub-account as archived so clients can hide it:
nothing is deleted, its keys keep working and its on-chain account is
untouched. GET /account/subaccounts keeps listing it, with archived_at
set. Only a session authenticated with the main account’s own key is
accepted.
address must be a sub-account onboarded under the authenticated account,
matched regardless of case and leading zeros; any other address answers
404 ACCOUNT_NOT_FOUND. Only an account of kind subaccount can be archived:
an isolated or vault account answers 400 INVALID_REQUEST_PARAMETER.
The sub-account must hold nothing: its account value and total collateral
must both be zero, every token balance must have a size of zero (a token
with no price adds nothing to the account value), it must hold no shares of
any vault, and it must have no open position and no open order (stop orders
included). Otherwise the request is refused with 400 SUBACCOUNT_HAS_FUNDS,
whose message says which. When any of these cannot be read, the request
fails rather than archiving a sub-account that may still hold something.
An archived sub-account frees its place in the main account’s sub-account
limit (SUBACCOUNTS_LIMIT_EXCEEDED at onboarding), but archived sub-accounts
still count towards a total of twice that limit.
Archiving is idempotent: archiving a sub-account already archived answers
200 with its first archived_at, without checking its funds again.
Responds with the archived sub-account; archived_at is in milliseconds
since epoch.
Authentication
Path parameters
Sub-account address
Response
Time the main account archived this sub-account, in unix milliseconds; absent when not archived
Account derivation path used to derive the account, if a sub-account
True if account owns an ecosystem NFT (Money Badgers / ShizoPunk) — qualifies for the lower retail tier thresholds