Skip to main content
POST
Builds the transactions that hand the market’s administration, and its liquidation router’s, to a successor wallet. The endpoint never submits them. The steps come back in the order the contracts require, each naming the wallet that signs it. Role and price-signer steps are confirmed through Set Access Role; ownership steps carry no confirm call, and planning again shows what is still outstanding.
The market and the router refuse an admin that revokes or renounces its own DEFAULT_ADMIN_ROLE, with SelfRemovalDisabled. The order is therefore fixed: the current admin signs the grants and the ownership offers first, then the successor signs the rest and revokes the predecessor last. Broadcast each step only after the previous one is mined.
With scope set to both, the default, the plan covers everything the predecessor holds on the market’s estate, so the departing key keeps nothing:
  • DEFAULT_ADMIN_ROLE on the market and on its liquidation router.
  • ISSUER_ROLE, LIQUIDATOR_ROLE and GUARDIAN_ROLE on the market and OPERATOR_ROLE on the router, where the predecessor holds them: the successor grants each to itself and revokes it from the predecessor.
  • Ownership of the price oracle, the insurance fund and the interest rate model, where the predecessor owns them: the predecessor offers it with transferOwnership, and the successor accepts it with acceptOwnership. The oracle owner signs prices without any grant, and the fund owner announces reserve withdrawals, so these steps matter as much as the role revokes.
  • The predecessor’s price-signer authorization on the oracle, removed by the successor once it owns the oracle.
With scope set to market or router the plan moves DEFAULT_ADMIN_ROLE on that contract only, and note says what stays with the predecessor. Anything the plan cannot move, such as a satellite owned by another wallet, is listed in kept. For each contract in scope the endpoint reads whether the successor already holds the role and which wallet is the predecessor: signerAddress when sent, otherwise the first verified wallet of your instance that holds the role. The grant step is left out when the successor already holds the role. The revoke step is left out when no predecessor could be named.

Path Parameters

string
required
The market’s record ID, as id on List Markets, not its contract address. See Market IDs.

Body Parameters

string
required
The wallet that takes over, as a 0x-prefixed 40-character hex address other than the zero address. It must differ from the current admin: a successor that already holds DEFAULT_ADMIN_ROLE while no other verified wallet of your instance does is refused with INVALID_ADDRESS.
string
default:"both"
market, router or both.
string
The current admin that will sign the grant. Omit it and the predecessor is the first verified wallet of your instance, other than the successor, that holds the role on each contract; when none does, the call is refused with PREDECESSOR_UNKNOWN and you name the admin here. The wallet named here is checked on the chain, and one that does not hold the role is refused with NOT_ADMIN.

Response Fields

object

Error Codes