Archive a sub-account
Changed onArchives 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.
Request
- Base URLhttps://api.prod.paradex.trade/v1
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Sub-account address
Response
OK
Example response
{
"account": "0x495d2eb5236a12b8b4ad7d3849ce6a203ce21c43f473c248dfd5ce70d9454fa",
"archived_at": 1681471234972,
"created_at": 1681471234972,
"derivation_path": "m/44'/9004'/0'/0/1",
"fees": {
"commission_rate": "0.0001",
"dated_option_maker_rate": "0.0001",
"dated_option_taker_rate": "0.0001",
"discount_rate": "0.9",
"maker_rate": "0.0001",
"perp_option_maker_rate": "0.0001",
"perp_option_taker_rate": "0.0001",
"spot_maker_rate": "0.0001",
"spot_taker_rate": "0.0001",
"taker_rate": "0.0001"
},
"isolated_market": "ETHUSD-PERP",
"parent_account": "0x495d2eb5236a12b8b4ad7d3849ce6a203ce21c43f473c248dfd5ce70d",
"public_key": "0x495d2eb5236a12b8b4ad7d3849ce6a203ce21c43f473c248dfd5ce70d",
"username": "username"
}Changes
- info
endpoint added
- info