Account

Archive a sub-account

Changed on

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.

delete/account/subaccounts/{address}

Request

Path parameters

addressstring required

Sub-account address

Response

OK

accountstring

Starknet address of the account

archived_atinteger

Time the main account archived this sub-account, in unix milliseconds; absent when not archived

created_atinteger

Account creation time

derivation_pathstring

Account derivation path used to derive the account, if a sub-account

has_ecosystem_nftboolean

True if account owns an ecosystem NFT (Money Badgers / ShizoPunk) — qualifies for the lower retail tier thresholds

isolated_marketstring

Isolated market for the account

kind'' | 'main' | 'subaccount' | 'vault_operator' | 'vault_sub_operator'
parent_accountstring

Starknet address of the parent account

public_keystring

Starknet public key

usernamestring

Username of the account

volume_tiersobject

Volume tier info by kind

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